The Battle for Wesnoth  1.17.21+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:


class  hotkey_handler
struct  scoped_savegame_snapshot

Public Member Functions

 play_controller (const config &level, saved_game &state_of_game, bool skip_replay, bool start_faded=false)
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
bool check_regular_game_end ()
const end_level_dataget_end_level_data () const
std::vector< team > & get_teams ()
const std::vector< team > & get_teams () const
const unit_mapget_units () const
unit_mapget_units ()
const gamemapget_map () const
const tod_managerget_tod_manager () 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 ()
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
virtual replay_controllerget_replay_controller () const
bool is_replay () const
t_string get_scenario_name () const
bool get_disallow_recall () const
std::string get_loaded_resources () 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 ()
statistics_tstatistics ()
bool is_during_turn () const
bool is_linger_mode () const
int find_viewing_side () const
 returns 0 if no such team was found. More...
- 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 handle_window_event (const SDL_Event &)
virtual void process_event ()
virtual bool requires_event_focus (const SDL_Event *=nullptr) const
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_events ()
void finish_turn ()
bool enemies_visible () const
void enter_textbox ()
void textbox_move_vertically (bool up)
void tab ()
bool is_team_visible (int team_num, bool observer) const
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
- 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...
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 (const hotkey::ui_command &cmd) const
void long_touch_callback (int x, int y)
- 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

std::unique_ptr< game_stategamestate_
config level_
tooltips::manager tooltips_manager_
std::shared_ptr< wb::managerwhiteboard_manager_
std::unique_ptr< plugins_contextplugins_context_
std::unique_ptr< font::floating_label_contextlabels_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< statistics_tstatistics_context_
std::unique_ptr< replayreplay_
bool skip_replay_
bool skip_story_
bool did_autosave_this_turn_
 Whether we did init sides in this session (false = we did init sides before we reloaded the game). More...
bool did_tod_sound_this_turn_
map_location map_start_
bool start_faded_
bool ignore_replay_errors_
bool player_type_changed_
 true when the controller of the currently playing side has changed. More...
- Protected Attributes inherited from controller_base
const game_config_viewgame_config_
CKey key_
bool scrolling_
bool scroll_up_
bool scroll_down_
bool scroll_left_
bool scroll_right_
uint32_t last_scroll_tick_
double scroll_carry_x_
double scroll_carry_y_

Private Member Functions

void init (const config &level)
void check_next_scenario_is_known ()
 This shows a warning dialog if either [scenario]next_scenario or any [endlevel]next_scenario would lead to an "Unknown Scenario" dialog. More...

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_
const hotkey::scope_changer scope_


struct scoped_savegame_snapshot

Additional Inherited Members

- 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 78 of file play_controller.hpp.

Constructor & Destructor Documentation

◆ play_controller()

