Skip to content
Permalink
Browse files

CODE add suggested overrides, remove redundant virtual (ceeac)

git-svn-id: svn://tron.homeunix.org/simutrans/simutrans/trunk@8692 8aca7d54-2c30-db11-9de9-000461428c89
  • Loading branch information
Dwachs committed Feb 22, 2019
1 parent c1169ab commit ed87b8e7c110792eab0c0b4bfd1078c78ea97990
Showing with 657 additions and 649 deletions.
  1. +1 −1 bauer/fabrikbauer.cc
  2. +5 −5 bauer/wegbauer.cc
  3. +5 −5 boden/boden.h
  4. +8 −8 boden/brueckenboden.h
  5. +3 −3 boden/fundament.h
  6. +4 −4 boden/monorailboden.h
  7. +6 −6 boden/tunnelboden.h
  8. +7 −7 boden/wasser.h
  9. +2 −3 boden/wege/kanal.h
  10. +2 −2 boden/wege/maglev.h
  11. +2 −2 boden/wege/monorail.h
  12. +2 −2 boden/wege/narrowgauge.h
  13. +6 −6 boden/wege/schiene.h
  14. +2 −2 boden/wege/strasse.h
  15. +12 −12 boden/wege/weg.h
  16. +0 −1 dataobj/scenario.h
  17. +31 −31 dataobj/schedule.h
  18. +1 −1 finder/building_placefinder.h
  19. +1 −1 finder/placefinder.h
  20. +5 −5 gui/ai_selector.h
  21. +2 −2 gui/banner.cc
  22. +3 −3 gui/base_info.h
  23. +3 −3 gui/baum_edit.h
  24. +4 −4 gui/city_info.cc
  25. +4 −4 gui/components/gui_building.h
  26. +1 −1 gui/components/gui_button_to_chart.h
  27. +3 −3 gui/components/gui_colorbox.h
  28. +3 −3 gui/components/gui_divider.h
  29. +2 −2 gui/components/gui_flowtext.h
  30. +1 −1 gui/components/gui_label.h
  31. +2 −2 gui/components/gui_location_view_t.h
  32. +5 −5 gui/components/gui_scrolled_list.h
  33. +3 −3 gui/components/gui_textarea.h
  34. +1 −1 gui/convoi_detail_t.cc
  35. +1 −1 gui/depot_frame.h
  36. +2 −2 gui/display_settings.cc
  37. +1 −1 gui/fabrik_info.cc
  38. +4 −4 gui/ground_info.h
  39. +2 −2 gui/gui_frame.h
  40. +3 −3 gui/halt_detail.cc
  41. +5 −5 gui/halt_detail.h
  42. +2 −2 gui/headquarter_info.h
  43. +1 −1 gui/kennfarbe.cc
  44. +3 −4 gui/labellist_frame_t.h
  45. +4 −4 gui/load_relief_frame.h
  46. +6 −5 gui/loadsave_frame.h
  47. +3 −3 gui/messagebox.h
  48. +3 −3 gui/obj_info.h
  49. +8 −8 gui/pakselector.h
  50. +1 −1 gui/player_frame_t.cc
  51. +1 −1 gui/savegame_frame.cc
  52. +5 −5 gui/scenario_frame.h
  53. +4 −4 gui/scenario_info.h
  54. +4 −4 gui/schedule_gui.cc
  55. +6 −6 network/network_cmd.h
  56. +45 −40 network/network_cmd_ingame.h
  57. +8 −7 network/network_cmd_scenario.h
  58. +4 −3 network/network_cmp_pakset.h
  59. +14 −14 obj/baum.h
  60. +13 −12 obj/bruecke.h
  61. +12 −12 obj/crossing.h
  62. +2 −2 obj/dummy.h
  63. +6 −6 obj/field.h
  64. +18 −17 obj/gebaeude.h
  65. +9 −9 obj/groundobj.h
  66. +4 −4 obj/label.h
  67. +28 −28 obj/leitung2.h
  68. +8 −8 obj/pillar.h
  69. +15 −15 obj/roadsign.h
  70. +4 −4 obj/signal.h
  71. +12 −11 obj/tunnel.h
  72. +10 −10 obj/wolke.h
  73. +4 −4 obj/zeiger.h
  74. +4 −4 old_blockmanager.cc
  75. +2 −2 player/ai.h
  76. +9 −9 player/ai_goods.h
  77. +7 −7 player/ai_passenger.h
  78. +3 −3 simcity.cc
  79. +2 −2 simconvoi.h
  80. +60 −60 simdepot.h
  81. +1 −1 simmenu.h
  82. +1 −1 simobj.h
  83. +10 −10 simtool.cc
  84. +13 −13 vehicle/movingobj.h
  85. +10 −10 vehicle/simpeople.h
  86. +21 −21 vehicle/simroadtraffic.h
  87. +87 −87 vehicle/simvehicle.h
