The Battle for Wesnoth  1.15.2+dev
Classes | Public Member Functions | Protected Member Functions | Protected Attributes | Private Member Functions | Private Attributes | Friends | List of all members
play_controller Class Referenceabstract

#include <play_controller.hpp>

Inheritance diagram for play_controller:
Inheritance graph

Classes

class  hotkey_handler
 
struct  scoped_savegame_snapshot
 

Public Member Functions

 play_controller (const config &level, saved_game &state_of_game, const ter_data_cache &tdata, bool skip_replay)
 
virtual ~play_controller ()
 
virtual void handle_generic_event (const std::string &) override
 
bool can_undo () const
 
bool can_redo () const
 
void undo ()
 
void redo ()
 
void load_game ()
 
void save_game ()
 
void save_game_auto (const std::string &filename)
 
void save_replay ()
 
void save_replay_auto (const std::string &filename)
 
void save_map ()
 
replayget_replay ()
 
void init_side_begin ()
 
void maybe_do_init_side ()
 Called by turn_info::process_network_data() or init_side() to call do_init_side() if necessary. More...
 
void do_init_side ()
 Called by replay handler or init_side() to do actual work for turn change. More...
 
void init_side_end ()
 
virtual void force_end_turn ()=0
 
virtual void check_objectives ()=0
 
virtual void on_not_observer ()=0
 
virtual void process_oos (const std::string &msg) const
 Asks the user whether to continue on an OOS error. More...
 
void set_end_level_data (const end_level_data &data)
 
void reset_end_level_data ()
 
bool is_regular_game_end () const
 
const end_level_dataget_end_level_data_const () const
 
const std::vector< team > & get_teams_const () const
 
const unit_mapget_units_const () const
 
const gamemapget_map_const () const
 
const tod_managerget_tod_manager_const () const
 
bool is_observer () const
 
bool do_healing () const
 
void set_do_healing (bool do_healing)
 
game_stategamestate ()
 
const game_stategamestate () const
 
void check_victory ()
 Checks to see if a side has won. More...
 
std::size_t turn () const
 
int current_side () const
 Returns the number of the side whose turn it is. More...
 
config to_config () const
 Builds the snapshot config from members and their respective configs. More...
 
bool is_skipping_replay () const
 
void toggle_skipping_replay ()
 
bool is_linger_mode () const
 
void do_autosave ()
 
bool is_skipping_story () const
 
void do_consolesave (const std::string &filename)
 
events::mouse_handlerget_mouse_handler_base () override
 Get a reference to a mouse handler member a derived class uses. More...
 
events::menu_handlerget_menu_handler ()
 
std::shared_ptr< wb::managerget_whiteboard () const
 
const mp_game_settingsget_mp_settings ()
 
game_classificationget_classification ()
 
int get_server_request_number () const
 
void increase_server_request_number ()
 
game_events::wml_event_pumppump ()
 
int get_ticks () const
 
virtual soundsource::managerget_soundsource_man () override
 Get (optionally) a soundsources manager a derived class uses. More...
 
virtual plugins_contextget_plugins_context () override
 Get (optionally) a plugins context a derived class uses. More...
 
hotkey::command_executorget_hotkey_command_executor () override
 Optionally get a command executor to handle context menu events. More...
 
actions::undo_listget_undo_stack ()
 
bool is_browsing () const override
 
bool is_lingering () const
 
virtual replay_controllerget_replay_controller () const
 
bool is_replay () const
 
t_string get_scenario_name () const
 
bool get_disallow_recall () const
 
std::string theme () const
 
virtual bool should_return_to_play_side () const
 
void maybe_throw_return_to_play_side () const
 
virtual void play_side_impl ()
 
void play_side ()
 
teamcurrent_team ()
 
const teamcurrent_team () const
 
bool can_use_synced_wml_menu () const
 
std::set< std::string > all_players () const
 
int ticks () const
 
game_displayget_display () override
 Get a reference to a display member a derived class uses. More...
 
void update_savegame_snapshot () const
 
