64 return unit.get_shared_ptr();
77 && u.side() ==
static_cast<int>(team_index+1)
104 ERR_WB <<
"future_visible_unit cannot find unit, future unit map failed to build.";
164 if (!
t.get_side_actions()->empty())
173 return !
t.get_side_actions()->hidden();
179 for(std::size_t turn=0; !end; ++turn) {
184 for(
auto iter =
actions.turn_begin(turn); iter !=
actions.turn_end(turn); ++iter) {
185 function(iter->get());
196 std::size_t result_turn = std::numeric_limits<std::size_t>::max();
206 std::size_t chall_turn =
actions.get_turn(chall);
207 if(chall_turn < result_turn) {
209 result_turn = chall_turn;
const team & viewing_team() const
bool invalidate(const map_location &loc)
Function to invalidate a specific tile for redrawing.
static display * get_singleton()
Returns the display object if a display object exists.
unit * get_visible_unit(const map_location &loc, const team ¤t_team, bool see_all=false)
virtual const unit_map & units() const override
virtual const gamemap & map() const override
bool can_recruit_on(const map_location &leader_loc, const map_location &recruit_loc, int side) const
Checks to see if a leader at leader_loc could recruit on recruit_loc.
Encapsulates the map of the game.
This class stores all the data for a single 'side' (in game nomenclature).
bool owns_village(const map_location &loc) const
std::shared_ptr< wb::side_actions > get_side_actions() const
get the whiteboard planned actions for this team
void set_standing(bool with_bars=true)
Sets the animation state to standing.
void set_disabled_ghosted(bool with_bars=true)
Whiteboard related somehow.
This class represents a single unit of a specific type.
Abstract base class for all the whiteboard planned actions.
This internal whiteboard class holds the planned action queues for a team, and offers many utility me...
container::iterator iterator
map_display and display: classes which take care of displaying the map and game-data on the screen.
void set_hidden(bool state) const
Sets whether the unit is hidden on the map.
bool can_recruit() const
Whether this unit can recruit other units - ie, are they a leader unit.
const std::string & id() const
Gets this unit's id.
int side() const
The side this unit belongs to.
unit_animation_component & anim_comp() const
const map_location & get_location() const
The current map location this unit is at.
int movement_cost(const t_translation::terrain_code &terrain) const
Get the unit's movement cost on a particular terrain.
int total_movement() const
The maximum moves this unit has.
bool enemy_zoc(const team ¤t_team, const map_location &loc, const team &viewing_team, bool see_all)
Determines if a given location is in an enemy zone of control.
play_controller * controller
filter_context * filter_con
std::shared_ptr< wb::manager > whiteboard
side_actions_ptr current_side_actions()
void for_each_action(std::function< void(action *)> function, team_filter team_filter)
Apply a function to all the actions of the whiteboard.
void ghost_owner_unit(unit *unit)
bool team_has_visible_plan(team &t)
Returns whether a given team's plan is visible.
unit * find_recruiter(std::size_t team_index, const map_location &hex)
std::shared_ptr< action > action_ptr
action_ptr find_action_at(map_location hex, team_filter team_filter)
Find the first action occurring on a given hex.
bool any_recruiter(int team_num, const map_location &loc, std::function< bool(unit &)> func)
executes func for each unti of side of side_num that can recruit on loc.
unit * future_visible_unit(map_location hex, int viewer_side)
Applies the future unit map and.
std::shared_ptr< side_actions > side_actions_ptr
int path_cost(const std::vector< map_location > &path, const unit &u)
Computes the MP cost for u to travel path.
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.
std::function< bool(team &)> team_filter
Callable object class to filter teams.
std::deque< action_ptr > find_actions_of(const unit &target)
Find the actions of an unit.
side_actions_ptr viewer_actions()
bool has_actions()
Return whether the whiteboard has actions.
void unghost_owner_unit(unit *unit)
std::shared_ptr< const unit > unit_const_ptr
Encapsulates the map of the game.
Applies the planned unit map for the duration of the struct's life.
temporary_unit_hider(unit &u)