Classes | |
class | action |
Abstract base class for all the whiteboard planned actions. More... | |
class | attack |
class | highlighter |
Class that handles highlighting planned actions as you hover over them and determine the right target for contextual execution. More... | |
class | manager |
This class is the frontend of the whiteboard framework for the rest of the Wesnoth code. More... | |
struct | future_map |
Applies the planned unit map for the duration of the struct's life. More... | |
struct | future_map_if |
struct | future_map_if_active |
ONLY IF whiteboard is currently active, applies the planned unit map for the duration of the struct's life. More... | |
struct | real_map |
Ensures that the real unit map is active for the duration of the struct's life. More... | |
class | mapbuilder |
Class that collects and applies unit_map modifications from the actions it visits and reverts all changes on destruction. More... | |
class | move |
A planned move, represented on the map by an arrow and a ghosted unit in the destination hex. More... | |
class | recall |
class | recruit |
class | side_actions_container |
Datastructure holding the actions of a side on multiple turns. More... | |
class | side_actions |
This internal whiteboard class holds the planned action queues for a team, and offers many utility methods to create and manipulate them. More... | |
class | suppose_dead |
A planned action that temporarily removes a unit from the map for planning purposes. More... | |
struct | temporary_unit_hider |
class | variable_finalizer |
Finalizer class to help with exception safety sets variable to value on destruction. More... | |
class | visitor |
Abstract base class for all the visitors (cf GoF Visitor Design Pattern) the whiteboard uses. More... | |
Typedefs | |
typedef std::shared_ptr< bool > | whiteboard_lock |
typedef std::shared_ptr< arrow > | arrow_ptr |
typedef std::shared_ptr< action > | action_ptr |
typedef std::shared_ptr< action const > | action_const_ptr |
typedef std::weak_ptr< action > | weak_action_ptr |
typedef std::deque< action_ptr > | action_queue |
typedef std::shared_ptr< side_actions > | side_actions_ptr |
typedef std::shared_ptr< move > | move_ptr |
typedef std::shared_ptr< move const > | move_const_ptr |
typedef std::shared_ptr< attack > | attack_ptr |
typedef std::shared_ptr< attack const > | attack_const_ptr |
typedef std::shared_ptr< recruit > | recruit_ptr |
typedef std::shared_ptr< recruit const > | recruit_const_ptr |
typedef std::shared_ptr< recall > | recall_ptr |
typedef std::shared_ptr< recall const > | recall_const_ptr |
typedef std::shared_ptr< suppose_dead > | suppose_dead_ptr |
typedef std::shared_ptr< suppose_dead const > | suppose_dead_const_ptr |
typedef std::function< bool(team &)> | team_filter |
Callable object class to filter teams. More... | |
Functions | |
std::ostream & | operator<< (std::ostream &s, action_ptr action) |
std::ostream & | operator<< (std::ostream &s, action_const_ptr action) |
std::ostream & | operator<< (std::ostream &s, attack_ptr attack) |
Dumps an attack on a stream, for debug purposes. More... | |
std::ostream & | operator<< (std::ostream &s, attack_const_ptr attack) |
static void | hide_all_plans () |
static void | draw_numbers (const map_location &hex, side_actions::numbers_t numbers) |
std::ostream & | operator<< (std::ostream &s, move_ptr move) |
Dumps an move on a stream, for debug purposes. More... | |
std::ostream & | operator<< (std::ostream &s, move_const_ptr move) |
std::ostream & | operator<< (std::ostream &s, recall_ptr recall) |
std::ostream & | operator<< (std::ostream &s, recall_const_ptr recall) |
std::ostream & | operator<< (std::ostream &s, recruit_ptr recruit) |
std::ostream & | operator<< (std::ostream &s, recruit_const_ptr recruit) |
std::ostream & | operator<< (std::ostream &out, const wb::side_actions &side_actions) |
Dumps side_actions on a stream, for debug purposes. More... | |
std::ostream & | operator<< (std::ostream &s, suppose_dead_ptr sup_d) |
Dumps a suppose_dead on a stream, for debug purposes. More... | |
std::ostream & | operator<< (std::ostream &s, suppose_dead_const_ptr sup_d) |
int | viewer_side () |
side_actions_ptr | viewer_actions () |
side_actions_ptr | current_side_actions () |
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. More... | |
unit * | find_recruiter (std::size_t team_index, const map_location &hex) |
bool | any_recruiter (int side_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. More... | |
unit * | future_visible_unit (map_location hex, int viewer_side=wb::viewer_side()) |
Applies the future unit map and. More... | |
unit * | future_visible_unit (int on_side, map_location hex, int viewer_side=wb::viewer_side()) |
Applies the future unit map and. More... | |
int | path_cost (const std::vector< map_location > &path, const unit &u) |
Computes the MP cost for u to travel path. More... | |
void | ghost_owner_unit (unit *unit) |
void | unghost_owner_unit (unit *unit) |
bool | has_actions () |
Return whether the whiteboard has actions. More... | |
bool | team_has_visible_plan (team &) |
Returns whether a given team's plan is visible. More... | |
void | for_each_action (std::function< void(action *)> function, team_filter team_filter=team_has_visible_plan) |
Apply a function to all the actions of the whiteboard. More... | |
action_ptr | find_action_at (map_location hex, team_filter team_filter=team_has_visible_plan) |
Find the first action occurring on a given hex. More... | |
std::deque< action_ptr > | find_actions_of (const unit &target) |
Find the actions of an unit. More... | |
typedef std::shared_ptr<action const> wb::action_const_ptr |
Definition at line 63 of file typedefs.hpp.
typedef std::shared_ptr<action> wb::action_ptr |
Definition at line 62 of file typedefs.hpp.
typedef std::deque<action_ptr> wb::action_queue |
Definition at line 65 of file typedefs.hpp.
typedef std::shared_ptr<arrow> wb::arrow_ptr |
Definition at line 60 of file typedefs.hpp.
typedef std::shared_ptr<attack const> wb::attack_const_ptr |
Definition at line 71 of file typedefs.hpp.
typedef std::shared_ptr<attack> wb::attack_ptr |
Definition at line 70 of file typedefs.hpp.
typedef std::shared_ptr<move const> wb::move_const_ptr |
Definition at line 69 of file typedefs.hpp.
typedef std::shared_ptr<move> wb::move_ptr |
Definition at line 68 of file typedefs.hpp.
typedef std::shared_ptr<recall const> wb::recall_const_ptr |
Definition at line 75 of file typedefs.hpp.
typedef std::shared_ptr<recall> wb::recall_ptr |
Definition at line 74 of file typedefs.hpp.
typedef std::shared_ptr<recruit const> wb::recruit_const_ptr |
Definition at line 73 of file typedefs.hpp.
typedef std::shared_ptr<recruit> wb::recruit_ptr |
Definition at line 72 of file typedefs.hpp.
typedef std::shared_ptr<side_actions> wb::side_actions_ptr |
Definition at line 66 of file typedefs.hpp.
typedef std::shared_ptr<suppose_dead const> wb::suppose_dead_const_ptr |
Definition at line 77 of file typedefs.hpp.
typedef std::shared_ptr<suppose_dead> wb::suppose_dead_ptr |
Definition at line 76 of file typedefs.hpp.
typedef std::function<bool(team&)> wb::team_filter |
Callable object class to filter teams.
The argument is the team to consider.
Definition at line 123 of file utility.hpp.
typedef std::weak_ptr<action> wb::weak_action_ptr |
Definition at line 64 of file typedefs.hpp.
typedef std::shared_ptr<bool> wb::whiteboard_lock |
Definition at line 58 of file typedefs.hpp.
bool wb::any_recruiter | ( | int | side_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.
func takes the leader unit and can return true to 'break' the loop
Definition at line 83 of file utility.cpp.
References game_state::can_recruit_on(), resources::filter_con, and resources::gameboard.
Referenced by wb::recall::check_validity(), and wb::recruit::check_validity().
side_actions_ptr wb::current_side_actions | ( | ) |
Definition at line 48 of file utility.cpp.
References resources::controller, resources::gameboard, team::get_side_actions(), and game_board::get_team().
Referenced by wb::manager::current_side_has_actions().
|
static |
Definition at line 459 of file manager.cpp.
References actions_numbering, display::draw_text_in_hex(), team::get_side_color(), display::get_singleton(), i, wb::side_actions::numbers_t::main_number, wb::side_actions::numbers_t::numbers_to_draw, wb::side_actions::numbers_t::secondary_numbers, utf8::size(), and wb::side_actions::numbers_t::team_numbers.
Referenced by wb::manager::draw_hex().
action_ptr wb::find_action_at | ( | map_location | hex, |
team_filter | team_filter = team_has_visible_plan |
||
) |
Find the first action occurring on a given hex.
The actions are processed chronologically. The second parameter is a team_filter, it is called for each team, if it returns false, the actions of this team won't be considered.
hex | where to search for an action. |
team_filter | select whether a team is visited (default to team_has_visible_plan). |
action_ptr() | when no action verifying the team_filter are present on the given hex. |
Definition at line 193 of file utility.cpp.
References resources::gameboard.
Referenced by wb::highlighter::find_main_highlight().
std::deque< action_ptr > wb::find_actions_of | ( | const unit & | target | ) |
Find the actions of an unit.
target | the unit owning the actions. |
Definition at line 217 of file utility.cpp.
References resources::gameboard, team::get_side_actions(), game_board::get_team(), and unit::side().
Referenced by wb::highlighter::find_secondary_highlights().
unit_const_ptr wb::find_backup_leader | ( | const unit & | leader | ) |
For a given leader on a keep, find another leader on another keep in the same castle.
nullptr | if no such leader has been found |
Definition at line 55 of file utility.cpp.
References unit::can_recruit(), resources::filter_con, resources::gameboard, unit::get_location(), unit::id(), and game_board::units().
Referenced by wb::manager::allow_leader_to_move().
unit * wb::find_recruiter | ( | std::size_t | team_index, |
const map_location & | |||
) |
nullptr | if no such leader has been found |
Definition at line 70 of file utility.cpp.
References game_state::can_recruit_on(), resources::filter_con, and resources::gameboard.
Referenced by wb::recruit::check_validity(), and wb::manager::save_recruit().
void wb::for_each_action | ( | std::function< void(action *)> | function, |
team_filter | team_filter = team_has_visible_plan |
||
) |
Apply a function to all the actions of the whiteboard.
The actions are processed chronologically. The second parameter is a team_filter, it is called for each team, if it returns false, the actions of this team won't be processed.
function | the function to execute. |
team_filter | select whether a team is visited (default to team_has_visible_plan). |
Definition at line 176 of file utility.cpp.
References resources::gameboard.
Referenced by wb::manager::draw_hex(), and wb::manager::pre_draw().
unit * wb::future_visible_unit | ( | int | on_side, |
map_location | hex, | ||
int | viewer_side = wb::viewer_side() |
||
) |
Applies the future unit map and.
nullptr | if none is visible to the specified viewer side |
on_side | Only search for units of this side. |
hex | |
viewer_side |
Definition at line 111 of file utility.cpp.
References future_visible_unit(), unit::side(), and viewer_side().
unit * wb::future_visible_unit | ( | map_location | hex, |
int | viewer_side = wb::viewer_side() |
||
) |
Applies the future unit map and.
nullptr | if none is visible to the specified viewer side |
Definition at line 99 of file utility.cpp.
References ERR_WB, resources::gameboard, game_board::get_visible_unit(), viewer_side(), and resources::whiteboard.
Referenced by wb::manager::contextual_delete(), wb::manager::contextual_execute(), wb::manager::create_temp_move(), future_visible_unit(), wb::manager::save_temp_attack(), and wb::manager::save_temp_move().
void wb::ghost_owner_unit | ( | unit * | unit | ) |
Definition at line 149 of file utility.cpp.
References unit::anim_comp(), unit::get_location(), display::get_singleton(), display::invalidate(), and unit_animation_component::set_disabled_ghosted().
Referenced by wb::manager::pre_draw().
bool wb::has_actions | ( | ) |
Return whether the whiteboard has actions.
Definition at line 161 of file utility.cpp.
References resources::gameboard, and t.
Referenced by wb::mapbuilder::build_map(), and wb::manager::has_actions().
|
static |
Definition at line 360 of file manager.cpp.
References resources::gameboard, and t.
Referenced by wb::manager::on_change_controller(), and wb::manager::update_plan_hiding().
std::ostream & wb::operator<< | ( | std::ostream & | out, |
const wb::side_actions & | side_actions | ||
) |
Dumps side_actions on a stream, for debug purposes.
Definition at line 48 of file side_actions.cpp.
References wb::side_actions::empty(), wb::side_actions::num_turns(), wb::side_actions::turn_begin(), wb::side_actions::turn_end(), and wb::side_actions::turn_size().
std::ostream & wb::operator<< | ( | std::ostream & | s, |
action_const_ptr | action | ||
) |
Definition at line 40 of file action.cpp.
References wb::action::print(), and s.
std::ostream & wb::operator<< | ( | std::ostream & | s, |
action_ptr | action | ||
) |
Definition at line 34 of file action.cpp.
References wb::action::print(), and s.
std::ostream & wb::operator<< | ( | std::ostream & | s, |
attack_const_ptr | attack | ||
) |
Definition at line 42 of file attack.cpp.
References wb::attack::print(), and s.
std::ostream & wb::operator<< | ( | std::ostream & | s, |
attack_ptr | attack | ||
) |
Dumps an attack on a stream, for debug purposes.
Definition at line 36 of file attack.cpp.
References wb::attack::print(), and s.
std::ostream & wb::operator<< | ( | std::ostream & | s, |
move_const_ptr | move | ||
) |
Definition at line 50 of file move.cpp.
References wb::move::print(), and s.
std::ostream & wb::operator<< | ( | std::ostream & | s, |
move_ptr | move | ||
) |
Dumps an move on a stream, for debug purposes.
Definition at line 44 of file move.cpp.
References wb::move::print(), and s.
std::ostream & wb::operator<< | ( | std::ostream & | s, |
recall_const_ptr | recall | ||
) |
Definition at line 46 of file recall.cpp.
References wb::recall::print(), and s.
std::ostream & wb::operator<< | ( | std::ostream & | s, |
recall_ptr | recall | ||
) |
Definition at line 41 of file recall.cpp.
References wb::recall::print(), and s.
std::ostream & wb::operator<< | ( | std::ostream & | s, |
recruit_const_ptr | recruit | ||
) |
Definition at line 43 of file recruit.cpp.
References wb::recruit::print(), and s.
std::ostream & wb::operator<< | ( | std::ostream & | s, |
recruit_ptr | recruit | ||
) |
Definition at line 38 of file recruit.cpp.
References wb::recruit::print(), and s.
std::ostream & wb::operator<< | ( | std::ostream & | s, |
suppose_dead_const_ptr | sup_d | ||
) |
Definition at line 41 of file suppose_dead.cpp.
References s.
std::ostream & wb::operator<< | ( | std::ostream & | s, |
suppose_dead_ptr | sup_d | ||
) |
Dumps a suppose_dead on a stream, for debug purposes.
Definition at line 35 of file suppose_dead.cpp.
References s.
int wb::path_cost | ( | const std::vector< map_location > & | path, |
const unit & | u | ||
) |
Computes the MP cost for u to travel path.
Definition at line 120 of file utility.cpp.
References pathfind::enemy_zoc(), resources::gameboard, game_board::get_team(), game_board::map(), unit::movement_cost(), team::owns_village(), game_config::path, unit::side(), and unit::total_movement().
bool wb::team_has_visible_plan | ( | team & | t | ) |
Returns whether a given team's plan is visible.
Definition at line 171 of file utility.cpp.
References t.
Referenced by wb::mapbuilder::build_map().
void wb::unghost_owner_unit | ( | unit * | unit | ) |
Definition at line 155 of file utility.cpp.
References unit::anim_comp(), unit::get_location(), display::get_singleton(), display::invalidate(), and unit_animation_component::set_standing().
Referenced by wb::manager::post_draw().
side_actions_ptr wb::viewer_actions | ( | ) |
Definition at line 42 of file utility.cpp.
References team::get_side_actions(), display::get_singleton(), and display::viewing_team().
Referenced by wb::manager::allow_leader_to_move(), wb::manager::can_enable_execution_hotkeys(), wb::manager::can_enable_modifier_hotkeys(), wb::manager::contextual_bump_down_action(), wb::manager::contextual_bump_up_action(), wb::manager::contextual_delete(), wb::manager::contextual_execute(), wb::recruit::execute(), wb::manager::execute_all_actions(), wb::manager::on_finish_side_turn(), wb::manager::on_mouseover_change(), wb::manager::save_recall(), wb::manager::save_recruit(), wb::manager::save_suppose_dead(), wb::manager::save_temp_attack(), wb::manager::save_temp_move(), wb::manager::set_active(), and wb::manager::unit_has_actions().
int wb::viewer_side | ( | ) |
Definition at line 37 of file utility.cpp.
References display::get_singleton(), team::side(), and display::viewing_team().
Referenced by wb::manager::can_enable_execution_hotkeys(), wb::manager::contextual_delete(), wb::manager::contextual_execute(), wb::manager::create_temp_move(), future_visible_unit(), wb::manager::on_change_controller(), wb::manager::on_finish_side_turn(), and wb::manager::options_dlg().