void update_gui_to_player (const int team_index, const bool observe=false)
 Changes the UI for this client to the passed side index. More...
 
virtual bool is_networked_mp () const
 
virtual void send_to_wesnothd (const config &, const std::string &="unknown") const
 
virtual bool receive_from_wesnothd (config &) const
 
void refresh_objectives () const
 Reevaluate [show_if] conditions and build a new objectives string. More...
 
void show_objectives () const
 
saved_gameget_saved_game ()
 
- Public Member Functions inherited from controller_base
 controller_base ()
 
virtual ~controller_base ()
 
virtual void play_slice (bool is_delay_enabled=true)
 
void apply_keyboard_scroll (int x, int y)
 
void set_scroll_up (bool on)
 
void set_scroll_down (bool on)
 
void set_scroll_left (bool on)
 
void set_scroll_right (bool on)
 
- Public Member Functions inherited from events::sdl_handler
virtual void process_event ()
 
virtual void draw ()
 
virtual void volatile_draw ()
 
virtual void volatile_undraw ()
 
virtual bool requires_event_focus (const SDL_Event *=nullptr) const
 
virtual void process_help_string (int, int)
 
virtual void process_tooltip_string (int, int)
 
virtual void join ()
 
virtual void join (context &c)
 
virtual void join_same (sdl_handler *parent)
 
virtual void leave ()
 
virtual void join_global ()
 
virtual void leave_global ()
 
virtual bool has_joined ()
 
virtual bool has_joined_global ()
 
sdl_handleroperator= (sdl_handler &&)=delete
 Moving would require two instances' context membership to be handled, it's simpler to delete these and require the two instances to be separately constructed / destructed. More...
 
 sdl_handler (sdl_handler &&)=delete
 
- Public Member Functions inherited from events::pump_monitor
 pump_monitor ()
 
virtual ~pump_monitor ()
 
- Public Member Functions inherited from events::observer
virtual ~observer ()
 
- Public Member Functions inherited from quit_confirmation
 quit_confirmation (const std::function< bool()> &prompt=&quit_confirmation::default_prompt)
 
 ~quit_confirmation ()
 

Protected Member Functions

void play_slice_catch ()
 
bool have_keyboard_focus () override
 Derived classes should override this to return false when arrow keys should not scroll the map, hotkeys not processed etc, for example when a textbox is active. More...
 
void process_focus_keydown_event (const SDL_Event &event) override
 Process keydown (only when the general map display does not have focus). More...
 
void process_keydown_event (const SDL_Event &event) override
 Process keydown (always). More...
 
void process_keyup_event (const SDL_Event &event) override
 Process keyup (always). More...
 
void init_managers ()
 
void fire_preload ()
 preload events cannot be synced More...
 
void fire_prestart ()
 
void fire_start ()
 
void start_game ()
 
virtual void init_gui ()
 
void finish_side_turn ()
 
void finish_turn ()
 
bool enemies_visible () const
 
void enter_textbox ()
 
void tab ()
 
bool is_team_visible (int team_num, bool observer) const
 
int find_last_visible_team () const
 returns 0 if no such team was found. More...
 
actions::undo_listundo_stack ()
 
const actions::undo_listundo_stack () const
 
const std::string & select_music (bool victory) const
 
void reset_gamestate (const config &level, int replay_pos)
 
virtual void sync_end_turn ()
 
virtual void check_time_over ()
 
virtual void update_viewing_player ()=0
 
void play_turn ()
 
- Protected Member Functions inherited from controller_base
virtual std::vector< std::string > additional_actions_pressed ()
 
bool handle_scroll (int mousex, int mousey, int mouse_flags)
 Handle scrolling by keyboard, joystick and moving mouse near map edges. More...
 
void handle_event (const SDL_Event &event) override
 Process mouse- and keypress-events from SDL. More...
 
void handle_window_event (const SDL_Event &) override
 
virtual void process (events::pump_info &) override
 
virtual void show_menu (const std::vector< config > &items_arg, int xloc, int yloc, bool context_menu, display &disp)
 
virtual void execute_action (const std::vector< std::string > &items_arg, int xloc, int yloc, bool context_menu)
 
