create display::blindfold accessors

This commit is contained in:
Chris Beck 2014-02-23 17:31:49 -05:00
parent bd09e01992
commit e9841da6f5
2 changed files with 19 additions and 0 deletions

View file

@ -208,6 +208,8 @@ display::display(unit_map* units, CVideo& video, const gamemap* map, const std::
{
singleton_ = this;
blindfold_ctr_ = 0;
read(level.child_or_empty("display"));
if(non_interactive()
@ -576,6 +578,19 @@ void display::change_teams(const std::vector<team>* teams)
teams_ = teams;
}
void display::blindfold(bool value)
{
if(value == true)
++blindfold_ctr_;
else
--blindfold_ctr_;
}
bool display::is_blindfolded() const
{
return blindfold_ctr_ > 0;
}
const SDL_Rect& display::max_map_area() const
{

View file

@ -599,6 +599,9 @@ public:
virtual bool has_time_area() const {return false;}
void blindfold(bool flag);
bool is_blindfolded() const;
void write(config& cfg) const;
private:
void read(const config& cfg);
@ -620,6 +623,7 @@ private:
*/
const SDL_Rect& calculate_energy_bar(surface surf);
int blindfold_ctr_;
protected:
//TODO sort