play_controller::play_controller ( const config level,
saved_game state_of_game,
bool  skip_replay,
bool  start_faded = false 

◆ ~play_controller()

play_controller::~play_controller ( )

Member Function Documentation

◆ all_players()

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

Definition at line 1263 of file play_controller.cpp.

References get_teams(), gui_, and t.

Referenced by campaign_controller::playmp_scenario().

◆ 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_next_scenario_is_known()

void play_controller::check_next_scenario_is_known ( )

◆ check_objectives()

virtual void play_controller::check_objectives ( )
pure virtual

Implemented in playsingle_controller.

Referenced by fire_start().

◆ check_regular_game_end()

bool play_controller::check_regular_game_end ( )

◆ check_time_over()

void play_controller::check_time_over ( )

◆ check_victory()

void play_controller::check_victory ( )

◆ current_side()

int play_controller::current_side ( ) const

◆ 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

Definition at line 189 of file play_controller.hpp.

References game_state::do_healing_, and gamestate().

Referenced by do_init_side(), and set_do_healing().

◆ do_init_side()

void play_controller::do_init_side ( )

◆ enemies_visible()

bool play_controller::enemies_visible ( ) const

Definition at line 602 of file play_controller.cpp.

References current_team(), get_units(), and gui_.

◆ enter_textbox()

void play_controller::enter_textbox ( )

◆ find_viewing_side()

int play_controller::find_viewing_side ( ) const

◆ finish_side_turn_events()

void play_controller::finish_side_turn_events ( )

◆ finish_turn()

void play_controller::finish_turn ( )

◆ fire_preload()

void play_controller::fire_preload ( )

◆ fire_prestart()

void play_controller::fire_prestart ( )

◆ fire_start()

void play_controller::fire_start ( )

◆ force_end_turn()

virtual void play_controller::force_end_turn ( )
pure virtual

◆ gamestate() [1/2]

game_state& play_controller::gamestate ( )

Definition at line 199 of file play_controller.hpp.

References gamestate_.

Referenced by playsingle_controller::before_human_turn(), playsingle_controller::hotkey_handler::can_execute_command(), playmp_controller::hotkey_handler::can_execute_command(), check_next_scenario_is_known(), check_time_over(), check_victory(), current_team(), playsingle_controller::do_end_level(), play_controller::hotkey_handler::do_execute_command(), do_healing(), do_init_side(), do_replay_handle(), play_controller::hotkey_handler::expand_wml_commands(), events::mouse_handler::find_unit(), events::mouse_handler::find_unit_nonowning(), playsingle_controller::finish_side_turn(), finish_side_turn_events(), fire_preload(), fire_prestart(), fire_start(), playsingle_controller::force_end_turn(), events::menu_handler::gamestate(), get_end_level_data(), get_map(), events::mouse_handler::get_route(), get_server_request_number(), get_teams(), get_tod_manager(), get_units(), game_lua_kernel::impl_game_config_get(), game_lua_kernel::impl_game_config_set(), play_controller::hotkey_handler::in_context_menu(), increase_server_request_number(), init(), init_side_begin(), init_side_end(), game_lua_kernel::intf_end_turn(), is_browsing(), is_during_turn(), is_linger_mode(), is_observer(), is_regular_game_end(), is_team_visible(), playmp_controller::linger(), playsingle_controller::linger(), playmp_controller::maybe_linger(), events::mouse_handler::mouse_motion(), playmp_controller::play_human_turn(), playmp_controller::play_linger_turn(), playmp_controller::play_network_turn(), playsingle_controller::play_scenario_init(), playsingle_controller::play_scenario_main_loop(), play_side(), replay_controller::play_side_impl(), playsingle_controller::play_side_impl(), playsingle_controller::play_some(), playmp_controller::process_network_data(), pump(), refresh_objectives(), replay_controller::replay_next_turn(), reset_end_level_data(), reset_gamestate(), save_game(), events::mouse_handler::select_or_action(), set_do_healing(), set_end_level_data(), playsingle_controller::should_return_to_play_side(), events::mouse_handler::show_attack_dialog(), playsingle_controller::show_turn_dialog(), playsingle_controller::skip_empty_sides(), start_game(), playsingle_controller::sync_end_turn(), to_config(), events::mouse_handler::touch_motion(), turn(), undo_stack(), and events::mouse_handler::unit_in_cycle().

◆ gamestate() [2/2]

const game_state& play_controller::gamestate ( ) const

Definition at line 204 of file play_controller.hpp.

References gamestate_.

◆ get_classification()

game_classification & play_controller::get_classification ( )

◆ get_disallow_recall()

bool play_controller::get_disallow_recall ( ) const

Definition at line 269 of file play_controller.hpp.

References level_.

◆ get_display()

game_display & play_controller::get_display ( )

◆ get_end_level_data()

const end_level_data& play_controller::get_end_level_data ( ) const

◆ get_hotkey_command_executor()

hotkey::command_executor * play_controller::get_hotkey_command_executor ( )

Optionally get a command executor to handle context menu events.

Reimplemented from controller_base.

Definition at line 1101 of file play_controller.cpp.

References hotkey_handler_.

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

◆ get_loaded_resources()

std::string play_controller::get_loaded_resources ( ) const

◆ get_map()

const gamemap& play_controller::get_map ( ) const

◆ get_menu_handler()

events::menu_handler& play_controller::get_menu_handler ( )

Definition at line 239 of file play_controller.hpp.

References menu_handler_.

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

◆ get_mouse_handler_base()

events::mouse_handler & play_controller::get_mouse_handler_base ( )

◆ get_mp_settings()

const mp_game_settings & play_controller::get_mp_settings ( )

Definition at line 806 of file play_controller.cpp.

References saved_game::mp_settings(), and saved_game_.

Referenced by game_lua_kernel::impl_game_config_get().

◆ get_plugins_context()

plugins_context * play_controller::get_plugins_context ( )

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

Reimplemented from controller_base.

Definition at line 1096 of file play_controller.cpp.

References plugins_context_.

◆ get_replay()

replay & play_controller::get_replay ( )

Definition at line 880 of file play_controller.cpp.

References replay_.

Referenced by game_lua_kernel::intf_log_replay().

◆ get_replay_controller()

virtual replay_controller* play_controller::get_replay_controller ( ) const

Reimplemented in playsingle_controller.

Definition at line 261 of file play_controller.hpp.

Referenced by is_replay().

◆ get_saved_game()

saved_game& play_controller::get_saved_game ( )

Definition at line 323 of file play_controller.hpp.

References saved_game_.

Referenced by playsingle_controller::play_scenario_main_loop().

◆ get_scenario_name()

t_string play_controller::get_scenario_name ( ) const

◆ get_server_request_number()

int play_controller::get_server_request_number ( ) const

◆ get_soundsource_man()

soundsource::manager * play_controller::get_soundsource_man ( )

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

Reimplemented from controller_base.

Definition at line 1091 of file play_controller.cpp.

References soundsources_manager_.

◆ get_teams() [1/2]

std::vector<team>& play_controller::get_teams ( )

◆ get_teams() [2/2]

const std::vector<team>& play_controller::get_teams ( ) const

Definition at line 159 of file play_controller.hpp.

References game_state::board_, gamestate(), and game_board::teams().

◆ get_ticks()

int play_controller::get_ticks ( ) const

Definition at line 1086 of file play_controller.cpp.

References ticks_.

Referenced by campaign_controller::playsingle_scenario().

◆ get_tod_manager()

const tod_manager& play_controller::get_tod_manager ( ) const

Definition at line 179 of file play_controller.hpp.

References gamestate(), and game_state::tod_manager_.

Referenced by events::mouse_handler::attack_enemy_().

◆ get_undo_stack()

actions::undo_list& play_controller::get_undo_stack ( )

Definition at line 255 of file play_controller.hpp.

References undo_stack().

Referenced by events::mouse_handler::move_unit_along_route().

◆ get_units() [1/2]

unit_map& play_controller::get_units ( )

Definition at line 169 of file play_controller.hpp.

References game_state::board_, gamestate(), and game_board::units().

◆ get_units() [2/2]

const unit_map& play_controller::get_units ( ) const

◆ 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 &  )