virtual bool in_context_menu (hotkey::HOTKEY_COMMAND command) const
 
void long_touch_callback (int x, int y)
 
- Protected Member Functions inherited from video2::draw_layering
 draw_layering (const bool auto_join=true)
 
virtual ~draw_layering ()
 
- Protected Member Functions inherited from events::sdl_handler
 sdl_handler (const bool auto_join=true)
 
 sdl_handler (const sdl_handler &)
 
sdl_handleroperator= (const sdl_handler &)
 
virtual ~sdl_handler ()
 
virtual std::vector< sdl_handler * > handler_members ()
 

Protected Attributes

const ter_data_cachetdata_
 
std::unique_ptr< game_stategamestate_
 
config level_
 
saved_gamesaved_game_
 
std::unique_ptr< tooltips::managertooltips_manager_
 
std::shared_ptr< wb::managerwhiteboard_manager_
 
std::unique_ptr< plugins_contextplugins_context_
 
font::floating_label_context labels_manager_
 
help::help_manager help_manager_
 
events::mouse_handler mouse_handler_
 
events::menu_handler menu_handler_
 
std::unique_ptr< hotkey_handlerhotkey_handler_
 
std::unique_ptr< soundsource::managersoundsources_manager_
 
persist_manager persist_
 
std::unique_ptr< game_displaygui_
 
const std::unique_ptr< unit_experience_acceleratorxp_mod_
 
const std::unique_ptr< const statistics::scenario_contextstatistics_context_
 
std::unique_ptr< replayreplay_
 
bool skip_replay_
 
bool skip_story_
 
bool linger_
 
bool init_side_done_now_
 Whether we did init sides in this session (false = we did init sides before we reloaded the game). More...
 
map_location map_start_
 
bool ignore_replay_errors_
 
bool player_type_changed_
 
- Protected Attributes inherited from controller_base
const configgame_config_
 
CKey key_
 
bool scrolling_
 
bool scroll_up_
 
bool scroll_down_
 
bool scroll_left_
 
bool scroll_right_
 

Private Member Functions

void init (const config &level)
 

Private Attributes

const int ticks_
 
bool victory_when_enemies_defeated_
 
bool remove_from_carryover_on_defeat_
 
std::vector< std::string > victory_music_
 
std::vector< std::string > defeat_music_
 
hotkey::scope_changer scope_
 

Friends

struct scoped_savegame_snapshot
 

Additional Inherited Members

- Static Public Member Functions inherited from controller_base
static const configget_theme (const config &game_config, std::string theme_name)
 
- Static Public Member Functions inherited from quit_confirmation
static bool quit ()
 Shows the quit confirmation if needed. More...
 
static void quit_to_title ()
 
static void quit_to_desktop ()
 
static bool show_prompt (const std::string &message)
 
static bool default_prompt ()
 

Detailed Description

Definition at line 76 of file play_controller.hpp.

Constructor & Destructor Documentation

◆ play_controller()

play_controller::play_controller ( const config level,
saved_game state_of_game,
const ter_data_cache tdata,
bool  skip_replay 
)

◆ ~play_controller()

play_controller::~play_controller ( )
virtual

Member Function Documentation

◆ all_players()

std::set< std::string > play_controller::all_players ( ) const

Definition at line 1157 of file play_controller.cpp.

References get_teams_const(), gui_, and t.

◆ can_redo()

bool play_controller::can_redo ( ) const

◆ can_undo()

bool play_controller::can_undo ( ) const

◆ can_use_synced_wml_menu()

bool play_controller::can_use_synced_wml_menu ( ) const

◆ check_objectives()

virtual void play_controller::check_objectives ( )
pure virtual

Implemented in playsingle_controller.

Referenced by fire_start().

◆ check_time_over()

void play_controller::check_time_over ( )
protectedvirtual

◆ check_victory()

void play_controller::check_victory ( )

◆ current_side()

int play_controller::current_side ( ) const
inline

◆ current_team() [1/2]

team & play_controller::current_team ( )

◆ current_team() [2/2]

