38 const unit & u = *u_it;
44 }
else if (!
teams()[side_num-1].fogged(u_loc)
55 if (!
map().on_board(loc))
return nullptr;
57 if (!u.
valid() || !u->is_visible_to_team(current_team,
map(), see_all)) {
83 for(
int n = 0;
n != 6; ++
n) {
86 if (i.
valid() && !i->incapacitated() &&
107 const std::vector<team> &
t =
teams();
108 for(
size_t i = 0;
i != t.size(); ++
i) {
109 if(t[
i].owns_village(loc))
134 if (u.side() == side) ++res;
143 if (u.side() == side) res += u.cost();
152 if (u.side() == side) res += u.upkeep();
int side_units(int side_num) const
Returns the number of units of the side side_num.
const map_location & get_location() const
int movement_cost(const t_translation::t_terrain &terrain) const
std::vector< std::string > & hidden_label_categories_ref()
void get_adjacent_tiles(const map_location &a, map_location *res)
Function which, given a location, will place all adjacent locations in res.
bool is_enemy(int n) const
int village_owner(const map_location &loc) const
Given the location of a village, will return the 0-based index of the team that currently owns it...
bool unit_can_move(const unit &u) const
Will return true iff the unit u has any possible moves it can do (including attacking etc)...
virtual const gamemap & map() const =0
int side_upkeep(int side_num) const
This class stores all the data for a single 'side' (in game nomenclature).
bool incapacitated() const
const t_string & user_team_name() const
virtual const unit_map & units() const =0
int movement_left() const
Returns how far a unit can move this turn (zero if incapacitated).
const std::set< map_location > & villages() const
bool invisible(const map_location &loc, bool see_all=true) const
Encapsulates the map of the game.
virtual const std::vector< team > & teams() const =0
int support() const
Calculate total support capacity, based on support_per_village.
bool on_board(const map_location &loc) const
Tell if a location is on the map.
int side_units_cost(int side_num) const
Returns the total cost of units of side side_num.
bool is_observer() const
Check if we are an observer in this game.
unit_iterator find(size_t id)
virtual const std::vector< std::string > & hidden_label_categories() const =0
const unit * get_visible_unit(const map_location &loc, const team ¤t_team, bool see_all=false) const
bool would_be_discovered(const map_location &loc, int side_num, bool see_all=true)
Given a location and a side number, indicates whether an invisible unit of that side at that location...
team_data calculate_team_data(const class team &tm, int side) const