26 #include <boost/dynamic_bitset.hpp>
208 bool print_help_once_;
230 std::unique_ptr<pathfind::marked_route>
route_;
Class that keeps track of all the keys on the keyboard.
A config object defines a single node in a WML file, with access to child nodes.
This class stores all the data for a single 'side' (in game nomenclature).
This class represents a single unit of a specific type.
Abstract base class for all the whiteboard planned actions.
This class is the frontend of the whiteboard framework for the rest of the Wesnoth code.
manager(const manager &)=delete
void pre_delete_action(const action_ptr &action)
Handles various cleanup right before removing an action from the queue.
bool executing_all_actions_
Track whether we're in the process of executing all actions.
void on_finish_side_turn(int side)
void contextual_bump_down_action()
Moves the action determined by the UI toward the beginning of the queue
bool is_executing_actions() const
Is the whiteboard in the process of executing an action?
std::vector< map_location > hidden_unit_hexes_
void on_viewer_change(std::size_t team_index)
bool can_activate() const
Determine whether the whiteboard can be activated safely.
bool active_
Tracks whether the whiteboard is active.
bool executing_actions_
Track whenever we're modifying actions, to avoid dual execution etc.
std::unique_ptr< mapbuilder > mapbuilder_
whiteboard_lock activation_state_lock_
Reference counted "lock" to allow preventing whiteboard activation state changes.
std::vector< fake_unit_ptr > fake_units_
bool has_temp_move() const
Informs whether an arrow is being displayed for move creation purposes.
bool allow_end_turn()
@ return true if the whiteboard is ready to end turn.
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.
std::set< std::size_t > units_owning_moves_
used to keep track of units owning planned moves for visual ghosting/unghosting
const std::unique_ptr< CKey > key_poller_
bool has_planned_unit_map() const
Whether the planned unit map is currently applied.
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 all...
void contextual_bump_up_action()
Moves the action determined by the UI toward the beginning of the queue
void post_delete_action(const action_ptr &action)
Handles various cleanup right after removing an action from the queue.
void set_active(bool active)
Activates/Deactivates the whiteboard.
void set_planned_unit_map()
Transforms the unit map so that it now reflects the future state of things, i.e.
bool gamestate_mutated_
Track whether the gamestate changed and we need to validate actions.
void save_suppose_dead(unit &curr_unit, const map_location &loc)
Creates a suppose-dead action for the current side.
whiteboard_lock get_activation_state_lock()
Prevents the whiteboard from changing its activation state, as long as the returned reference is held...
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 ...
whiteboard_lock unit_map_lock_
Reference counted "lock" to prevent the building of the unit map at certain times.
void set_real_unit_map()
Restore the regular unit map.
bool is_active() const
Determine whether the whiteboard is activated.
bool can_enable_execution_hotkeys() const
Used to ask the whiteboard if its action execution hotkeys should be available to the user.
static bool current_side_has_actions()
Whether the current side has actions in the first turn of its planned actions queue.
void draw_hex(const map_location &hex)
Called from the display when drawing hexes, to allow the whiteboard to add visual elements.
std::size_t temp_move_unit_underlying_id_
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.
std::shared_ptr< highlighter > highlighter_
void process_network_data(const config &)
Called by turn_info::process_network_data() when network data needs to be processed.
void validate_actions_if_needed()
void options_dlg()
Displays the whiteboard options dialog.
void set_invert_behavior(bool invert)
Called by the key that temporarily toggles the activated state when held.
void on_change_controller(int side, const team &t)
bool planned_unit_map_active_
bool preparing_to_end_turn_
true if we're in the process of executing all action and should end turn once finished.
bool can_modify_game_state() const
Determine whether the game is initialized and the current side has control of the game i....
void post_draw()
Called from the display after drawing.
bool can_enable_reorder_hotkeys() const
Used to ask the whiteboard if its action reordering hotkeys should be available to the user.
bool save_recall(const unit &unit, int side_num, const map_location &recall_hex)
Creates a recall action for the current side.
void update_plan_hiding()
std::vector< config > net_buffer_
net_buffer_[i] = whiteboard network data to be sent "from" teams[i].
void contextual_delete()
Deletes last action in the queue for current side.
void create_temp_move()
Creates a temporary visual arrow, that follows the cursor, for move creation purposes.
bool can_enable_modifier_hotkeys() const
Used to ask the whiteboard if hotkeys affecting the action queue should be available to the user.
void send_network_data()
Called by replay_network_sender to add whiteboard data to the outgoing network packets.
void save_temp_move()
Creates a move action for the current side, and erases the temp move.
bool should_clear_undo() const
Determines whether or not the undo_stack should be cleared.
void validate_viewer_actions()
Validates all actions of the current viewing side.
bool unit_has_actions(unit const *unit) const
Checks whether the specified unit has at least one planned action.
void on_init_side()
The on_* methods below inform the whiteboard of specific events.
bool save_recruit(const std::string &name, int side_num, const map_location &recruit_hex)
Creates a recruit action for the current side.
void on_gamestate_change()
void on_mouseover_change(const map_location &hex)
void erase_temp_move()
Erase the temporary arrow.
boost::dynamic_bitset team_plans_hidden_
team_plans_hidden_[i] = whether or not to hide actions from teams[i].
manager & operator=(const manager &)=delete
bool execute_all_actions()
Executes all actions for the current turn in sequence.
void pre_draw()
Called from the display before drawing.
void contextual_execute()
Executes first action in the queue for current side.
std::weak_ptr< highlighter > get_highlighter()
Get the highlight visitor instance in use by the manager.
unit_map::iterator get_temp_move_unit() const
std::unique_ptr< pathfind::marked_route > route_
bool has_actions() const
Checks whether the whiteboard has any planned action on any team.
std::vector< arrow_ptr > move_arrows_
std::shared_ptr< bool > whiteboard_lock
std::shared_ptr< action > action_ptr
Encapsulates the map of the game.
ONLY IF whiteboard is currently active, applies the planned unit map for the duration of the struct's...
bool initial_planned_unit_map_
const std::unique_ptr< future_map > future_map_
Applies the planned unit map for the duration of the struct's life.
bool initial_planned_unit_map_
Ensures that the real unit map is active for the duration of the struct's life.
bool initial_planned_unit_map_
whiteboard_lock unit_map_lock_