const team & play_controller::current_team ( ) const

◆ do_autosave()

void play_controller::do_autosave ( )

◆ do_consolesave()

void play_controller::do_consolesave ( const std::string &  filename)

◆ do_healing()

bool play_controller::do_healing ( ) const
inline

Definition at line 159 of file play_controller.hpp.

Referenced by do_init_side().

◆ do_init_side()

void play_controller::do_init_side ( )

◆ enemies_visible()

bool play_controller::enemies_visible ( ) const
protected

◆ enter_textbox()

void play_controller::enter_textbox ( )
protected

◆ find_last_visible_team()

int play_controller::find_last_visible_team ( ) const
protected

returns 0 if no such team was found.

Definition at line 751 of file play_controller.cpp.

References game_state::board_, current_side(), gamestate(), i, is_observer(), is_team_visible(), modulo(), and game_board::teams().

Referenced by playsingle_controller::update_viewing_player().

◆ finish_side_turn()

void play_controller::finish_side_turn ( )
protected

◆ finish_turn()

void play_controller::finish_turn ( )
protected

◆ fire_preload()

void play_controller::fire_preload ( )
protected

preload events cannot be synced

Definition at line 347 of file play_controller.cpp.

References game_events::wml_event_pump::fire(), game_state::gamedata_, gamestate(), game_data::get_variable(), pump(), and turn().

Referenced by start_game().

◆ fire_prestart()

void play_controller::fire_prestart ( )
protected

◆ fire_start()

void play_controller::fire_start ( )
protected

◆ force_end_turn()

virtual void play_controller::force_end_turn ( )
pure virtual

◆ gamestate() [1/2]

game_state& play_controller::gamestate ( )
inline

Definition at line 167 of file play_controller.hpp.

Referenced by playsingle_controller::check_objectives(), check_time_over(), check_victory(), events::mouse_handler::current_team(), current_team(), events::mouse_handler::current_unit_attacks_from(), events::mouse_handler::cycle_units(), do_init_side(), do_replay_handle(), playsingle_controller::enable_replay(), enemies_visible(), events::mouse_handler::fill_weapon_choices(), find_last_visible_team(), events::mouse_handler::find_unit(), events::mouse_handler::find_unit_nonowning(), finish_side_turn(), fire_preload(), fire_prestart(), fire_start(), play_controller::hotkey_handler::gamestate(), events::menu_handler::gamestate(), events::mouse_handler::get_adj_enemies(), events::mouse_handler::get_route(), init(), playsingle_controller::init_gui(), init_side_begin(), init_side_end(), game_lua_kernel::intf_end_turn(), is_browsing(), is_team_visible(), playmp_controller::linger(), playsingle_controller::linger(), playmp_controller::maybe_linger(), playsingle_controller::maybe_linger(), events::mouse_handler::mouse_motion(), events::mouse_handler::move_action(), events::mouse_handler::move_unit_along_route(), playmp_controller::play_human_turn(), playsingle_controller::play_scenario(), playsingle_controller::play_scenario_main_loop(), play_side(), replay_controller::play_side_impl(), playsingle_controller::play_side_impl(), play_turn(), playmp_controller::playmp_controller(), process_keyup_event(), pump(), refresh_objectives(), replay_controller::replay_next_turn(), reset_gamestate(), save_game(), events::mouse_handler::select_hex(), events::mouse_handler::select_or_action(), events::mouse_handler::show_attack_dialog(), events::mouse_handler::show_attack_options(), show_objectives(), playsingle_controller::show_turn_dialog(), start_game(), tab(), to_config(), events::mouse_handler::touch_motion(), events::mouse_handler::unit_in_cycle(), replay_controller::update_viewing_player(), and events::mouse_handler::viewing_team().

◆ gamestate() [2/2]

const game_state& play_controller::gamestate ( ) const
inline

Definition at line 170 of file play_controller.hpp.

◆ get_classification()

game_classification & play_controller::get_classification ( )

Definition at line 781 of file play_controller.cpp.

References saved_game::classification(), and saved_game_.

