Classes | |
class | action |
Abstract base class for all the whiteboard planned actions. More... | |
class | attack |
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... | |
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... | |
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... | |
struct | real_map |
Ensures that the real unit map is active for the duration of the struct's life. More... | |
class | recall |
class | recruit |
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 | side_actions_container |
Datastructure holding the actions of a side on multiple turns. 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... | |
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 (map_location const &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, wb::side_actions const &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) |
size_t | viewer_team () |
int | viewer_side () |
side_actions_ptr | viewer_actions () |
side_actions_ptr | current_side_actions () |
unit_const_ptr | find_backup_leader (unit const &leader) |
For a given leader on a keep, find another leader on another keep in the same castle. More... | |
unit * | find_recruiter (size_t team_index, map_location const &) |
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 (std::vector< map_location > const &path, unit const &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 occuring on a given hex. More... | |
std::deque< action_ptr > | find_actions_of (unit const &target) |
Find the actions of an unit. More... | |
typedef boost::shared_ptr<action const> wb::action_const_ptr |
Definition at line 71 of file typedefs.hpp.
typedef boost::shared_ptr<action> wb::action_ptr |
Definition at line 70 of file typedefs.hpp.
typedef std::deque<action_ptr> wb::action_queue |
Definition at line 73 of file typedefs.hpp.
typedef boost::shared_ptr<arrow> wb::arrow_ptr |
Definition at line 68 of file typedefs.hpp.
typedef boost::shared_ptr<attack const> wb::attack_const_ptr |
Definition at line 79 of file typedefs.hpp.
typedef boost::shared_ptr<attack> wb::attack_ptr |
Definition at line 78 of file typedefs.hpp.
typedef boost::shared_ptr<move const> wb::move_const_ptr |
Definition at line 77 of file typedefs.hpp.
typedef boost::shared_ptr<move> wb::move_ptr |
Definition at line 76 of file typedefs.hpp.
typedef boost::shared_ptr<recall const> wb::recall_const_ptr |
Definition at line 83 of file typedefs.hpp.
typedef boost::shared_ptr<recall> wb::recall_ptr |
Definition at line 82 of file typedefs.hpp.
typedef boost::shared_ptr<recruit const> wb::recruit_const_ptr |
Definition at line 81 of file typedefs.hpp.
typedef boost::shared_ptr<recruit> wb::recruit_ptr |
Definition at line 80 of file typedefs.hpp.
Definition at line 74 of file typedefs.hpp.
typedef boost::shared_ptr<suppose_dead const> wb::suppose_dead_const_ptr |
Definition at line 85 of file typedefs.hpp.
Definition at line 84 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 115 of file utility.hpp.
typedef boost::weak_ptr<action> wb::weak_action_ptr |
Definition at line 72 of file typedefs.hpp.
typedef boost::shared_ptr<bool> wb::whiteboard_lock |
Definition at line 64 of file typedefs.hpp.
side_actions_ptr wb::current_side_actions | ( | ) |
Definition at line 56 of file utility.cpp.
References resources::controller, and play_controller::current_side().
Referenced by wb::manager::current_side_has_actions().
|
static |
Definition at line 433 of file manager.cpp.
References display::draw_text_in_hex(), gui::font_size, team::get_side_color(), i, display::LAYER_ACTIONS_NUMBERING, wb::side_actions::numbers_t::main_number, schema_validation::number, wb::side_actions::numbers_t::numbers_to_draw, resources::screen, wb::side_actions::numbers_t::secondary_numbers, 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 occuring 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 185 of file utility.cpp.
References wb::side_actions::end(), wb::side_actions::find_first_action_at(), wb::side_actions::get_turn(), and resources::teams.
Referenced by wb::highlighter::find_main_highlight().
std::deque< action_ptr > wb::find_actions_of | ( | unit const & | target | ) |
Find the actions of an unit.
target | the unit owning the actions. |
Definition at line 209 of file utility.cpp.
References unit::side(), and resources::teams.
Referenced by wb::highlighter::find_secondary_highlights().
unit_const_ptr wb::find_backup_leader | ( | unit const & | 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 63 of file utility.cpp.
References unit::can_recruit(), unit_map::end(), resources::filter_con, resources::gameboard, unit::get_location(), unit::id(), and resources::units.
Referenced by wb::manager::allow_leader_to_move().
unit * wb::find_recruiter | ( | size_t | team_index, |
map_location const & | |||
) |
nullptr | if no such leader has been found |
Definition at line 78 of file utility.cpp.
References resources::filter_con, resources::gameboard, and resources::units.
Referenced by wb::recall::check_validity(), 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 168 of file utility.cpp.
References wb::side_actions::num_turns(), resources::teams, wb::side_actions::turn_begin(), and wb::side_actions::turn_end().
Referenced by wb::manager::draw_hex(), and wb::manager::pre_draw().
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 91 of file utility.cpp.
References schema_validation::at(), ERR_WB, resources::gameboard, game_board::get_visible_unit(), resources::teams, 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().
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. |
Definition at line 103 of file utility.cpp.
References future_visible_unit(), and unit::side().
Definition at line 141 of file utility.cpp.
References unit::anim_comp(), unit::get_location(), display::invalidate(), resources::screen, 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 153 of file utility.cpp.
References resources::teams.
Referenced by wb::mapbuilder::build_map(), and wb::manager::has_actions().
|
static |
Definition at line 344 of file manager.cpp.
References resources::teams.
Referenced by wb::manager::on_change_controller(), and wb::manager::update_plan_hiding().
std::ostream & wb::operator<< | ( | std::ostream & | s, |
action_ptr | action | ||
) |
Definition at line 33 of file action.cpp.
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.
std::ostream & wb::operator<< | ( | std::ostream & | s, |
action_const_ptr | action | ||
) |
Definition at line 39 of file action.cpp.
std::ostream & wb::operator<< | ( | std::ostream & | s, |
recruit_ptr | recruit | ||
) |
Definition at line 39 of file recruit.cpp.
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 41 of file suppose_dead.cpp.
std::ostream & wb::operator<< | ( | std::ostream & | s, |
attack_const_ptr | attack | ||
) |
Definition at line 42 of file attack.cpp.
std::ostream & wb::operator<< | ( | std::ostream & | s, |
recall_ptr | recall | ||
) |
Definition at line 42 of file recall.cpp.
std::ostream & wb::operator<< | ( | std::ostream & | s, |
recruit_const_ptr | recruit | ||
) |
Definition at line 44 of file recruit.cpp.
std::ostream & wb::operator<< | ( | std::ostream & | s, |
move_ptr | move | ||
) |
std::ostream & wb::operator<< | ( | std::ostream & | s, |
recall_const_ptr | recall | ||
) |
Definition at line 47 of file recall.cpp.
std::ostream & wb::operator<< | ( | std::ostream & | s, |
suppose_dead_const_ptr | sup_d | ||
) |
Definition at line 47 of file suppose_dead.cpp.
std::ostream & wb::operator<< | ( | std::ostream & | out, |
wb::side_actions const & | side_actions | ||
) |
Dumps side_actions on a stream, for debug purposes.
Definition at line 49 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, |
move_const_ptr | move | ||
) |
int wb::path_cost | ( | std::vector< map_location > const & | path, |
unit const & | u | ||
) |
Computes the MP cost for u to travel path.
Definition at line 112 of file utility.cpp.
References pathfind::enemy_zoc(), resources::gameboard, game_board::map(), unit::movement_cost(), team::owns_village(), unit::side(), resources::teams, and unit::total_movement().
Referenced by wb::manager::save_temp_move().
bool wb::team_has_visible_plan | ( | team & | ) |
Returns whether a given team's plan is visible.
Definition at line 163 of file utility.cpp.
References team::get_side_actions().
Referenced by wb::mapbuilder::build_map().
Definition at line 147 of file utility.cpp.
References unit::anim_comp(), unit::get_location(), display::invalidate(), resources::screen, and unit_animation_component::set_standing().
Referenced by wb::manager::post_draw().
side_actions_ptr wb::viewer_actions | ( | ) |
Definition at line 49 of file utility.cpp.
References resources::screen, 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::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 44 of file utility.cpp.
References resources::screen, and display::viewing_side().
Referenced by wb::manager::can_enable_execution_hotkeys(), wb::manager::contextual_delete(), wb::manager::contextual_execute(), wb::manager::create_temp_move(), wb::manager::on_change_controller(), wb::manager::on_finish_side_turn(), and wb::manager::options_dlg().
size_t wb::viewer_team | ( | ) |
Definition at line 39 of file utility.cpp.
References resources::screen, and display::viewing_team().
Referenced by wb::move::check_validity(), wb::mapbuilder::pre_build(), and wb::manager::update_plan_hiding().