create display::blindfold accessors
This commit is contained in:
parent
bd09e01992
commit
e9841da6f5
2 changed files with 19 additions and 0 deletions
|
@ -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
|
||||
{
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Add table
Reference in a new issue