Referenced by game_lua_kernel::game_lua_kernel().

◆ get_disallow_recall()

bool play_controller::get_disallow_recall ( ) const
inline

Definition at line 236 of file play_controller.hpp.

Referenced by events::menu_handler::recall().

◆ get_display()

game_display & play_controller::get_display ( )
overridevirtual

◆ get_end_level_data_const()

const end_level_data& play_controller::get_end_level_data_const ( ) const
inline

◆ get_hotkey_command_executor()

hotkey::command_executor * play_controller::get_hotkey_command_executor ( )
overridevirtual

Optionally get a command executor to handle context menu events.

Reimplemented from controller_base.

Definition at line 1075 of file play_controller.cpp.

References hotkey_handler_.

Referenced by playsingle_controller::end_turn_enable(), playsingle_controller::init_gui(), and display::redraw_everything().

◆ get_map_const()

const gamemap& play_controller::get_map_const ( ) const
inline

◆ get_menu_handler()

events::menu_handler& play_controller::get_menu_handler ( )
inline

Definition at line 205 of file play_controller.hpp.

Referenced by wb::recruit::execute().

◆ get_mouse_handler_base()

events::mouse_handler & play_controller::get_mouse_handler_base ( )
overridevirtual

◆ get_mp_settings()

const mp_game_settings & play_controller::get_mp_settings ( )

Definition at line 776 of file play_controller.cpp.

References saved_game::mp_settings(), and saved_game_.

◆ get_plugins_context()

plugins_context * play_controller::get_plugins_context ( )
overridevirtual

Get (optionally) a plugins context a derived class uses.

Reimplemented from controller_base.

Definition at line 1070 of file play_controller.cpp.

References plugins_context_.

◆ get_replay()

replay & play_controller::get_replay ( )

Definition at line 849 of file play_controller.cpp.

References replay_.

◆ get_replay_controller()

virtual replay_controller* play_controller::get_replay_controller ( ) const
inlinevirtual

Reimplemented in playsingle_controller.

Definition at line 228 of file play_controller.hpp.

Referenced by events::menu_handler::current_unit().

◆ get_saved_game()

saved_game& play_controller::get_saved_game ( )
inline

Definition at line 290 of file play_controller.hpp.

◆ get_scenario_name()

t_string play_controller::get_scenario_name ( ) const
inline

◆ get_server_request_number()

int play_controller::get_server_request_number ( ) const
inline

Definition at line 210 of file play_controller.hpp.

Referenced by synced_context::server_choice::send_request().

◆ get_soundsource_man()

soundsource::manager * play_controller::get_soundsource_man ( )
overridevirtual

Get (optionally) a soundsources manager a derived class uses.

Reimplemented from controller_base.

Definition at line 1065 of file play_controller.cpp.

References soundsources_manager_.

◆ get_teams_const()

const std::vector<team>& play_controller::get_teams_const ( ) const
inline

◆ get_ticks()

int play_controller::get_ticks ( ) const

Definition at line 1060 of file play_controller.cpp.

References ticks_.

◆ get_tod_manager_const()

const tod_manager& play_controller::get_tod_manager_const ( ) const
inline

◆ get_undo_stack()

actions::undo_list& play_controller::get_undo_stack ( )
inline

◆ get_units_const()

const unit_map& play_controller::get_units_const ( ) const
inline

◆ get_whiteboard()

std::shared_ptr< wb::manager > play_controller::get_whiteboard ( ) const

◆ handle_generic_event()

virtual void play_controller::handle_generic_event ( const std::string &  )
inlineoverridevirtual

Implements events::observer.

Reimplemented in playsingle_controller, and playmp_controller.

Definition at line 85 of file play_controller.hpp.

References wfl::msg().

◆ have_keyboard_focus()

bool play_controller::have_keyboard_focus ( )
overrideprotectedvirtual

Derived classes should override this to return false when arrow keys should not scroll the map, hotkeys not processed etc, for example when a textbox is active.

Returns
true when arrow keys should scroll the map, false otherwise

Reimplemented from controller_base.

Definition at line 791 of file play_controller.cpp.

