14 #ifndef TEAM_H_INCLUDED
15 #define TEAM_H_INCLUDED
26 #include <boost/shared_ptr.hpp>
27 #include <boost/container/flat_set.hpp>
31 #if defined(_MSC_VER) && _MSC_VER <= 1600
36 #include <SDL_video.h>
67 (NO_LEADER, "no_leader_left")
68 (NO_UNITS, "no_units_left")
84 void place(
int x,
int y);
89 bool shared_value(
const std::vector<const shroud_map*>& maps,
int x,
int y)
const;
91 bool copy_from(
const std::vector<const shroud_map*>& maps);
101 std::vector<std::vector<bool> >
data_;
180 static const boost::container::flat_set<std::string>
attributes;
248 const size_t index = size_t(n-1);
404 const std::vector<const shroud_map*>&
ally_shroud(
const std::vector<team>&
teams)
const;
405 const std::vector<const shroud_map*>&
ally_fog(
const std::vector<team>&
teams)
const;
const t_string & faction_name() const
void change_controller(CONTROLLER controller)
static const int default_team_gold_
const std::string & flag() const
void set_share_vision(SHARE_VISION vision_status)
std::vector< bool > enemies_
boost::shared_ptr< wb::side_actions > get_side_actions() const
get the whiteboard planned actions for this team
void set_shroud(bool shroud)
bool no_turn_confirmation
std::string last_recruit_
const std::string & current_player() const
void write(config &cfg) const
DEFEAT_CONDITION defeat_condition
static std::string get_side_highlight(int side)
GLenum GLsizei const GLuint GLboolean enabled
const std::string & color() const
void set_start_gold(const int amount)
SHARE_VISION share_vision
void set_carryover_add(bool value)
void handle_legacy_share_vision(const config &cfg)
void set_objectives(const t_string &new_objectives, bool silently=false)
bool shrouded(const map_location &loc) const
const std::set< std::string > & recruits() const
bool clear_fog(const map_location &loc)
bool owns_village(const map_location &loc) const
bool get_disallow_observers() const
void handle_legacy_share_vision(const config &cfg)
static const color_range get_side_color_range(int side)
double carryover_bonus() const
bool is_enemy(int n) const
const t_string & objectives() const
void clear(const std::string &key)
PROXY_CONTROLLER proxy_controller() const
void set_recall_cost(int cost)
bool objectives_changed() const
MAKE_ENUM(CONTROLLER,(HUMAN,"human")(AI,"ai")(EMPTY,"null")) MAKE_ENUM(PROXY_CONTROLLER
void set_save_id(const std::string &save_id)
void build(const config &cfg, const gamemap &map, int gold=default_team_gold_)
int minimum_recruit_price
void set_countdown_time(const int amount) const
DEFEAT_CONDITION defeat_condition() const
boost::shared_ptr< wb::side_actions > planned_actions_
Whiteboard planned actions for this team.
GLint GLint GLint GLint GLint GLint y
void set_persistent(bool value)
void set_defeat_condition_string(const std::string &value)
sets the defeat condition if
bool objectives_changed
< Team's objectives for the current level.
void add_recruit(const std::string &)
void change_controller(const std::string &new_controller)
bool is_proxy_human() const
void set_share_vision(const std::string &vision_status)
void set_hidden(bool value)
void set_current_player(const std::string &player)
int carryover_gold() const
Definitions for the interface to Wesnoth Markup Language (WML).
void set_carryover_percentage(int value)
const std::string & last_recruit() const
void set_scroll_to_leader(bool value)
SHARE_VISION share_vision() const
static std::string get_side_highlight_pango(int side)
static const boost::container::flat_set< std::string > attributes
Stores the attributes recognized by [side].
void set_no_turn_confirmation(bool value)
void set_flag(const std::string &flag)
static std::vector< team > *& teams
This class stores all the data for a single 'side' (in game nomenclature).
bool calculate_enemies(size_t index) const
bool fog_or_shroud() const
void set_carryover_bonus(double value)
void have_leader(bool value=true)
const std::string & flag_icon() const
PROXY_CONTROLLER proxy_controller
bool auto_shroud_updates() const
void read(const config &cfg)
int village_support() const
void set_defeat_condition(DEFEAT_CONDITION value)
const t_string & user_team_name() const
int carryover_percentage() const
GLsizei const GLfloat * value
void set_local(bool local)
void set_lost(bool value=true)
void write(config &cfg) const
Encapsulates the map of the game.
const std::string & team_name() const
void validate_side(int side)
void set_village_support(int support)
bool is_local_human() const
void log_recruitable() const
void merge(const std::string &shroud_data)
void spend_gold(const int amount)
const config & variables() const
void reset_objectives_changed() const
const std::set< map_location > & villages() const
bool auto_shroud_updates_
Templates and utility-routines for strings and numbers.
void remove_fog_override(const std::set< map_location > &hexes)
Removes the record of hexes that were cleared of fog via WML.
std::vector< const shroud_map * > ally_fog_
void place_shroud(const map_location &loc)
GLuint GLuint GLsizei count
const recall_list_manager & recall_list() const
const std::string & save_id() const
const std::string ¶meters float amount
Encapsulates the map of the game.
void set_village_gold(int income)
void set_carryover_gold(int value)
bool calculate_is_enemy(size_t index) const
static void clear_caches()
clear the shroud, fog, and enemies cache for all teams
bool get_scroll_to_leader() const
std::string current_player
const std::vector< const shroud_map * > & ally_shroud(const std::vector< team > &teams) const
void set_gold(int amount)
bool clear_shroud(const map_location &loc)
const std::vector< const shroud_map * > & ally_fog(const std::vector< team > &teams) const
const std::string & faction() const
void change_proxy(PROXY_CONTROLLER proxy)
void set_enabled(bool enabled)
std::set< map_location > villages_
idle all(SHROUD,"shroud")(NONE
static SDL_Color get_minimap_color(int side)
static Uint32 get_side_rgb_min(int side)
A color range definition is made of four reference RGB colors, used for calculating conversions from ...
static SDL_Color get_side_color(int side)
GLint GLint GLint GLint GLint x
bool fogged(const map_location &loc) const
void set_flag_icon(const std::string &flag_icon)
void read(config &cfg, std::istream &in, abstract_validator *validator)
void set_objectives_changed(bool c=true) const
int support() const
Calculate total support capacity, based on support_per_village.
bool no_turn_confirmation() const
bool fire_event(const tevent event, std::vector< std::pair< twidget *, tevent > > &event_chain, twidget *dispatcher, twidget *widget, F functor)
Helper function for fire_event.
std::vector< const shroud_map * > ally_shroud_
recall_list_manager recall_list_
void change_controller_by_wml(const std::string &new_controller)
GLuint const GLchar * name
CONTROLLER controller() const
static Uint32 get_side_rgb_max(int side)
bool knows_about_team(size_t index) const
int countdown_time() const
std::set< map_location > fog_clearer_
Stores hexes that have been cleared of fog via WML.
const std::string & side_name() const
void lose_village(const map_location &)
void merge_shroud_map_data(const std::string &shroud_data)
Merge a WML shroud map with the shroud data of this player.
void set_action_bonus_count(const int count)
std::vector< std::vector< bool > > data_
bool is_network_ai() const
recall_list_manager & recall_list()
void add_fog_override(const std::set< map_location > &hexes)
Records hexes that were cleared of fog via WML.
static std::string get_side_color_index(int side)
void change_team(const std::string &name, const t_string &user_name)
std::set< std::string > can_recruit
void set_auto_shroud_updates(bool value)
bool carryover_add() const
void set_base_income(int amount)
static Uint32 get_side_rgb(int side)
void set_recruits(const std::set< std::string > &recruits)
const std::string & str() const
std::string allied_human_teams() const
A config object defines a single node in a WML file, with access to child nodes.
bool is_network_human() const
int action_bonus_count() const
Defines the MAKE_ENUM macro.
GLsizei const GLcharARB ** string
void last_recruit(const std::string &u_type)
std::string countdown_time
bool get_village(const map_location &, const int owner_side, game_data *fire_event)
Acquires a village from owner_side. Pointer fire_event should be the game_data for the game if it is ...
int minimum_recruit_price() const
void set_color(const std::string &color)