Implements events::observer.

Reimplemented in playsingle_controller, and playmp_controller.

Definition at line 89 of file play_controller.hpp.

◆ have_keyboard_focus()

bool play_controller::have_keyboard_focus ( )

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.

true when arrow keys should scroll the map, false otherwise

Reimplemented from controller_base.

Definition at line 821 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 ( )

◆ init()

void play_controller::init ( const config level)

◆ init_gui()

void play_controller::init_gui ( )

Reimplemented in playsingle_controller.

Definition at line 405 of file play_controller.cpp.

References gui_.

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

◆ init_managers()

void play_controller::init_managers ( )

Definition at line 341 of file play_controller.cpp.

References gui_, LOG_NG, resources::soundsources, soundsources_manager_, and ticks().

Referenced by init().

◆ 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

◆ is_during_turn()

bool play_controller::is_during_turn ( ) const

◆ is_linger_mode()

bool play_controller::is_linger_mode ( ) const

◆ is_networked_mp()

virtual bool play_controller::is_networked_mp ( ) const

◆ is_observer()

bool play_controller::is_observer ( ) const

◆ is_regular_game_end()

bool play_controller::is_regular_game_end ( ) const

◆ is_replay()

bool play_controller::is_replay ( ) const

◆ is_skipping_replay()

bool play_controller::is_skipping_replay ( ) const