References gui::floating_textbox::active(), events::menu_handler::get_textbox(), and menu_handler_.

◆ increase_server_request_number()

void play_controller::increase_server_request_number ( )
inline

Definition at line 211 of file play_controller.hpp.

References events::pump().

Referenced by synced_context::ask_server_choice().

◆ init()

void play_controller::init ( const config level)
private

◆ init_gui()

void play_controller::init_gui ( )
protectedvirtual

Reimplemented in playsingle_controller.

Definition at line 401 of file play_controller.cpp.

References gui_.

Referenced by playsingle_controller::init_gui(), and start_game().

◆ init_managers()

void play_controller::init_managers ( )
protected

◆ init_side_begin()

void play_controller::init_side_begin ( )

◆ init_side_end()

void play_controller::init_side_end ( )

◆ is_browsing()

bool play_controller::is_browsing ( ) const
overridevirtual

◆ is_linger_mode()

bool play_controller::is_linger_mode ( ) const
inline

◆ is_lingering()

bool play_controller::is_lingering ( ) const
inline

◆ is_networked_mp()

virtual bool play_controller::is_networked_mp ( ) const
inlinevirtual

◆ is_observer()

bool play_controller::is_observer ( ) const
inline

◆ is_regular_game_end()

bool play_controller::is_regular_game_end ( ) const
inline

◆ is_replay()

bool play_controller::is_replay ( ) const
inline

◆ is_skipping_replay()

bool play_controller::is_skipping_replay ( ) const
inline

◆ is_skipping_story()

bool play_controller::is_skipping_story ( ) const
inline

Definition at line 200 of file play_controller.hpp.

Referenced by playsingle_controller::play_scenario().

◆ is_team_visible()

bool play_controller::is_team_visible ( int  team_num,
bool  observer 
) const
protected

◆ load_game()

void play_controller::load_game ( )

◆ maybe_do_init_side()

void play_controller::maybe_do_init_side ( )

◆ maybe_throw_return_to_play_side()

void play_controller::maybe_throw_return_to_play_side ( ) const
inline

◆ on_not_observer()

virtual void play_controller::on_not_observer ( )
pure virtual

◆ play_side()

void play_controller::play_side ( )

◆ play_side_impl()

virtual void play_controller::play_side_impl ( )
inlinevirtual

Reimplemented in playsingle_controller.

Definition at line 258 of file play_controller.hpp.

Referenced by play_side().

◆ play_slice_catch()

void play_controller::play_slice_catch ( )
protected

◆ play_turn()

void play_controller::play_turn ( )
protected

◆ process_focus_keydown_event()

void play_controller::process_focus_keydown_event ( const SDL_Event &  )
overrideprotectedvirtual

Process keydown (only when the general map display does not have focus).

Reimplemented from controller_base.

Definition at line 796 of file play_controller.cpp.

References gui::floating_textbox::close(), enter_textbox(), events::menu_handler::get_textbox(), gui_, menu_handler_, and tab().

◆ process_keydown_event()

void play_controller::process_keydown_event ( const SDL_Event &  )
overrideprotectedvirtual

Process keydown (always).

Overridden in derived classes

Reimplemented from controller_base.

Definition at line 807 of file play_controller.cpp.

References whiteboard_manager_.

◆ process_keyup_event()

void play_controller::process_keyup_event ( const SDL_Event &  )
overrideprotectedvirtual

◆ process_oos()

void play_controller::process_oos ( const std::string &  msg) const
virtual

Asks the user whether to continue on an OOS error.

Exceptions
quit_game_exceptionIf the user wants to abort.

Reimplemented in playmp_controller.

Definition at line 1012 of file play_controller.cpp.

References _(), gui_, game_config::ignore_replay_errors, ignore_replay_errors_, wfl::msg(), save(), savegame::savegame::save_game_interactive(), saved_game_, and savegame::savegame::YES_NO.

Referenced by replay::process_error().

◆ pump()

game_events::wml_event_pump & play_controller::pump ( )

◆ receive_from_wesnothd()