@@ -118,7 +118,7 @@ class factory_site_searcher_t: public building_placefinder_t {
public:
factory_site_searcher_t(karte_t* welt, factory_desc_t::site_t site_) : building_placefinder_t(welt), site(site_) {}

virtual bool is_area_ok(koord pos, sint16 w, sint16 h, climate_bits cl) const
bool is_area_ok(koord pos, sint16 w, sint16 h, climate_bits cl) const OVERRIDE
{
if( !building_placefinder_t::is_area_ok(pos, w, h, cl) ) {
return false;
@@ -2806,11 +2806,11 @@ void way_builder_t::build_powerline()
// this can drive any river, even a river that has max_speed=0
class fluss_fahrer_t : public test_driver_t
{
bool check_next_tile(const grund_t* gr) const { return gr->get_weg_ribi_unmasked(water_wt)!=0; }
virtual ribi_t::ribi get_ribi(const grund_t* gr) const { return gr->get_weg_ribi_unmasked(water_wt); }
virtual waytype_t get_waytype() const { return invalid_wt; }
virtual int get_cost(const grund_t *, const weg_t *, const sint32, ribi_t::ribi) const { return 1; }
virtual bool is_target(const grund_t *cur,const grund_t *) const { return cur->is_water() && cur->get_grund_hang()==slope_t::flat; }
bool check_next_tile(const grund_t* gr) const OVERRIDE { return gr->get_weg_ribi_unmasked(water_wt)!=0; }
ribi_t::ribi get_ribi(const grund_t* gr) const OVERRIDE { return gr->get_weg_ribi_unmasked(water_wt); }
waytype_t get_waytype() const OVERRIDE { return invalid_wt; }
int get_cost(const grund_t *, const weg_t *, const sint32, ribi_t::ribi) const OVERRIDE { return 1; }
bool is_target(const grund_t *cur,const grund_t *) const OVERRIDE { return cur->is_water() && cur->get_grund_hang()==slope_t::flat; }
};


@@ -19,19 +19,19 @@
class boden_t : public grund_t
{
protected:
virtual void calc_image_internal(const bool calc_only_snowline_change);
void calc_image_internal(const bool calc_only_snowline_change) OVERRIDE;

public:
boden_t(loadsave_t *file, koord pos );
boden_t(koord3d pos, slope_t::type slope);

virtual void rdwr(loadsave_t *file);
void rdwr(loadsave_t *file) OVERRIDE;

inline bool ist_natur() const { return !hat_wege() && !is_halt(); }
inline bool ist_natur() const OVERRIDE { return !hat_wege() && !is_halt(); }

const char *get_name() const;
const char *get_name() const OVERRIDE;

grund_t::typ get_typ() const {return boden;}
grund_t::typ get_typ() const OVERRIDE {return boden;}
};

#endif
@@ -9,25 +9,25 @@ class brueckenboden_t : public grund_t
uint8 weg_hang;

protected:
void calc_image_internal(const bool calc_only_snowline_change);
void calc_image_internal(const bool calc_only_snowline_change) OVERRIDE;

public:
brueckenboden_t(loadsave_t *file, koord pos ) : grund_t(koord3d(pos,0) ) { rdwr(file); }
brueckenboden_t(koord3d pos, int grund_hang, int weg_hang);

virtual void rdwr(loadsave_t *file);
void rdwr(loadsave_t *file) OVERRIDE;

// map rotation
virtual void rotate90();
void rotate90() OVERRIDE;

virtual sint8 get_weg_yoff() const;
sint8 get_weg_yoff() const OVERRIDE;

slope_t::type get_weg_hang() const { return weg_hang; }
slope_t::type get_weg_hang() const OVERRIDE { return weg_hang; }

const char *get_name() const {return "Brueckenboden";}
typ get_typ() const { return brueckenboden; }
const char *get_name() const OVERRIDE {return "Brueckenboden";}
typ get_typ() const OVERRIDE { return brueckenboden; }

void info(cbuffer_t & buf) const;
void info(cbuffer_t & buf) const OVERRIDE;
};

#endif
@@ -16,7 +16,7 @@ class fundament_t : public grund_t
* The foundation always have the same image.
* @author Hj. Malthaner
*/
void calc_image_internal(const bool calc_only_snowline_change);
void calc_image_internal(const bool calc_only_snowline_change) OVERRIDE;

public:
fundament_t(loadsave_t *file, koord pos );
@@ -27,9 +27,9 @@ class fundament_t : public grund_t
* @return 'Fundament'.
* @author Hj. Malthaner
*/
const char *get_name() const {return "Fundament";}
const char *get_name() const OVERRIDE {return "Fundament";}

typ get_typ() const { return fundament; }
typ get_typ() const OVERRIDE { return fundament; }

bool set_slope(slope_t::type) { slope = 0; return false; }
};
@@ -6,16 +6,16 @@
class monorailboden_t : public grund_t
{
protected:
void calc_image_internal(const bool calc_only_snowline_change);
void calc_image_internal(const bool calc_only_snowline_change) OVERRIDE;

public:
monorailboden_t(loadsave_t *file, koord pos ) : grund_t( koord3d(pos,0) ) { rdwr(file); }
monorailboden_t(koord3d pos,slope_t::type slope);

virtual void rdwr(loadsave_t *file);
void rdwr(loadsave_t *file) OVERRIDE;

const char *get_name() const {return "Monorailboden";}
typ get_typ() const { return monorailboden; }
const char *get_name() const OVERRIDE {return "Monorailboden";}
typ get_typ() const OVERRIDE { return monorailboden; }
};

#endif
@@ -7,20 +7,20 @@
class tunnelboden_t : public boden_t
{
protected:
void calc_image_internal(const bool calc_only_snowline_change);
void calc_image_internal(const bool calc_only_snowline_change) OVERRIDE;

public:
tunnelboden_t(loadsave_t *file, koord pos );
tunnelboden_t(koord3d pos, slope_t::type slope_type) : boden_t(pos, slope_type) {}

virtual void rdwr(loadsave_t *file);
void rdwr(loadsave_t *file) OVERRIDE;

slope_t::type get_weg_hang() const { return ist_karten_boden() ? (slope_t::type)slope_t::flat : get_grund_hang(); }
slope_t::type get_weg_hang() const OVERRIDE { return ist_karten_boden() ? (slope_t::type)slope_t::flat : get_grund_hang(); }

const char *get_name() const {return "Tunnelboden";}
typ get_typ() const { return tunnelboden; }
const char *get_name() const OVERRIDE {return "Tunnelboden";}
typ get_typ() const OVERRIDE { return tunnelboden; }

void info(cbuffer_t & buf) const;
void info(cbuffer_t & buf) const OVERRIDE;
};

#endif
@@ -20,24 +20,24 @@ class wasser_t : public grund_t
/**
* This method also recalculates ribi and cache_ribi!
*/
void calc_image_internal(const bool calc_only_snowline_change);
void calc_image_internal(const bool calc_only_snowline_change) OVERRIDE;

public:

wasser_t(loadsave_t *file, koord pos ) : grund_t(koord3d(pos,0) ), ribi(ribi_t::none), canal_ribi(ribi_t::none) { rdwr(file); }
wasser_t(koord3d pos);

inline bool is_water() const { return true; }
inline bool is_water() const OVERRIDE { return true; }

// returns correct directions for water and none for the rest ...
ribi_t::ribi get_weg_ribi(waytype_t typ) const { return (typ==water_wt) ? ribi : (ribi_t::ribi)ribi_t::none; }
ribi_t::ribi get_weg_ribi_unmasked(waytype_t typ) const { return (typ==water_wt) ? ribi : (ribi_t::ribi)ribi_t::none; }
ribi_t::ribi get_weg_ribi(waytype_t typ) const OVERRIDE { return (typ==water_wt) ? ribi : (ribi_t::ribi)ribi_t::none; }
ribi_t::ribi get_weg_ribi_unmasked(waytype_t typ) const OVERRIDE { return (typ==water_wt) ? ribi : (ribi_t::ribi)ribi_t::none; }

const char *get_name() const {return "Water";}
grund_t::typ get_typ() const {return wasser;}
const char *get_name() const OVERRIDE {return "Water";}
grund_t::typ get_typ() const OVERRIDE {return wasser;}

// map rotation
void rotate90();
void rotate90() OVERRIDE;

ribi_t::ribi get_canal_ribi() const { return canal_ribi; }

@@ -12,15 +12,14 @@
*/
class kanal_t : public weg_t
{

public:
static const way_desc_t *default_kanal;

kanal_t(loadsave_t *file);
kanal_t();

waytype_t get_waytype() const {return water_wt;}
virtual void rdwr(loadsave_t *file);
waytype_t get_waytype() const OVERRIDE {return water_wt;}
void rdwr(loadsave_t *file) OVERRIDE;
};

#endif
@@ -25,9 +25,9 @@ class maglev_t : public schiene_t
*/
maglev_t(loadsave_t *file);

virtual waytype_t get_waytype() const {return maglev_wt;}
waytype_t get_waytype() const OVERRIDE {return maglev_wt;}

void rdwr(loadsave_t *file);
void rdwr(loadsave_t *file) OVERRIDE;
};