◆ is_skipping_story()

bool play_controller::is_skipping_story ( ) const

◆ is_team_visible()

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

◆ load_game()

void play_controller::load_game ( )

◆ maybe_do_init_side()

void play_controller::maybe_do_init_side ( )

Called by turn_info::process_network_data() or init_side() to call do_init_side() if necessary.

Definition at line 421 of file play_controller.cpp.

References current_team(), do_init_side(), replay::init_side(), is_during_turn(), is_replay(), and resources::recorder.

Referenced by play_side().

◆ maybe_throw_return_to_play_side()

void play_controller::maybe_throw_return_to_play_side ( ) const

◆ 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 ( )

Reimplemented in playsingle_controller.

Definition at line 291 of file play_controller.hpp.

Referenced by play_side().

◆ play_slice_catch()

void play_controller::play_slice_catch ( )

◆ process_focus_keydown_event()

void play_controller::process_focus_keydown_event ( const SDL_Event &  )

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

Reimplemented from controller_base.

Definition at line 826 of file play_controller.cpp.

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

◆ process_keydown_event()

void play_controller::process_keydown_event ( const SDL_Event &  )

Process keydown (always).

Overridden in derived classes

Reimplemented from controller_base.

Definition at line 841 of file play_controller.cpp.

References whiteboard_manager_.

◆ process_keyup_event()

void play_controller::process_keyup_event ( const SDL_Event &  )

◆ process_oos()

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

Asks the user whether to continue on an OOS error.

quit_game_exceptionIf the user wants to abort.

Reimplemented in playmp_controller.

Definition at line 1035 of file play_controller.cpp.

References _(), video::headless(), game_config::ignore_replay_errors, ignore_replay_errors_, wfl::msg(), 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

Reimplemented in playmp_controller.

Definition at line 311 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 376 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 ( )

Definition at line 137 of file play_controller.hpp.

References game_state::end_level_data_, and gamestate().

◆ reset_gamestate()

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

◆ 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 ( )

Definition at line 916 of file play_controller.cpp.

References menu_handler_, and events::menu_handler::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

◆ send_to_wesnothd()

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

◆ set_do_healing()

void play_controller::set_do_healing ( bool  do_healing)

Definition at line 194 of file play_controller.hpp.

References do_healing(), game_state::do_healing_, and gamestate().

Referenced by do_init_side().

◆ set_end_level_data()

void play_controller::set_end_level_data ( const end_level_data data)

◆ should_return_to_play_side()

virtual bool play_controller::should_return_to_play_side ( ) const

Reimplemented in playsingle_controller.

Definition at line 284 of file play_controller.hpp.

References is_regular_game_end().

Referenced by maybe_throw_return_to_play_side(), and play_slice_catch().

◆ show_objectives()

void play_controller::show_objectives ( ) const

◆ start_game()

void play_controller::start_game ( )

◆ statistics()

statistics_t& play_controller::statistics ( )

◆ sync_end_turn()

virtual void play_controller::sync_end_turn ( )

Reimplemented in playsingle_controller.

Definition at line 435 of file play_controller.hpp.

Referenced by play_side().

◆ tab()

void play_controller::tab ( )

◆ textbox_move_vertically()

void play_controller::textbox_move_vertically ( bool  up)

◆ theme()

std::string play_controller::theme ( ) const

Definition at line 279 of file play_controller.hpp.

References gamestate_.

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

◆ ticks()

int play_controller::ticks ( ) const

◆ 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

◆ undo()

void play_controller::undo ( )

◆ undo_stack() [1/2]

actions::undo_list& play_controller::undo_stack ( )

◆ undo_stack() [2/2]

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

Definition at line 390 of file play_controller.hpp.

References gamestate(), and game_state::undo_stack_.

◆ 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 1054 of file play_controller.cpp.

References gui_.

Referenced by 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 init_side_begin(), and play_side().

Friends And Related Function Documentation

◆ scoped_savegame_snapshot

friend struct scoped_savegame_snapshot

Definition at line 330 of file play_controller.hpp.

Member Data Documentation

◆ defeat_music_

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

Definition at line 422 of file play_controller.hpp.

◆ did_autosave_this_turn_