virtual bool play_controller::receive_from_wesnothd ( config ) const
inlinevirtual

Reimplemented in playmp_controller.

Definition at line 278 of file play_controller.hpp.

Referenced by playsingle_controller::playsingle_controller().

◆ redo()

void play_controller::redo ( )

◆ refresh_objectives()

void play_controller::refresh_objectives ( ) const

Reevaluate [show_if] conditions and build a new objectives string.

Definition at line 372 of file play_controller.cpp.

References gamestate(), gui_, and game_state::lua_kernel_.

Referenced by fire_start(), and events::menu_handler::objectives().

◆ reset_end_level_data()

void play_controller::reset_end_level_data ( )
inline

Definition at line 131 of file play_controller.hpp.

◆ reset_gamestate()

void play_controller::reset_gamestate ( const config level,
int  replay_pos 
)
protected

◆ save_game()

void play_controller::save_game ( )

◆ save_game_auto()

void play_controller::save_game_auto ( const std::string &  filename)

◆ save_map()

void play_controller::save_map ( )

◆ save_replay()

void play_controller::save_replay ( )

◆ save_replay_auto()

void play_controller::save_replay_auto ( const std::string &  filename)

◆ select_music()

const std::string & play_controller::select_music ( bool  victory) const
protected

◆ send_to_wesnothd()

virtual void play_controller::send_to_wesnothd ( const config ,
const std::string &  = "unknown" 
) const
inlinevirtual

◆ set_do_healing()

void play_controller::set_do_healing ( bool  do_healing)
inline

Definition at line 163 of file play_controller.hpp.

Referenced by do_init_side().

◆ set_end_level_data()

void play_controller::set_end_level_data ( const end_level_data data)
inline

◆ should_return_to_play_side()

virtual bool play_controller::should_return_to_play_side ( ) const
inlinevirtual

Reimplemented in playsingle_controller.

Definition at line 246 of file play_controller.hpp.

Referenced by play_slice_catch().

◆ show_objectives()

void play_controller::show_objectives ( ) const

◆ start_game()

void play_controller::start_game ( )
protected

◆ sync_end_turn()

virtual void play_controller::sync_end_turn ( )
inlineprotectedvirtual

Reimplemented in playsingle_controller.

Definition at line 383 of file play_controller.hpp.

Referenced by play_side().

◆ tab()

void play_controller::tab ( )
protected

◆ theme()

std::string play_controller::theme ( ) const
inline

Definition at line 241 of file play_controller.hpp.

Referenced by replay_controller::add_replay_theme(), and init().

◆ ticks()

int play_controller::ticks ( ) const
inline

◆ to_config()

config play_controller::to_config ( ) const

◆ toggle_skipping_replay()

void play_controller::toggle_skipping_replay ( )

◆ turn()

std::size_t play_controller::turn ( ) const
inline

◆ undo()

void play_controller::undo ( )

◆ undo_stack() [1/2]

actions::undo_list& play_controller::undo_stack ( )
inlineprotected

◆ undo_stack() [2/2]

const actions::undo_list& play_controller::undo_stack ( ) const
inlineprotected

Definition at line 352 of file play_controller.hpp.

◆ update_gui_to_player()

void play_controller::update_gui_to_player ( const int  team_index,
const bool  observe = false 
)

Changes the UI for this client to the passed side index.

Definition at line 1028 of file play_controller.cpp.

References gui_.

Referenced by init_side_begin(), playmp_controller::linger(), replay_controller::update_viewing_player(), and playsingle_controller::update_viewing_player().

◆ update_savegame_snapshot()

void play_controller::update_savegame_snapshot ( ) const

◆ update_viewing_player()

virtual void play_controller::update_viewing_player ( )
protectedpure virtual

Implemented in playsingle_controller.

Referenced by play_side().

Friends And Related Function Documentation

◆ scoped_savegame_snapshot

friend struct scoped_savegame_snapshot
friend

Definition at line 293 of file play_controller.hpp.

Member Data Documentation

◆ defeat_music_

std::vector<std::string> play_controller::defeat_music_
private

