Add get_team() to display_context for 1-indexed lookup
This commit is contained in:
parent
43f5deaaf0
commit
5bcc7a07f7
3 changed files with 7 additions and 0 deletions
|
@ -24,6 +24,10 @@ std::vector<std::string>& display_context::hidden_label_categories_ref() {
|
|||
return const_cast<std::vector<std::string>&>(this->hidden_label_categories());
|
||||
}
|
||||
|
||||
const team& display_context::get_team(int side) const {
|
||||
return teams()[side-1];
|
||||
}
|
||||
|
||||
bool display_context::would_be_discovered(const map_location & loc, int side_num, bool see_all)
|
||||
{
|
||||
map_location adjs[6];
|
||||
|
|
|
@ -56,6 +56,7 @@ public:
|
|||
virtual const unit_map & units() const = 0;
|
||||
virtual const std::vector<std::string> & hidden_label_categories() const = 0;
|
||||
std::vector<std::string> & hidden_label_categories_ref();
|
||||
const team& get_team(int side) const;
|
||||
|
||||
// Helper for is_visible_to_team
|
||||
|
||||
|
|
|
@ -93,6 +93,8 @@ public:
|
|||
virtual ~game_board();
|
||||
|
||||
virtual const std::vector<team> & teams() const { return teams_; }
|
||||
using display_context::get_team; // so as not to hide the const version
|
||||
team& get_team(int i) {return teams_[i - 1];}
|
||||
virtual std::vector<team> & teams() { return teams_; }
|
||||
virtual const gamemap & map() const { return *map_; }
|
||||
virtual const unit_map & units() const { return units_; }
|
||||
|
|
Loading…
Add table
Reference in a new issue