#endif
@@ -32,9 +32,9 @@ class monorail_t : public schiene_t
*/
monorail_t(loadsave_t *file);

virtual waytype_t get_waytype() const {return monorail_wt;}
waytype_t get_waytype() const OVERRIDE {return monorail_wt;}

void rdwr(loadsave_t *file);
void rdwr(loadsave_t *file) OVERRIDE;
};

#endif
@@ -25,9 +25,9 @@ class narrowgauge_t : public schiene_t
*/
narrowgauge_t(loadsave_t *file);

virtual waytype_t get_waytype() const {return narrowgauge_wt;}
waytype_t get_waytype() const OVERRIDE {return narrowgauge_wt;}

void rdwr(loadsave_t *file);
void rdwr(loadsave_t *file) OVERRIDE;
};

#endif
@@ -43,13 +43,13 @@ class schiene_t : public weg_t

schiene_t();

virtual waytype_t get_waytype() const {return track_wt;}
waytype_t get_waytype() const OVERRIDE {return track_wt;}

/**
* @return additional info is reservation!
* @author prissi
*/
void info(cbuffer_t & buf) const;
void info(cbuffer_t & buf) const OVERRIDE;

/**
* true, if this rail can be reserved
@@ -84,27 +84,27 @@ class schiene_t : public weg_t
/* called before deletion;
* last chance to unreserve tiles ...
*/
virtual void cleanup(player_t *player);
void cleanup(player_t *player) OVERRIDE;

