This class is the frontend of the whiteboard framework for the rest of the Wesnoth code. More...
#include <manager.hpp>
Public Member Functions | |
manager (const manager &)=delete | |
manager & | operator= (const manager &)=delete |
manager () | |
~manager () | |
void | print_help_once () |
bool | can_modify_game_state () const |
Determine whether the game is initialized and the current side has control of the game i.e. More... | |
bool | can_activate () const |
Determine whether the whiteboard can be activated safely. More... | |
bool | is_active () const |
Determine whether the whiteboard is activated. More... | |
void | set_active (bool active) |
Activates/Deactivates the whiteboard. More... | |
void | set_invert_behavior (bool invert) |
Called by the key that temporarily toggles the activated state when held. More... | |
whiteboard_lock | get_activation_state_lock () |
Prevents the whiteboard from changing its activation state, as long as the returned reference is held. More... | |
bool | is_executing_actions () const |
Is the whiteboard in the process of executing an action? More... | |
bool | can_enable_execution_hotkeys () const |
Used to ask the whiteboard if its action execution hotkeys should be available to the user. More... | |
bool | can_enable_modifier_hotkeys () const |
Used to ask the whiteboard if hotkeys affecting the action queue should be available to the user. More... | |
bool | can_enable_reorder_hotkeys () const |
Used to ask the whiteboard if its action reordering hotkeys should be available to the user. More... | |
bool | allow_leader_to_move (const unit &leader) const |
Used to ask permission to the wb to move a leader, to avoid invalidating planned recruits. More... | |
bool | allow_end_turn () |
@ return true if the whiteboard is ready to end turn. More... | |
void | on_init_side () |
The on_* methods below inform the whiteboard of specific events. More... | |
void | on_finish_side_turn (int side) |
void | on_mouseover_change (const map_location &hex) |
void | on_deselect_hex () |
void | on_gamestate_change () |
void | on_viewer_change (std::size_t team_index) |
void | on_change_controller (int side, const team &t) |
void | on_kill_unit () |
void | pre_delete_action (action_ptr action) |
Handles various cleanup right before removing an action from the queue. More... | |
void | post_delete_action (action_ptr action) |
Handles various cleanup right after removing an action from the queue. More... | |
void | send_network_data () |
Called by replay_network_sender to add whiteboard data to the outgoing network packets. More... | |
void | process_network_data (const config &) |
Called by turn_info::process_network_data() when network data needs to be processed. More... | |
void | queue_net_cmd (std::size_t team_index, const side_actions::net_cmd &) |
Adds a side_actions::net_cmd to net_buffer_[team_index], whereupon it will (later) be sent to all allies. More... | |
void | validate_viewer_actions () |
Validates all actions of the current viewing side. More... | |
bool | has_planned_unit_map () const |
Whether the planned unit map is currently applied. More... | |
void | pre_draw () |
Called from the display before drawing. More... | |
void | post_draw () |
Called from the display after drawing. More... | |
void | draw_hex (const map_location &hex) |
Called from the display when drawing hexes, to allow the whiteboard to add visual elements. More... | |
void | create_temp_move () |
Creates a temporary visual arrow, that follows the cursor, for move creation purposes. More... | |
bool | has_temp_move () const |
Informs whether an arrow is being displayed for move creation purposes. More... | |
void | erase_temp_move () |
Erase the temporary arrow. More... | |
void | save_temp_move () |
Creates a move action for the current side, and erases the temp move. More... | |
unit_map::iterator | get_temp_move_unit () const |
void | save_temp_attack (const map_location &attacker_loc, const map_location &defender_loc, int weapon_choice) |
Creates an attack or attack-move action for the current side. More... | |
bool | save_recruit (const std::string &name, int side_num, const map_location &recruit_hex) |
Creates a recruit action for the current side. More... | |
bool | save_recall (const unit &unit, int side_num, const map_location &recall_hex) |
Creates a recall action for the current side. More... | |
void | save_suppose_dead (unit &curr_unit, const map_location &loc) |
Creates a suppose-dead action for the current side. More... | |
void | contextual_execute () |
Executes first action in the queue for current side. More... | |
bool | execute_all_actions () |
Executes all actions for the current turn in sequence. More... | |
void | contextual_delete () |
Deletes last action in the queue for current side. More... | |
void | contextual_bump_up_action () |
Moves the action determined by the UI toward the beginning of the queue More... | |
void | contextual_bump_down_action () |
Moves the action determined by the UI toward the beginning of the queue More... | |
std::weak_ptr< highlighter > | get_highlighter () |
Get the highlight visitor instance in use by the manager. More... | |
bool | has_actions () const |
Checks whether the whiteboard has any planned action on any team. More... | |
bool | unit_has_actions (unit const *unit) const |
Checks whether the specified unit has at least one planned action. More... | |
int | get_spent_gold_for (int side) |
Used to track gold spending per-side when building the planned unit map Is referenced by the top bar gold display. More... | |
bool | should_clear_undo () const |
Determines whether or not the undo_stack should be cleared. More... | |
void | options_dlg () |
Displays the whiteboard options dialog. More... | |
Static Public Member Functions | |
static bool | current_side_has_actions () |
Whether the current side has actions in the first turn of its planned actions queue. More... | |
Private Member Functions | |
void | set_planned_unit_map () |
Transforms the unit map so that it now reflects the future state of things, i.e. More... | |
void | set_real_unit_map () |
Restore the regular unit map. More... | |
void | validate_actions_if_needed () |
void | update_plan_hiding (std::size_t viewing_team) |
Called by all of the save_***() methods after they have added their action to the queue. More... | |
void | update_plan_hiding () |
Private Attributes | |
bool | active_ |
Tracks whether the whiteboard is active. More... | |
bool | inverted_behavior_ |
bool | self_activate_once_ |
bool | wait_for_side_init_ |
bool | planned_unit_map_active_ |
bool | executing_actions_ |
Track whenever we're modifying actions, to avoid dual execution etc. More... | |
bool | executing_all_actions_ |
Track whether we're in the process of executing all actions. More... | |
bool | preparing_to_end_turn_ |
true if we're in the process of executing all action and should end turn once finished. More... | |
bool | gamestate_mutated_ |
Track whether the gamestate changed and we need to validate actions. More... | |
whiteboard_lock | activation_state_lock_ |
Reference counted "lock" to allow preventing whiteboard activation state changes. More... | |
whiteboard_lock | unit_map_lock_ |
Reference counted "lock" to prevent the building of the unit map at certain times. More... | |
std::unique_ptr< mapbuilder > | mapbuilder_ |
std::shared_ptr< highlighter > | highlighter_ |
std::unique_ptr< pathfind::marked_route > | route_ |
std::vector< arrow_ptr > | move_arrows_ |
std::vector< fake_unit_ptr > | fake_units_ |
std::size_t | temp_move_unit_underlying_id_ |
const std::unique_ptr< CKey > | key_poller_ |
std::vector< map_location > | hidden_unit_hexes_ |
std::vector< config > | net_buffer_ |
net_buffer_[i] = whiteboard network data to be sent "from" teams[i]. More... | |
boost::dynamic_bitset | team_plans_hidden_ |
team_plans_hidden_[i] = whether or not to hide actions from teams[i]. More... | |
std::set< std::size_t > | units_owning_moves_ |
used to keep track of units owning planned moves for visual ghosting/unghosting More... | |
Friends | |
struct | future_map |
struct | future_map_if_active |
struct | real_map |
This class is the frontend of the whiteboard framework for the rest of the Wesnoth code.
Definition at line 43 of file manager.hpp.
|
delete |
wb::manager::manager | ( | ) |
Definition at line 57 of file manager.cpp.
References prefs::get(), LOG_WB, and team_plans_hidden_.
wb::manager::~manager | ( | ) |
Definition at line 90 of file manager.cpp.
References LOG_WB.
bool wb::manager::allow_end_turn | ( | ) |
@ return true if the whiteboard is ready to end turn.
Triggers the execution of remaining planned actions.
Definition at line 976 of file manager.cpp.
References execute_all_actions(), and preparing_to_end_turn_.
bool wb::manager::allow_leader_to_move | ( | const unit & | leader | ) | const |
Used to ask permission to the wb to move a leader, to avoid invalidating planned recruits.
Definition at line 265 of file manager.cpp.
References executing_actions_, resources::filter_con, wb::find_backup_leader(), wb::recall::get_recall_hex(), wb::recruit::get_recruit_hex(), has_actions(), has_planned_unit_map(), wb::viewer_actions(), and WRN_WB.
bool wb::manager::can_activate | ( | ) | const |
Determine whether the whiteboard can be activated safely.
Definition at line 161 of file manager.cpp.
References activation_state_lock_, and can_modify_game_state().
Referenced by set_active(), and set_invert_behavior().
bool wb::manager::can_enable_execution_hotkeys | ( | ) | const |
Used to ask the whiteboard if its action execution hotkeys should be available to the user.
Definition at line 249 of file manager.cpp.
References can_enable_modifier_hotkeys(), resources::controller, play_controller::current_side(), wb::viewer_actions(), and wb::viewer_side().
Referenced by contextual_execute(), and execute_all_actions().
bool wb::manager::can_enable_modifier_hotkeys | ( | ) | const |
Used to ask the whiteboard if hotkeys affecting the action queue should be available to the user.
Definition at line 255 of file manager.cpp.
References can_modify_game_state(), and wb::viewer_actions().
Referenced by can_enable_execution_hotkeys(), can_enable_reorder_hotkeys(), and contextual_delete().
bool wb::manager::can_enable_reorder_hotkeys | ( | ) | const |
Used to ask the whiteboard if its action reordering hotkeys should be available to the user.
Definition at line 260 of file manager.cpp.
References can_enable_modifier_hotkeys(), and highlighter_.
Referenced by contextual_bump_down_action(), and contextual_bump_up_action().
bool wb::manager::can_modify_game_state | ( | ) | const |
Determine whether the game is initialized and the current side has control of the game i.e.
the whiteboard can take over
Definition at line 144 of file manager.cpp.
References resources::controller, executing_actions_, resources::gameboard, synced_context::is_unsynced(), and wait_for_side_init_.
Referenced by can_activate(), can_enable_modifier_hotkeys(), create_temp_move(), pre_draw(), and set_planned_unit_map().
void wb::manager::contextual_bump_down_action | ( | ) |
Moves the action determined by the UI toward the beginning of the queue
Definition at line 1072 of file manager.cpp.
References can_enable_reorder_hotkeys(), highlighter_, validate_viewer_actions(), and wb::viewer_actions().
void wb::manager::contextual_bump_up_action | ( | ) |
Moves the action determined by the UI toward the beginning of the queue
Definition at line 1060 of file manager.cpp.
References can_enable_reorder_hotkeys(), highlighter_, validate_viewer_actions(), and wb::viewer_actions().
void wb::manager::contextual_delete | ( | ) |
Deletes last action in the queue for current side.
Definition at line 1034 of file manager.cpp.
References can_enable_modifier_hotkeys(), resources::controller, erase_temp_move(), wb::future_visible_unit(), highlighter_, validate_viewer_actions(), wb::viewer_actions(), and wb::viewer_side().
void wb::manager::contextual_execute | ( | ) |
Executes first action in the queue for current side.
Definition at line 940 of file manager.cpp.
References can_enable_execution_hotkeys(), resources::controller, erase_temp_move(), executing_actions_, wb::future_visible_unit(), highlighter_, i, validate_viewer_actions(), wb::viewer_actions(), and wb::viewer_side().
void wb::manager::create_temp_move | ( | ) |
Creates a temporary visual arrow, that follows the cursor, for move creation purposes.
Definition at line 668 of file manager.cpp.
References active_, can_modify_game_state(), unit::clone(), resources::controller, resources::fake_units, fake_units_, wb::future_visible_unit(), events::mouse_handler::get_current_route(), play_controller::get_mouse_handler_base(), team::get_side_color_id(), display::get_singleton(), game_display::get_singleton(), fake_unit_ptr::get_unit_ptr(), unit::id(), pathfind::marked_route::marks, move_arrows_, unit_display::move_unit(), game_config::path, fake_unit_ptr::reset(), route_, team::side(), unit::side(), pathfind::marked_route::steps, arrow::STYLE_HIGHLIGHTED, temp_move_unit_underlying_id_, unit::underlying_id(), wb::viewer_side(), display::viewing_team(), and w.
Referenced by set_active().
|
static |
Whether the current side has actions in the first turn of its planned actions queue.
Definition at line 437 of file manager.cpp.
References wb::current_side_actions().
void wb::manager::draw_hex | ( | const map_location & | hex | ) |
Called from the display when drawing hexes, to allow the whiteboard to add visual elements.
Some visual elements such as arrows and fake units are not handled through this function, but separately registered with the display.
IMPORTANT: none of the code in this method can call anything which would cause a hex to be invalidated (i.e. by calling in turn any variant of display::invalidate()). Doing so messes up the iterator currently going over the list of invalidated hexes to draw.
Definition at line 567 of file manager.cpp.
References wb::action::draw_hex(), wb::draw_numbers(), wb::for_each_action(), resources::gameboard, wb::side_actions::get_numbers(), has_actions(), wb::side_actions::hidden(), t, and wait_for_side_init_.
void wb::manager::erase_temp_move | ( | ) |
Erase the temporary arrow.
Definition at line 770 of file manager.cpp.
References fake_units_, game_display::get_singleton(), move_arrows_, route_, and temp_move_unit_underlying_id_.
Referenced by contextual_delete(), contextual_execute(), execute_all_actions(), on_deselect_hex(), on_finish_side_turn(), save_temp_attack(), save_temp_move(), and set_active().
bool wb::manager::execute_all_actions | ( | ) |
Executes all actions for the current turn in sequence.
Definition at line 982 of file manager.cpp.
References can_enable_execution_hotkeys(), erase_temp_move(), ERR_WB, executing_actions_, executing_all_actions_, has_planned_unit_map(), set_planned_unit_map(), set_real_unit_map(), validate_viewer_actions(), and wb::viewer_actions().
Referenced by allow_end_turn().
|
inline |
Prevents the whiteboard from changing its activation state, as long as the returned reference is held.
Definition at line 71 of file manager.hpp.
References activation_state_lock_.
|
inline |
Get the highlight visitor instance in use by the manager.
Definition at line 173 of file manager.hpp.
References highlighter_.
int wb::manager::get_spent_gold_for | ( | int | side | ) |
Used to track gold spending per-side when building the planned unit map Is referenced by the top bar gold display.
Definition at line 1097 of file manager.cpp.
References resources::gameboard, team::get_side_actions(), game_board::get_team(), and wait_for_side_init_.
unit_map::iterator wb::manager::get_temp_move_unit | ( | ) | const |
Definition at line 821 of file manager.cpp.
References unit_map::find(), resources::gameboard, temp_move_unit_underlying_id_, and game_board::units().
bool wb::manager::has_actions | ( | ) | const |
Checks whether the whiteboard has any planned action on any team.
Definition at line 1084 of file manager.cpp.
References resources::gameboard, and wb::has_actions().
Referenced by allow_leader_to_move(), draw_hex(), and pre_draw().
|
inline |
Whether the planned unit map is currently applied.
Definition at line 116 of file manager.hpp.
References planned_unit_map_active_.
Referenced by allow_leader_to_move(), execute_all_actions(), and validate_viewer_actions().
|
inline |
Informs whether an arrow is being displayed for move creation purposes.
Definition at line 137 of file manager.hpp.
References fake_units_, move_arrows_, and route_.
Referenced by on_mouseover_change(), and save_temp_move().
|
inline |
Determine whether the whiteboard is activated.
Definition at line 65 of file manager.hpp.
References active_.
|
inline |
Is the whiteboard in the process of executing an action?
Definition at line 74 of file manager.hpp.
References executing_actions_.
void wb::manager::on_change_controller | ( | int | side, |
const team & | t | ||
) |
Definition at line 401 of file manager.cpp.
References wb::side_actions::clear(), resources::gameboard, team::get_side_actions(), wb::hide_all_plans(), i, team::is_enemy(), team::is_local_human(), wb::side_actions::make_net_cmd_clear(), queue_net_cmd(), t, wb::side_actions::team_index(), game_board::teams(), update_plan_hiding(), and wb::viewer_side().
|
inline |
Definition at line 92 of file manager.hpp.
References erase_temp_move().
void wb::manager::on_finish_side_turn | ( | int | side | ) |
Definition at line 324 of file manager.cpp.
References erase_temp_move(), highlighter_, LOG_WB, preparing_to_end_turn_, wb::viewer_actions(), wb::viewer_side(), and wait_for_side_init_.
void wb::manager::on_gamestate_change | ( | ) |
Definition at line 613 of file manager.cpp.
References display::clear_exclusive_draws(), DBG_WB, gamestate_mutated_, display::get_singleton(), and planned_unit_map_active_.
void wb::manager::on_init_side | ( | ) |
The on_* methods below inform the whiteboard of specific events.
Definition at line 308 of file manager.cpp.
References executing_actions_, executing_all_actions_, prefs::get(), LOG_WB, self_activate_once_, set_active(), update_plan_hiding(), and wait_for_side_init_.
void wb::manager::on_kill_unit | ( | ) |
Definition at line 430 of file manager.cpp.
References highlighter_.
void wb::manager::on_mouseover_change | ( | const map_location & | hex | ) |
Definition at line 593 of file manager.cpp.
References resources::controller, unit_map::end(), executing_actions_, unit_map::find(), resources::gameboard, play_controller::get_mouse_handler_base(), events::mouse_handler::get_selected_hex(), has_temp_move(), highlighter_, selected_hex, game_board::units(), wb::viewer_actions(), and wait_for_side_init_.
void wb::manager::on_viewer_change | ( | std::size_t | team_index | ) |
Definition at line 395 of file manager.cpp.
References update_plan_hiding(), and wait_for_side_init_.
void wb::manager::options_dlg | ( | ) |
Displays the whiteboard options dialog.
Definition at line 1110 of file manager.cpp.
References _(), resources::gameboard, gui2::dialogs::simple_item_selector::selected_index(), gui2::dialogs::modal_dialog::show(), t, team_plans_hidden_, update_plan_hiding(), VGETTEXT, and wb::viewer_side().
void wb::manager::post_delete_action | ( | action_ptr | action | ) |
Handles various cleanup right after removing an action from the queue.
Definition at line 340 of file manager.cpp.
References wb::side_actions::end(), wb::side_actions::find_last_action_of(), resources::gameboard, wb::move::get_fake_unit(), wb::action::get_unit(), wb::action::team_index(), and game_board::teams().
void wb::manager::post_draw | ( | ) |
Called from the display after drawing.
Definition at line 555 of file manager.cpp.
References unit_map::find(), resources::gameboard, wb::unghost_owner_unit(), game_board::units(), units_owning_moves_, and unit_map::iterator_base< iter_types >::valid().
void wb::manager::pre_delete_action | ( | action_ptr | action | ) |
Handles various cleanup right before removing an action from the queue.
Definition at line 336 of file manager.cpp.
void wb::manager::pre_draw | ( | ) |
Called from the display before drawing.
Definition at line 539 of file manager.cpp.
References can_modify_game_state(), unit_map::find(), wb::for_each_action(), resources::gameboard, wb::ghost_owner_unit(), has_actions(), unit_map_lock_, game_board::units(), units_owning_moves_, and unit_map::iterator_base< iter_types >::valid().
void wb::manager::print_help_once | ( | ) |
Definition at line 104 of file manager.cpp.
References hotkey::get_hotkey(), hotkey::HOTKEY_WB_BUMP_DOWN_ACTION, hotkey::HOTKEY_WB_BUMP_UP_ACTION, hotkey::HOTKEY_WB_DELETE_ACTION, hotkey::HOTKEY_WB_EXECUTE_ACTION, and hotkey::HOTKEY_WB_EXECUTE_ALL_ACTIONS.
Referenced by save_recall(), save_recruit(), save_temp_attack(), and save_temp_move().
void wb::manager::process_network_data | ( | const config & | cfg | ) |
Called by turn_info::process_network_data() when network data needs to be processed.
Definition at line 649 of file manager.cpp.
References config::child_range(), resources::gameboard, team::get_side_actions(), game_board::get_team(), LOG_WB, and config::optional_child().
void wb::manager::queue_net_cmd | ( | std::size_t | team_index, |
const side_actions::net_cmd & | cmd | ||
) |
Adds a side_actions::net_cmd to net_buffer_[team_index], whereupon it will (later) be sent to all allies.
Definition at line 662 of file manager.cpp.
References net_buffer_.
Referenced by on_change_controller().
bool wb::manager::save_recall | ( | const unit & | unit, |
int | side_num, | ||
const map_location & | recall_hex | ||
) |
Creates a recall action for the current side.
Definition at line 904 of file manager.cpp.
References active_, resources::controller, executing_actions_, display::get_singleton(), LOG_WB, wb::side_actions::num_turns(), print_help_once(), wb::side_actions::queue_recall(), and wb::viewer_actions().
bool wb::manager::save_recruit | ( | const std::string & | name, |
int | side_num, | ||
const map_location & | recruit_hex | ||
) |
Creates a recruit action for the current side.
Definition at line 876 of file manager.cpp.
References active_, resources::controller, executing_actions_, wb::find_recruiter(), display::get_singleton(), wb::side_actions::get_turn_num_of(), LOG_WB, print_help_once(), wb::side_actions::queue_recruit(), and wb::viewer_actions().
void wb::manager::save_suppose_dead | ( | unit & | curr_unit, |
const map_location & | loc | ||
) |
Creates a suppose-dead action for the current side.
Definition at line 930 of file manager.cpp.
References active_, resources::controller, executing_actions_, wb::side_actions::get_turn_num_of(), wb::side_actions::queue_suppose_dead(), validate_viewer_actions(), and wb::viewer_actions().
void wb::manager::save_temp_attack | ( | const map_location & | attacker_loc, |
const map_location & | defender_loc, | ||
int | weapon_choice | ||
) |
Creates an attack or attack-move action for the current side.
Definition at line 826 of file manager.cpp.
References active_, resources::controller, erase_temp_move(), executing_actions_, fake_units_, wb::future_visible_unit(), display::get_singleton(), wb::side_actions::get_turn_num_of(), display::invalidate(), LOG_WB, move_arrows_, print_help_once(), wb::side_actions::queue_attack(), route_, validate_viewer_actions(), and wb::viewer_actions().
void wb::manager::save_temp_move | ( | ) |
Creates a move action for the current side, and erases the temp move.
The move action is inserted at the end of the queue, to be executed last.
Definition at line 783 of file manager.cpp.
References resources::controller, erase_temp_move(), executing_actions_, fake_units_, wb::future_visible_unit(), wb::side_actions::get_turn_num_of(), has_temp_move(), i, LOG_WB, move_arrows_, pathfind::marked_route::move_cost, print_help_once(), wb::side_actions::queue_move(), route_, utf8::size(), pathfind::marked_route::steps, arrow::valid_path(), validate_viewer_actions(), and wb::viewer_actions().
void wb::manager::send_network_data | ( | ) |
Called by replay_network_sender to add whiteboard data to the outgoing network packets.
Definition at line 625 of file manager.cpp.
References config::add_child(), config::child_count(), config::clear(), resources::controller, config::empty(), resources::gameboard, LOG_WB, net_buffer_, play_controller::send_to_wesnothd(), utf8::size(), and game_board::teams().
void wb::manager::set_active | ( | bool | active | ) |
Activates/Deactivates the whiteboard.
Definition at line 170 of file manager.cpp.
References active_, can_activate(), actions::undo_list::clear(), resources::controller, create_temp_move(), erase_temp_move(), replay_helper::get_auto_shroud(), LOG_WB, synced_context::run_and_throw(), should_clear_undo(), resources::undo_stack, validate_viewer_actions(), and wb::viewer_actions().
Referenced by on_init_side(), and set_invert_behavior().
void wb::manager::set_invert_behavior | ( | bool | invert | ) |
Called by the key that temporarily toggles the activated state when held.
Definition at line 199 of file manager.cpp.
References activation_state_lock_, active_, can_activate(), DBG_WB, inverted_behavior_, and set_active().
|
private |
Transforms the unit map so that it now reflects the future state of things, i.e.
when all planned actions will have been executed
Definition at line 1172 of file manager.cpp.
References can_modify_game_state(), resources::gameboard, log_scope2, LOG_WB, log_whiteboard, mapbuilder_, planned_unit_map_active_, unit_map_lock_, and WRN_WB.
Referenced by execute_all_actions().
|
private |
Restore the regular unit map.
Definition at line 1195 of file manager.cpp.
References executing_actions_, log_scope2, LOG_WB, log_whiteboard, mapbuilder_, planned_unit_map_active_, and wait_for_side_init_.
Referenced by execute_all_actions().
bool wb::manager::should_clear_undo | ( | ) | const |
Determines whether or not the undo_stack should be cleared.
Definition at line 1105 of file manager.cpp.
References resources::controller, play_controller::current_team(), team::is_local(), and play_controller::is_networked_mp().
Referenced by set_active().
bool wb::manager::unit_has_actions | ( | unit const * | unit | ) | const |
Checks whether the specified unit has at least one planned action.
Definition at line 1090 of file manager.cpp.
References resources::gameboard, and wb::viewer_actions().
|
private |
Definition at line 390 of file manager.cpp.
References display::get_singleton().
Referenced by on_change_controller(), on_init_side(), on_viewer_change(), and options_dlg().
|
private |
Called by all of the save_***() methods after they have added their action to the queue.
Definition at line 368 of file manager.cpp.
References schema_validation::at(), resources::gameboard, wb::hide_all_plans(), t, team_plans_hidden_, and validate_viewer_actions().
|
private |
Definition at line 1214 of file manager.cpp.
References gamestate_mutated_, and validate_viewer_actions().
void wb::manager::validate_viewer_actions | ( | ) |
Validates all actions of the current viewing side.
Definition at line 447 of file manager.cpp.
References future_map, gamestate_mutated_, has_planned_unit_map(), LOG_WB, and real_map.
Referenced by contextual_bump_down_action(), contextual_bump_up_action(), contextual_delete(), contextual_execute(), execute_all_actions(), save_suppose_dead(), save_temp_attack(), save_temp_move(), set_active(), update_plan_hiding(), and validate_actions_if_needed().
|
friend |
Definition at line 45 of file manager.hpp.
Referenced by validate_viewer_actions().
|
friend |
Definition at line 46 of file manager.hpp.
|
friend |
Definition at line 47 of file manager.hpp.
Referenced by validate_viewer_actions().
|
private |
Reference counted "lock" to allow preventing whiteboard activation state changes.
Definition at line 222 of file manager.hpp.
Referenced by can_activate(), get_activation_state_lock(), and set_invert_behavior().
|
private |
Tracks whether the whiteboard is active.
Definition at line 204 of file manager.hpp.
Referenced by create_temp_move(), is_active(), save_recall(), save_recruit(), save_suppose_dead(), save_temp_attack(), set_active(), and set_invert_behavior().
|
private |
Track whenever we're modifying actions, to avoid dual execution etc.
Definition at line 213 of file manager.hpp.
Referenced by allow_leader_to_move(), can_modify_game_state(), contextual_execute(), execute_all_actions(), is_executing_actions(), on_init_side(), on_mouseover_change(), save_recall(), save_recruit(), save_suppose_dead(), save_temp_attack(), save_temp_move(), and set_real_unit_map().
|
private |
Track whether we're in the process of executing all actions.
Definition at line 215 of file manager.hpp.
Referenced by execute_all_actions(), and on_init_side().
|
private |
Definition at line 233 of file manager.hpp.
Referenced by create_temp_move(), erase_temp_move(), has_temp_move(), save_temp_attack(), and save_temp_move().
|
private |
Track whether the gamestate changed and we need to validate actions.
Definition at line 219 of file manager.hpp.
Referenced by on_gamestate_change(), validate_actions_if_needed(), and validate_viewer_actions().
|
private |
Definition at line 238 of file manager.hpp.
|
private |
Definition at line 228 of file manager.hpp.
Referenced by can_enable_reorder_hotkeys(), contextual_bump_down_action(), contextual_bump_up_action(), contextual_delete(), contextual_execute(), get_highlighter(), on_finish_side_turn(), on_kill_unit(), and on_mouseover_change().
|
private |
Definition at line 205 of file manager.hpp.
Referenced by set_invert_behavior().
|
private |
Definition at line 236 of file manager.hpp.
|
private |
Definition at line 227 of file manager.hpp.
Referenced by set_planned_unit_map(), and set_real_unit_map().
|
private |
Definition at line 232 of file manager.hpp.
Referenced by create_temp_move(), erase_temp_move(), has_temp_move(), save_temp_attack(), and save_temp_move().
|
private |
net_buffer_[i] = whiteboard network data to be sent "from" teams[i].
Definition at line 241 of file manager.hpp.
Referenced by queue_net_cmd(), and send_network_data().
|
private |
Definition at line 211 of file manager.hpp.
Referenced by has_planned_unit_map(), on_gamestate_change(), set_planned_unit_map(), and set_real_unit_map().
|
private |
true if we're in the process of executing all action and should end turn once finished.
Definition at line 217 of file manager.hpp.
Referenced by allow_end_turn(), and on_finish_side_turn().
|
private |
Definition at line 230 of file manager.hpp.
Referenced by create_temp_move(), erase_temp_move(), has_temp_move(), save_temp_attack(), and save_temp_move().
|
private |
Definition at line 206 of file manager.hpp.
Referenced by on_init_side().
|
private |
team_plans_hidden_[i] = whether or not to hide actions from teams[i].
Definition at line 244 of file manager.hpp.
Referenced by manager(), options_dlg(), and update_plan_hiding().
|
private |
Definition at line 234 of file manager.hpp.
Referenced by create_temp_move(), erase_temp_move(), and get_temp_move_unit().
|
private |
Reference counted "lock" to prevent the building of the unit map at certain times.
Definition at line 224 of file manager.hpp.
Referenced by pre_draw(), and set_planned_unit_map().
|
private |
used to keep track of units owning planned moves for visual ghosting/unghosting
Definition at line 247 of file manager.hpp.
Referenced by post_draw(), and pre_draw().
|
private |
Definition at line 210 of file manager.hpp.
Referenced by can_modify_game_state(), draw_hex(), get_spent_gold_for(), on_finish_side_turn(), on_init_side(), on_mouseover_change(), on_viewer_change(), and set_real_unit_map().