72 return unit.get_shared_ptr();
85 && u.side() ==
static_cast<int>(team_index+1)
96 ERR_WB <<
"future_visible_unit cannot find unit, future unit map failed to build." << std::endl;
106 if (unit && unit->
side() == on_side)
125 for(
map_location const& loc : std::make_pair(path.begin()+1,path.end())) {
156 if (!
t.get_side_actions()->empty())
171 for(
size_t turn=0; !
end; ++turn) {
177 function(iter->get());
188 size_t result_turn = std::numeric_limits<size_t>::max();
194 if(chall == actions.
end()) {
198 size_t chall_turn = actions.
get_turn(chall);
199 if(chall_turn < result_turn) {
201 result_turn = chall_turn;
container::iterator iterator
play_controller * controller
boost::intrusive_ptr< const unit > unit_const_ptr
int total_movement() const
bool team_has_visible_plan(team &t)
Returns whether a given team's plan is visible.
const std::string & id() const
boost::shared_ptr< wb::side_actions > get_side_actions() const
get the whiteboard planned actions for this team
iterator end()
Returns the iterator for the position after the last executed action within the actions queue...
const map_location & get_location() const
void set_hidden(bool state) const
bool invalidate(const map_location &loc)
Function to invalidate a specific tile for redrawing.
void set_disabled_ghosted(bool with_bars=true)
Whiteboard related somehow.
int movement_cost(const t_translation::t_terrain &terrain) const
bool owns_village(const map_location &loc) const
iterator turn_begin(size_t turn_num)
size_t get_turn(const_iterator it) const
Returns the turn of a given iterator planned execution.
unit * find_recruiter(size_t team_index, map_location const &hex)
bool has_actions()
Return whether the whiteboard has actions.
int path_cost(std::vector< map_location > const &path, unit const &u)
Computes the MP cost for u to travel path.
temporary_unit_hider(unit &u)
void unghost_owner_unit(unit *unit)
iterator find_first_action_at(map_location hex)
Find the first action occurring at a given hex.
This class stores all the data for a single 'side' (in game nomenclature).
static std::string at(const std::string &file, int line)
GLsizei const char ** path
size_t num_turns() const
Returns the number of turns that have plans.
int current_side() const
Returns the number of the side whose turn it is.
std::vector< team > * teams
unit * get_visible_unit(const map_location &loc, const team ¤t_team, bool see_all=false)
Applies the planned unit map for the duration of the struct's life.
filter_context * filter_con
Encapsulates the map of the game.
void ghost_owner_unit(unit *unit)
unit_animation_component & anim_comp() const
void for_each_action(std::function< void(action *)> function, team_filter team_filter)
Apply a function to all the actions of the whiteboard.
Encapsulates the map of the game.
Various functions related to the creation of units (recruits, recalls, and placed units)...
std::deque< action_ptr > find_actions_of(unit const &target)
Find the actions of an unit.
side_actions_ptr viewer_actions()
iterator turn_end(size_t turn_num)
virtual const gamemap & map() const
std::function< bool(team &)> team_filter
Callable object class to filter teams.
unit_const_ptr find_backup_leader(const unit &leader)
For a given leader on a keep, find another leader on another keep in the same castle.
unit * future_visible_unit(map_location hex, int viewer_side)
Applies the future unit map and.
boost::shared_ptr< wb::manager > whiteboard
void set_standing(bool with_bars=true)
Sets the animation state to standing.
size_t viewing_team() const
The viewing team is the team currently viewing the game.
Abstract base class for all the whiteboard planned actions.
action_ptr find_action_at(map_location hex, team_filter team_filter)
Find the first action occuring on a given hex.
This internal whiteboard class holds the planned action queues for a team, and offers many utility me...
bool enemy_zoc(team const ¤t_team, map_location const &loc, team const &viewing_team, bool see_all)
Determines if a given location is in an enemy zone of control.
side_actions_ptr current_side_actions()