/**
* gets the related convoi
* @author prissi
*/
convoihandle_t get_reserved_convoi() const {return reserved;}

void rdwr(loadsave_t *file);
void rdwr(loadsave_t *file) OVERRIDE;

/**
* if a function return here a value with TRANSPARENT_FLAGS set
* then a transparent outline with the color form the lower 8 Bit is drawn
* @author kierongreen
*/
virtual FLAGGED_PIXVAL get_outline_colour() const { return (show_reservations && reserved.is_bound()) ? TRANSPARENT75_FLAG | OUTLINE_FLAG | color_idx_to_rgb(COL_RED) : 0;}
FLAGGED_PIXVAL get_outline_colour() const OVERRIDE { return (show_reservations && reserved.is_bound()) ? TRANSPARENT75_FLAG | OUTLINE_FLAG | color_idx_to_rgb(COL_RED) : 0;}

/*
* to show reservations if needed
*/
virtual image_id get_outline_image() const { return weg_t::get_image(); }
image_id get_outline_image() const OVERRIDE { return weg_t::get_image(); }
};


@@ -16,11 +16,11 @@ class strasse_t : public weg_t
strasse_t(loadsave_t *file);
strasse_t();

inline waytype_t get_waytype() const {return road_wt;}
inline waytype_t get_waytype() const OVERRIDE {return road_wt;}

void set_gehweg(bool janein);

virtual void rdwr(loadsave_t *file);
void rdwr(loadsave_t *file) OVERRIDE;
};

#endif
@@ -146,13 +146,13 @@ class weg_t : public obj_no_info_t
/**
* Actual image recalculation
*/
void calc_image();
void calc_image() OVERRIDE;

/**
* Called whenever the season or snowline height changes
* return false and the obj_t will be deleted
*/
bool check_season(const bool calc_only_season_change);
bool check_season(const bool calc_only_season_change) OVERRIDE;

/**
* Setzt die erlaubte Höchstgeschwindigkeit
@@ -180,37 +180,37 @@ class weg_t : public obj_no_info_t
// returns a string with the "official name of the waytype"
static const char *waytype_to_string(waytype_t wt);

virtual void rdwr(loadsave_t *file);
void rdwr(loadsave_t *file) OVERRIDE;

/**
* Info-text for this way
* @author Hj. Malthaner
*/
virtual void info(cbuffer_t & buf) const;
void info(cbuffer_t & buf) const OVERRIDE;

/**
* @return NULL if OK, otherwise an error message
* @author Hj. Malthaner
*/
virtual const char *is_deletable(const player_t *player);
const char *is_deletable(const player_t *player) OVERRIDE;

/**
* Wegtyp zurückliefern
*/
virtual waytype_t get_waytype() const = 0;
waytype_t get_waytype() const OVERRIDE = 0;

/**
* 'Jedes Ding braucht einen Typ.'
* @return Gibt den typ des Objekts zurück.
* @author Hj. Malthaner
*/
typ get_typ() const { return obj_t::way; }
typ get_typ() const OVERRIDE { return obj_t::way; }

/**
* Die Bezeichnung des Wegs
* @author Hj. Malthaner
*/
const char *get_name() const { return desc->get_name(); }
const char *get_name() const OVERRIDE { return desc->get_name(); }

/**
* Add direction bits (ribi) for a way.
@@ -264,7 +264,7 @@ class weg_t : public obj_no_info_t
* called during map rotation
* @author priss
*/
void rotate90();
void rotate90() OVERRIDE;

/**
* book statistics - is called very often and therefore inline
@@ -313,14 +313,14 @@ class weg_t : public obj_no_info_t
void clear_sign_flag() { flags &= ~(HAS_SIGN | HAS_SIGNAL); }

inline void set_image( image_id b ) { image = b; }
image_id get_image() const {return image;}
image_id get_image() const OVERRIDE {return image;}

inline void set_foreground_image( image_id b ) { foreground_image = b; }
image_id get_front_image() const {return foreground_image;}
image_id get_front_image() const OVERRIDE {return foreground_image;}


// correct maintenance
void finish_rd();
void finish_rd() OVERRIDE;
} GCC_PACKED;

#endif
@@ -42,7 +42,6 @@ class scenario_t
/// the world we are scripting in
karte_t *welt;


/// name of scenario, files are searched in scenario_path/scenario_name/...
/// e.g. my_scenario
plainstring scenario_name;

0 comments on commit ed87b8e

Please sign in to comment.
You can’t perform that action at this time.