51 std::unique_ptr<gamemap>
map_;
80 virtual const std::vector<team>&
teams()
const override
146 void check_victory(
bool &,
bool &,
bool &,
bool &, std::set<unsigned> &,
bool);
151 void side_change_controller (
int side_num,
bool is_local,
const std::string& pname,
const std::string& controller_type);
A config object defines a single node in a WML file, with access to child nodes.
Abstract class for exposing game data that doesn't depend on the GUI, however which for historical re...
const team & get_team(int side) const
This getter takes a 1-based side number, not a 0-based team number.
void check_victory(bool &, bool &, bool &, bool &, std::set< unsigned > &, bool)
bool has_visible_unit(const map_location &loc, const team &team, bool see_all=false) const
virtual const std::vector< team > & teams() const override
game_board & operator=(const game_board &other)=delete
friend void swap(game_board &one, game_board &other)
bool has_visible_unit(const map_location &loc, std::size_t team, bool see_all=false) const
virtual const std::vector< std::string > & hidden_label_categories() const override
virtual std::vector< std::string > & hidden_label_categories() override
std::vector< team > teams_
void side_drop_to(int side_num, side_controller::type ctrl, side_proxy_controller::type proxy=side_proxy_controller::type::human)
std::vector< std::string > labels_
std::unique_ptr< gamemap > map_
bool change_terrain(const map_location &loc, const std::string &t, const std::string &mode, bool replace_if_failed)
utils::optional< std::string > replace_map(const gamemap &r)
game_board(const config &level)
void heal_all_survivors()
bool try_add_unit_to_recall_list(const map_location &loc, const unit_ptr u)
n_unit::id_manager unit_id_manager_
unit_map::iterator find_visible_unit(const map_location &loc, const team ¤t_team, bool see_all=false)
bool team_is_defeated(const team &t) const
Calculates whether a team is defeated.
std::vector< team > & teams()
void side_change_controller(int side_num, bool is_local, const std::string &pname, const std::string &controller_type)
unit * get_visible_unit(const map_location &loc, const team ¤t_team, bool see_all=false)
n_unit::id_manager & unit_id_manager()
void set_all_units_user_end_turn()
unit_map::iterator find_unit(const map_location &loc)
void write_config(config &cfg) const
unit_map::iterator find_visible_unit(const map_location &loc, std::size_t team, bool see_all=false)
virtual const unit_map & units() const override
virtual const gamemap & map() const override
Encapsulates the map of the game.
This class stores all the data for a single 'side' (in game nomenclature).
Container associating units to locations.
unit_iterator find(std::size_t id)
This class represents a single unit of a specific type.
void swap(game_board &one, game_board &other)
std::shared_ptr< unit > unit_ptr
rect dst
Location on the final composed sheet.
rect src
Non-transparent portion of the surface to compose.
Encapsulates the map of the game.
A terrain string which is converted to a terrain is a string with 1 or 2 layers the layers are separa...
This object is used to temporary move a unit in the unit map, swapping out any unit that is already t...
virtual ~temporary_unit_mover()
temporary_unit_mover(unit_map &m, const map_location &src, const map_location &dst, int new_moves, bool stand)
Constructor This version will change the unit's current movement to new_moves while the unit is moved...
This object is used to temporary place a unit in the unit map, swapping out any unit that is already ...
virtual ~temporary_unit_placer()
temporary_unit_placer(unit_map &m, const map_location &loc, unit &u)
This object is used to temporary remove a unit from the unit map.
temporary_unit_remover(unit_map &m, const map_location &loc)
virtual ~temporary_unit_remover()