bool play_controller::did_autosave_this_turn_

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

Definition at line 399 of file play_controller.hpp.

Referenced by playsingle_controller::before_human_turn(), playsingle_controller::finish_side_turn(), and start_game().

◆ did_tod_sound_this_turn_

bool play_controller::did_tod_sound_this_turn_

Definition at line 400 of file play_controller.hpp.

Referenced by playsingle_controller::finish_side_turn(), and init_side_end().

◆ gamestate_

std::unique_ptr<game_state> play_controller::gamestate_

◆ gui_

std::unique_ptr<game_display> play_controller::gui_

◆ help_manager_

help::help_manager play_controller::help_manager_

Definition at line 378 of file play_controller.hpp.

◆ hotkey_handler_

std::unique_ptr<hotkey_handler> play_controller::hotkey_handler_

◆ ignore_replay_errors_

bool play_controller::ignore_replay_errors_

Definition at line 427 of file play_controller.hpp.

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

◆ labels_manager_

std::unique_ptr<font::floating_label_context> play_controller::labels_manager_

Definition at line 377 of file play_controller.hpp.

◆ level_

config play_controller::level_

◆ map_start_

map_location play_controller::map_start_

Definition at line 402 of file play_controller.hpp.

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

◆ menu_handler_

events::menu_handler play_controller::menu_handler_

Definition at line 380 of file play_controller.hpp.

Referenced by playsingle_controller::hotkey_handler::ai_formula(), playsingle_controller::hotkey_handler::can_execute_command(), play_controller::hotkey_handler::can_execute_command(), playsingle_controller::hotkey_handler::change_side(), playsingle_controller::hotkey_handler::clear_labels(), playsingle_controller::hotkey_handler::clear_messages(), playsingle_controller::hotkey_handler::continue_move(), playsingle_controller::hotkey_handler::create_unit(), playsingle_controller::hotkey_handler::custom_command(), playsingle_controller::end_turn(), playsingle_controller::hotkey_handler::end_unit_turn(), enter_textbox(), playsingle_controller::execute_gotos(), get_menu_handler(), play_controller::hotkey_handler::goto_leader(), have_keyboard_focus(), init(), playsingle_controller::hotkey_handler::kill_unit(), playsingle_controller::hotkey_handler::label_settings(), playsingle_controller::hotkey_handler::label_terrain(), play_controller::hotkey_handler::objectives(), play_controller::hotkey_handler::preferences(), process_focus_keydown_event(), playsingle_controller::hotkey_handler::recall(), playsingle_controller::hotkey_handler::recruit(), playsingle_controller::hotkey_handler::rename_unit(), playsingle_controller::hotkey_handler::repeat_recruit(), save_map(), play_controller::hotkey_handler::search(), playmp_controller::hotkey_handler::shout(), play_controller::hotkey_handler::show_chat_log(), play_controller::hotkey_handler::show_enemy_moves(), play_controller::hotkey_handler::show_help(), play_controller::hotkey_handler::show_statistics(), play_controller::hotkey_handler::speak(), play_controller::hotkey_handler::status_table(), tab(), play_controller::hotkey_handler::terrain_description(), textbox_move_vertically(), play_controller::hotkey_handler::toggle_ellipses(), play_controller::hotkey_handler::toggle_grid(), playsingle_controller::hotkey_handler::toggle_shroud_updates(), play_controller::hotkey_handler::unit_description(), playsingle_controller::hotkey_handler::unit_hold_position(), play_controller::hotkey_handler::unit_list(), playsingle_controller::hotkey_handler::update_shroud_now(), playsingle_controller::hotkey_handler::user_command(), playmp_controller::hotkey_handler::whisper(), and playsingle_controller::hotkey_handler::whiteboard_suppose_dead().

◆ mouse_handler_

events::mouse_handler play_controller::mouse_handler_

Definition at line 379 of file play_controller.hpp.

