Fix constness of display::get_time_of_day and make it public

This commit is contained in:
Ali El Gariani 2010-07-17 13:30:37 +00:00
parent e229df747d
commit 6755770b22
3 changed files with 5 additions and 4 deletions

View file

@ -478,6 +478,8 @@ public:
void set_report_content(const reports::TYPE which_report, const std::string &content);
std::map<reports::TYPE, std::string> get_report_contents() const {return report_;};
virtual const time_of_day get_time_of_day(const map_location& /*loc*/) const {return time_of_day();}
protected:
/** Clear the screen contents */
void clear_screen();
@ -514,7 +516,6 @@ protected:
*/
virtual void draw_hex(const map_location& loc);
virtual const time_of_day get_time_of_day(const map_location& /*loc*/) {return time_of_day();}
/**
* @returns the image type to be used for the passed hex
* (mostly to do with brightening like for mouseover)

View file

@ -412,7 +412,7 @@ void game_display::draw_hex(const map_location& loc)
//simulate_delay += 1;
}
const time_of_day game_display::get_time_of_day(const map_location& loc)
const time_of_day game_display::get_time_of_day(const map_location& loc) const
{
return tod_manager_.get_time_of_day(0,loc);
}

View file

@ -143,6 +143,8 @@ public:
/** Same as invalidate_unit() if moving the displayed unit. */
void invalidate_unit_after_move(const map_location& src, const map_location& dst);
const time_of_day get_time_of_day(const map_location& loc) const;
protected:
/**
* game_display pre_draw does specific things related e.g. to unit rendering
@ -160,8 +162,6 @@ protected:
void draw_hex(const map_location& loc);
const time_of_day get_time_of_day(const map_location& loc);
/**
* Animated hex invalidation specific to gameplay
*/