1 #ifndef obj_bruecke_h 2 #define obj_bruecke_h 3 4 class karte_t; 5 6 #include "../descriptor/bridge_desc.h" 7 #include "../simobj.h" 8 9 /** 10 * Brueckenteile (sichtbar) 11 * 12 * Hj. Malthaner 13 */ 14 15 class bruecke_t : public obj_no_info_t 16 { 17 private: 18 const bridge_desc_t *desc; 19 bridge_desc_t::img_t img; 20 21 protected: 22 void rdwr(loadsave_t *file) OVERRIDE; 23 24 public: 25 bruecke_t(loadsave_t *file); 26 bruecke_t(koord3d pos, player_t *player, const bridge_desc_t *desc, bridge_desc_t::img_t img); 27 get_name()28 const char *get_name() const OVERRIDE {return "Bruecke";} get_typ()29 typ get_typ() const OVERRIDE { return bruecke; } 30 31 /** 32 * waytype associated with this object 33 */ get_waytype()34 waytype_t get_waytype() const OVERRIDE { return desc ? desc->get_waytype() : invalid_wt; } 35 get_desc()36 const bridge_desc_t *get_desc() const { return desc; } 37 38 // we will always replace first way image get_image()39 image_id get_image() const OVERRIDE { return IMG_EMPTY; } 40 41 image_id get_front_image() const OVERRIDE; 42 43 void calc_image() OVERRIDE; 44 45 /** 46 * Called whenever the season or snowline height changes 47 * return false and the obj_t will be deleted 48 */ check_season(const bool calc_only_season_change)49 bool check_season(const bool calc_only_season_change) OVERRIDE { if( !calc_only_season_change ) { calc_image(); } return true; } // depends on snowline only 50 51 void finish_rd() OVERRIDE; 52 53 void cleanup(player_t *player) OVERRIDE; 54 55 void rotate90() OVERRIDE; 56 57 /** 58 * @return NULL wenn OK, ansonsten eine Fehlermeldung 59 * @author Hj. Malthaner 60 */ 61 const char *is_deletable(const player_t *player) OVERRIDE; 62 }; 63 64 #endif 65