Referenced by playsingle_controller::hotkey_handler::can_execute_command(), play_controller::hotkey_handler::can_execute_command(), playsingle_controller::hotkey_handler::change_side(), playsingle_controller::hotkey_handler::continue_move(), playsingle_controller::hotkey_handler::create_unit(), play_controller::hotkey_handler::cycle_back_units(), play_controller::hotkey_handler::cycle_units(), play_controller::hotkey_handler::deselect_hex(), play_controller::hotkey_handler::do_execute_command(), playsingle_controller::hotkey_handler::end_unit_turn(), enter_textbox(), playsingle_controller::execute_gotos(), play_controller::hotkey_handler::expand_wml_commands(), finish_side_turn_events(), get_mouse_handler_base(), play_controller::hotkey_handler::in_context_menu(), init(), init_side_begin(), playsingle_controller::hotkey_handler::kill_unit(), playsingle_controller::hotkey_handler::label_terrain(), play_controller::hotkey_handler::left_mouse_click(), play_controller::hotkey_handler::move_action(), process_keyup_event(), playsingle_controller::hotkey_handler::recall(), playsingle_controller::hotkey_handler::recruit(), redo(), playsingle_controller::hotkey_handler::repeat_recruit(), play_controller::hotkey_handler::right_mouse_click(), play_controller::hotkey_handler::select_and_action(), play_controller::hotkey_handler::select_hex(), play_controller::hotkey_handler::terrain_description(), play_controller::hotkey_handler::touch_hex(), undo(), and playsingle_controller::hotkey_handler::unit_hold_position().

◆ persist_

persist_manager play_controller::persist_

Definition at line 383 of file play_controller.hpp.

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

◆ player_type_changed_

bool play_controller::player_type_changed_

true when the controller of the currently playing side has changed.

this can mean for example:

  • The currently active side was reassigned from/to another player in a mp game
  • The replay controller was disabled ('continue play' button)
  • The currently active side was droided / undroided.
  • A side was set to idle.

Definition at line 434 of file play_controller.hpp.

Referenced by playsingle_controller::get_player_type_changed(), playsingle_controller::linger(), playsingle_controller::play_ai_turn(), playmp_controller::play_human_turn(), playmp_controller::play_network_turn(), play_side(), playsingle_controller::play_side_impl(), playmp_controller::process_network_data(), playmp_controller::pull_remote_choice(), playsingle_controller::set_player_type_changed(), and playsingle_controller::should_return_to_play_side().

◆ plugins_context_

std::unique_ptr<plugins_context> play_controller::plugins_context_

Definition at line 374 of file play_controller.hpp.

Referenced by get_plugins_context(), and init().

◆ remove_from_carryover_on_defeat_

bool play_controller::remove_from_carryover_on_defeat_

Definition at line 420 of file play_controller.hpp.

Referenced by check_victory().

◆ replay_

std::unique_ptr<replay> play_controller::replay_

Definition at line 391 of file play_controller.hpp.

Referenced by get_replay(), and play_controller().

◆ saved_game_

saved_game& play_controller::saved_game_

◆ scope_

const hotkey::scope_changer play_controller::scope_

Definition at line 424 of file play_controller.hpp.

◆ skip_replay_

bool play_controller::skip_replay_

◆ skip_story_

bool play_controller::skip_story_

Definition at line 394 of file play_controller.hpp.

Referenced by fire_start(), and is_skipping_story().

◆ soundsources_manager_

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

◆ start_faded_

bool play_controller::start_faded_

Definition at line 404 of file play_controller.hpp.

Referenced by init().

◆ statistics_context_

const std::unique_ptr<statistics_t> play_controller::statistics_context_

Definition at line 388 of file play_controller.hpp.

Referenced by statistics().

◆ ticks_

const int play_controller::ticks_

Definition at line 359 of file play_controller.hpp.

Referenced by get_ticks(), and ticks().

◆ tooltips_manager_

tooltips::manager play_controller::tooltips_manager_

Definition at line 368 of file play_controller.hpp.

◆ victory_music_

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

Definition at line 421 of file play_controller.hpp.

◆ victory_when_enemies_defeated_

bool play_controller::victory_when_enemies_defeated_

Definition at line 419 of file play_controller.hpp.

Referenced by check_victory().

◆ whiteboard_manager_

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

◆ xp_mod_

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

Definition at line 387 of file play_controller.hpp.

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