Definition at line 376 of file play_controller.hpp.

◆ gamestate_

std::unique_ptr<game_state> play_controller::gamestate_
protected

◆ gui_

std::unique_ptr<game_display> play_controller::gui_
protected

◆ help_manager_

help::help_manager play_controller::help_manager_
protected

Definition at line 340 of file play_controller.hpp.

◆ hotkey_handler_

std::unique_ptr<hotkey_handler> play_controller::hotkey_handler_
protected

◆ ignore_replay_errors_

bool play_controller::ignore_replay_errors_
mutableprotected

Definition at line 381 of file play_controller.hpp.

Referenced by playmp_controller::process_oos(), and process_oos().

◆ init_side_done_now_

bool play_controller::init_side_done_now_
protected

Whether we did init sides in this session (false = we did init sides before we reloaded the game).

Definition at line 362 of file play_controller.hpp.

Referenced by playsingle_controller::before_human_turn(), do_init_side(), init_side_end(), and playsingle_controller::play_side_impl().

◆ labels_manager_

font::floating_label_context play_controller::labels_manager_
protected

Definition at line 339 of file play_controller.hpp.

◆ level_

config play_controller::level_
protected

Definition at line 326 of file play_controller.hpp.

Referenced by play_controller(), and to_config().

◆ linger_

bool play_controller::linger_
protected

◆ map_start_

map_location play_controller::map_start_
protected

◆ menu_handler_

events::menu_handler play_controller::menu_handler_
protected

◆ mouse_handler_

events::mouse_handler play_controller::mouse_handler_
protected

◆ persist_

persist_manager play_controller::persist_
protected

Definition at line 345 of file play_controller.hpp.

Referenced by play_controller(), and playsingle_controller::play_scenario().

◆ player_type_changed_

bool play_controller::player_type_changed_
protected

◆ plugins_context_

std::unique_ptr<plugins_context> play_controller::plugins_context_
protected

◆ remove_from_carryover_on_defeat_

bool play_controller::remove_from_carryover_on_defeat_
private

Definition at line 374 of file play_controller.hpp.

Referenced by check_victory().

◆ replay_

std::unique_ptr<replay> play_controller::replay_
protected

Definition at line 353 of file play_controller.hpp.

Referenced by get_replay(), and play_controller().

◆ saved_game_

saved_game& play_controller::saved_game_
protected

◆ scope_

hotkey::scope_changer play_controller::scope_
private

Definition at line 378 of file play_controller.hpp.

◆ skip_replay_

bool play_controller::skip_replay_
protected

◆ skip_story_

bool play_controller::skip_story_
protected

Definition at line 356 of file play_controller.hpp.

Referenced by fire_start().

◆ soundsources_manager_

std::unique_ptr<soundsource::manager> play_controller::soundsources_manager_
protected

◆ statistics_context_

const std::unique_ptr<const statistics::scenario_context> play_controller::statistics_context_
protected

Definition at line 350 of file play_controller.hpp.

◆ tdata_

const ter_data_cache& play_controller::tdata_
protected

Definition at line 324 of file play_controller.hpp.

Referenced by init(), and reset_gamestate().

◆ ticks_

const int play_controller::ticks_
private

Definition at line 320 of file play_controller.hpp.

Referenced by get_ticks().

◆ tooltips_manager_

std::unique_ptr<tooltips::manager> play_controller::tooltips_manager_
protected

Definition at line 330 of file play_controller.hpp.

Referenced by init_managers().

◆ victory_music_

std::vector<std::string> play_controller::victory_music_
private

Definition at line 375 of file play_controller.hpp.

◆ victory_when_enemies_defeated_

bool play_controller::victory_when_enemies_defeated_
private

Definition at line 373 of file play_controller.hpp.

Referenced by check_victory().

◆ whiteboard_manager_

std::shared_ptr<wb::manager> play_controller::whiteboard_manager_
protected

◆ xp_mod_

const std::unique_ptr<unit_experience_accelerator> play_controller::xp_mod_
protected

Definition at line 349 of file play_controller.hpp.


The documentation for this class was generated from the following files: