#include <playsingle_controller.hpp>
Classes | |
class | hotkey_handler |
struct | ses_result |
Public Member Functions | |
playsingle_controller (const config &level, saved_game &state_of_game) | |
~playsingle_controller () | |
Defined here to reduce file includes. More... | |
level_result::type | play_scenario (const config &level) |
void | play_scenario_init (const config &level) |
ses_result | skip_empty_sides (int side_num) |
Calculates the current side, starting at side_num that is non-empty. More... | |
void | play_some () |
void | play_side () |
void | finish_side_turn () |
void | do_end_level () |
void | play_scenario_main_loop () |
virtual void | handle_generic_event (const std::string &name) override |
virtual void | check_objectives () override |
virtual void | on_not_observer () override |
virtual bool | is_host () const |
virtual void | maybe_linger () |
void | end_turn () |
void | force_end_turn () override |
void | require_end_turn () |
std::string | describe_result () const |
bool | get_player_type_changed () const |
void | set_player_type_changed () |
virtual bool | should_return_to_play_side () const override |
replay_controller * | get_replay_controller () const override |
void | enable_replay (bool is_unit_test=false) |
void | on_replay_end (bool is_unit_test) |
Public Member Functions inherited from play_controller | |
play_controller (const config &level, saved_game &state_of_game) | |
virtual | ~play_controller () |
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 () |
replay & | get_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 | process_oos (const std::string &msg) const |
Asks the user whether to continue on an OOS error. More... | |
bool | reveal_map_default () const |
void | set_end_level_data (const end_level_data &data) |
void | reset_end_level_data () |
bool | is_regular_game_end () const |
const end_level_data & | get_end_level_data () const |
std::vector< team > & | get_teams () |
const std::vector< team > & | get_teams () const |
const unit_map & | get_units () const |
unit_map & | get_units () |
const gamemap & | get_map () const |
const tod_manager & | get_tod_manager () const |
bool | is_observer () const |
bool | do_healing () const |
void | set_do_healing (bool do_healing) |
game_state & | gamestate () |
const game_state & | gamestate () 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 |
bool | is_skipping_actions () const |
void | toggle_skipping_replay () |
void | do_autosave () |
bool | is_skipping_story () const |
void | do_consolesave (const std::string &filename) |
events::mouse_handler & | get_mouse_handler_base () override |
Get a reference to a mouse handler member a derived class uses. More... | |
events::menu_handler & | get_menu_handler () |
std::shared_ptr< wb::manager > | get_whiteboard () const |
const mp_game_settings & | get_mp_settings () |
game_classification & | get_classification () |
int | get_server_request_number () const |
void | increase_server_request_number () |
game_events::wml_event_pump & | pump () |
virtual soundsource::manager * | get_soundsource_man () override |
Get (optionally) a soundsources manager a derived class uses. More... | |
virtual plugins_context * | get_plugins_context () override |
Get (optionally) a plugins context a derived class uses. More... | |
hotkey::command_executor * | get_hotkey_command_executor () override |
Optionally get a command executor to handle context menu events. More... | |
actions::undo_list & | get_undo_stack () |
bool | is_browsing () const override |
bool | is_replay () const |
replay & | recorder () const |
t_string | get_scenario_name () const |
bool | get_disallow_recall () const |
std::string | get_loaded_resources () const |
std::string | theme () const |
void | maybe_throw_return_to_play_side () const |
team & | current_team () |
const team & | current_team () const |
bool | can_use_synced_wml_menu () const |
std::set< std::string > | all_players () const |
const auto & | timer () const |
game_display & | get_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 void | send_actions () |
Sends replay [command]s to the server. More... | |
virtual void | receive_actions () |
Reads and executes replay [command]s from the server. 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_game & | get_saved_game () |
statistics_t & | statistics () |
bool | is_during_turn () const |
bool | is_linger_mode () const |
Public Member Functions inherited from controller_base | |
controller_base () | |
virtual | ~controller_base () |
virtual void | play_slice () |
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_handler & | operator= (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_side_impl () |
void | before_human_turn () |
void | show_turn_dialog () |
void | execute_gotos () |
virtual void | play_human_turn () |
virtual void | after_human_turn () |
void | end_turn_enable (bool enable) |
void | play_ai_turn () |
virtual void | play_idle_loop () |
virtual void | do_idle_notification () |
Will handle sending a networked notification in descendent classes. More... | |
virtual void | play_network_turn () |
Will handle networked turns in descendent classes. More... | |
virtual void | init_gui () override |
void | linger () |
void | update_gui_linger () |
void | sync_end_turn () override |
bool | is_team_visible (int team_num, bool observer) const |
int | find_viewing_side () const override |
returns 0 if no such team was found. More... | |
void | update_viewing_player () override |
void | reset_replay () |
Protected Member Functions inherited from play_controller | |
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 () |
void | finish_side_turn_events () |
void | finish_turn () |
bool | enemies_visible () const |
void | enter_textbox () |
void | textbox_move_vertically (bool up) |
void | tab () |
actions::undo_list & | undo_stack () |
const actions::undo_list & | undo_stack () const |
const std::string & | select_music (bool victory) const |
void | reset_gamestate (const config &level, int replay_pos) |
virtual void | check_time_over () |
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 () 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_handler & | operator= (const sdl_handler &) |
virtual | ~sdl_handler () |
virtual std::vector< sdl_handler * > | handler_members () |
Protected Attributes | |
const cursor::setter | cursor_setter_ |
bool | end_turn_requested_ |
true iff the user has pressed the end turn button this turn. More... | |
bool | ai_fallback_ |
true when the current side is actually an ai side but was taken over by a human (usually for debugging purposes), we need this variable to remember to give the ai control back next turn. More... | |
std::unique_ptr< replay_controller > | replay_controller_ |
non-null when replay mode in active, is used in singleplayer and for the "back to turn" feature in multiplayer. More... | |
Protected Attributes inherited from play_controller | |
std::unique_ptr< game_state > | gamestate_ |
config | level_ |
saved_game & | saved_game_ |
tooltips::manager | tooltips_manager_ |
std::shared_ptr< wb::manager > | whiteboard_manager_ |
std::unique_ptr< plugins_context > | plugins_context_ |
std::unique_ptr< 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_handler > | hotkey_handler_ |
std::unique_ptr< soundsource::manager > | soundsources_manager_ |
persist_manager | persist_ |
std::unique_ptr< game_display > | gui_ |
const std::unique_ptr< unit_experience_accelerator > | xp_mod_ |
const std::unique_ptr< statistics_t > | statistics_context_ |
std::unique_ptr< replay > | replay_ |
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_view & | game_config_ |
CKey | key_ |
bool | scrolling_ |
bool | scroll_up_ |
bool | scroll_down_ |
bool | scroll_left_ |
bool | scroll_right_ |
std::chrono::steady_clock::time_point | last_scroll_tick_ |
double | scroll_carry_x_ |
double | scroll_carry_y_ |
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 () |
Definition at line 46 of file playsingle_controller.hpp.
playsingle_controller::playsingle_controller | ( | const config & | level, |
saved_game & | state_of_game | ||
) |
Definition at line 67 of file playsingle_controller.cpp.
References describe_result(), play_controller::hotkey_handler_, play_controller::plugins_context_, play_controller::saved_game_, and play_controller::turn().
|
default |
Defined here to reduce file includes.
|
protectedvirtual |
Reimplemented in playmp_controller.
Definition at line 655 of file playsingle_controller.cpp.
References play_controller::gui_.
Referenced by playmp_controller::after_human_turn(), and play_side_impl().
|
protected |
Definition at line 535 of file playsingle_controller.cpp.
References savegame::autosave_savegame::autosave(), play_controller::did_autosave_this_turn_, game_config::disable_autosave, play_controller::gamestate(), prefs::get(), pref_constants::INFINITE_AUTO_SAVES, play_controller::is_linger_mode(), play_controller::is_regular_game_end(), log_scope, sound::play_bell(), play_controller::saved_game_, game_config::sounds::turn_bell, and game_data::TURN_PLAYING.
Referenced by play_side_impl().
|
overridevirtual |
Implements play_controller.
Definition at line 749 of file playsingle_controller.cpp.
References play_controller::get_teams(), play_controller::gui_, play_controller::is_browsing(), play_controller::is_regular_game_end(), play_controller::show_objectives(), and t.
Referenced by play_human_turn(), and playmp_controller::play_human_turn().
std::string playsingle_controller::describe_result | ( | ) | const |
Definition at line 86 of file playsingle_controller.cpp.
References play_controller::get_end_level_data(), and play_controller::is_regular_game_end().
Referenced by playsingle_controller().
void playsingle_controller::do_end_level | ( | ) |
Definition at line 355 of file playsingle_controller.cpp.
References _(), game_state::board_, transient_end_level::carryover_report, carryover_show_gold(), saved_game::classification(), sound::empty_playlist(), persist_manager::end_transaction(), game_config::exit_at_end, game_events::wml_event_pump::fire(), play_controller::gamestate(), play_controller::get_end_level_data(), play_controller::get_teams(), game_board::heal_all_survivors(), play_controller::is_observer(), play_controller::is_replay(), game_classification::is_test(), end_level_data::is_victory, ai_testing::log_game_end(), play_controller::persist_, sound::play_music_once(), end_level_data::proceed_to_next_level, play_controller::pump(), play_controller::saved_game_, play_controller::select_music(), play_controller::send_to_wesnothd(), gui2::show_transient_message(), and end_level_data::transient.
Referenced by play_some().
|
protectedvirtual |
Will handle sending a networked notification in descendent classes.
Reimplemented in playmp_controller.
Definition at line 706 of file playsingle_controller.cpp.
References play_controller::gui_, and events::chat_handler::MESSAGE_PUBLIC.
Referenced by play_side_impl().
void playsingle_controller::enable_replay | ( | bool | is_unit_test = false | ) |
Definition at line 838 of file playsingle_controller.cpp.
References saved_game::get_replay_starting_point(), on_replay_end(), replay_controller_, and play_controller::saved_game_.
Referenced by campaign_controller::playsingle_scenario().
void playsingle_controller::end_turn | ( | ) |
Definition at line 729 of file playsingle_controller.cpp.
References play_controller::current_side(), events::menu_handler::end_turn(), end_turn_requested_, play_controller::is_browsing(), play_controller::is_linger_mode(), play_controller::menu_handler_, and require_end_turn().
Referenced by playmp_controller::process_network_data().
|
protected |
Definition at line 647 of file playsingle_controller.cpp.
References play_controller::get_hotkey_command_executor(), and hotkey::command_executor::set_button_state().
Referenced by play_ai_turn(), play_human_turn(), playmp_controller::play_human_turn(), playmp_controller::play_network_turn(), play_side_impl(), and playmp_controller::process_network_data_impl().
|
protected |
Definition at line 568 of file playsingle_controller.cpp.
References play_controller::current_side(), events::menu_handler::execute_gotos(), play_controller::menu_handler_, play_controller::mouse_handler_, and should_return_to_play_side().
Referenced by play_human_turn(), and playmp_controller::play_human_turn().
|
overrideprotectedvirtual |
returns 0 if no such team was found.
Implements play_controller.
Definition at line 802 of file playsingle_controller.cpp.
References play_controller::current_side(), play_controller::get_teams(), i, play_controller::is_observer(), is_team_visible(), modulo(), and game_config::images::observer.
Referenced by init_gui(), and update_viewing_player().
void playsingle_controller::finish_side_turn | ( | ) |
Make a copy, since the [end_turn] was already sent to to server any changes to
Definition at line 261 of file playsingle_controller.cpp.
References play_controller::check_time_over(), play_controller::current_side(), play_controller::current_team(), play_controller::did_autosave_this_turn_, play_controller::did_tod_sound_this_turn_, end_turn_requested_, play_controller::finish_side_turn_events(), play_controller::finish_turn(), game_state::gamedata_, play_controller::gamestate(), play_controller::gamestate_, play_controller::gui_, play_controller::init_side_begin(), play_controller::is_regular_game_end(), game_data::set_end_turn_forced(), game_data::set_phase(), skip_empty_sides(), game_data::TURN_STARTING_WAITING, and play_controller::whiteboard_manager_.
Referenced by play_some().
|
overridevirtual |
Implements play_controller.
Definition at line 738 of file playsingle_controller.cpp.
References end_turn_requested_, game_state::gamedata_, play_controller::gamestate(), and game_data::set_end_turn_forced().
|
inline |
Definition at line 82 of file playsingle_controller.hpp.
References play_controller::player_type_changed_.
|
inlineoverridevirtual |
Reimplemented from play_controller.
Definition at line 85 of file playsingle_controller.hpp.
References replay_controller_.
Referenced by playsingle_controller::hotkey_handler::get_replay_controller().
|
overridevirtual |
Reimplemented from play_controller.
Reimplemented in playmp_controller.
Definition at line 722 of file playsingle_controller.cpp.
References controller_base::play_slice().
Referenced by playmp_controller::handle_generic_event().
|
overrideprotectedvirtual |
Reimplemented from play_controller.
Definition at line 97 of file playsingle_controller.cpp.
References find_viewing_side(), play_controller::get_hotkey_command_executor(), play_controller::get_map(), play_controller::gui_, video::headless(), play_controller::init_gui(), LOG_NG, play_controller::map_start_, hotkey::command_executor::set_button_state(), video::testing(), play_controller::timer(), update_gui_linger(), map_location::valid(), display::WARP, map_location::x, and map_location::y.
|
inlinevirtual |
Reimplemented in playmp_controller.
Definition at line 72 of file playsingle_controller.hpp.
|
protected |
Definition at line 792 of file playsingle_controller.cpp.
References game_state::board_, play_controller::gamestate(), game_board::get_team(), game_config::images::observer, and t.
Referenced by find_viewing_side().
|
protected |
Definition at line 619 of file playsingle_controller.cpp.
References game_state::board_, saved_game::clear(), end_turn_requested_, play_controller::gamestate(), LOG_NG, controller_base::play_slice(), play_controller::player_type_changed_, replay_controller_, play_controller::saved_game_, game_board::set_all_units_user_end_turn(), and update_gui_linger().
Referenced by playsingle_controller::hotkey_handler::can_execute_command(), playmp_controller::hotkey_handler::can_execute_command(), maybe_linger(), and playmp_controller::maybe_linger().
|
virtual |
Reimplemented in playmp_controller.
Definition at line 760 of file playsingle_controller.cpp.
References end_turn_requested_, play_controller::is_regular_game_end(), and linger().
Referenced by play_some().
|
inlineoverridevirtual |
Implements play_controller.
Reimplemented in playmp_controller.
Definition at line 71 of file playsingle_controller.hpp.
void playsingle_controller::on_replay_end | ( | bool | is_unit_test | ) |
Definition at line 866 of file playsingle_controller.cpp.
References e, play_controller::is_networked_mp(), play_controller::is_regular_game_end(), replay_controller_, play_controller::set_end_level_data(), and set_player_type_changed().
Referenced by enable_replay().
|
protected |
Definition at line 662 of file playsingle_controller.cpp.
References ai_fallback_, team::auto_shroud_updates(), actions::undo_list::clear(), play_controller::current_side(), play_controller::current_team(), DBG_NG, end_turn_enable(), replay_helper::get_auto_shroud(), ai::manager::get_singleton(), utils::get_unknown_exception_type(), LOG_NG, team::make_human(), ai::manager::play_turn(), play_controller::player_type_changed_, require_end_turn(), synced_context::run_and_store(), should_return_to_play_side(), play_controller::undo_stack(), and cursor::WAIT.
Referenced by play_side_impl().
|
protectedvirtual |
Reimplemented in playmp_controller.
Definition at line 580 of file playsingle_controller.cpp.
References check_objectives(), end_turn_enable(), end_turn_requested_, execute_gotos(), prefs::get(), play_controller::play_slice_catch(), should_return_to_play_side(), and show_turn_dialog().
Referenced by play_side_impl().
|
protectedvirtual |
Reimplemented in playmp_controller.
Definition at line 480 of file playsingle_controller.cpp.
References play_controller::play_slice_catch(), and should_return_to_play_side().
Referenced by play_side_impl().
|
protectedvirtual |
Will handle networked turns in descendent classes.
Reimplemented in playmp_controller.
Definition at line 716 of file playsingle_controller.cpp.
References ERR_NG.
Referenced by play_side_impl().
level_result::type playsingle_controller::play_scenario | ( | const config & | level | ) |
Definition at line 417 of file playsingle_controller.cpp.
References _(), config::append_children(), saved_game::clear(), sound::commit_music_changes(), gui2::dialogs::story_viewer::display(), e, config::empty(), prefs::get(), play_controller::get_end_level_data(), string_enums::enum_base< Definition >::get_enum(), play_controller::get_scenario_name(), play_controller::is_networked_mp(), play_controller::is_observer(), play_controller::is_skipping_replay(), play_controller::is_skipping_story(), game_config::images::level, LOG_NG, sound::play_music_config(), play_scenario_init(), play_scenario_main_loop(), saved_game::remove_snapshot(), savegame::savegame::save_game_interactive(), play_controller::saved_game_, and savegame::savegame::YES_NO.
Referenced by campaign_controller::playmp_scenario(), and campaign_controller::playsingle_scenario().
void playsingle_controller::play_scenario_init | ( | const config & | level | ) |
Definition at line 143 of file playsingle_controller.cpp.
References _(), saved_game::classification(), config::empty(), ERR_NG, play_controller::fire_preload(), game_state::gamedata_, play_controller::gamestate(), play_controller::gamestate_, play_controller::get_teams(), play_controller::gui_, play_controller::init_side_begin(), play_controller::init_side_end(), play_controller::is_networked_mp(), game_config::images::level, game_classification::random_mode, game_data::read_phase(), saved_game::replay_start(), s, play_controller::saved_game_, game_data::set_phase(), gui2::show_transient_message(), playsingle_controller::ses_result::side_num, skip_empty_sides(), play_controller::soundsources_manager_, play_controller::start_game(), play_controller::to_config(), game_data::TURN_PLAYING, and update_viewing_player().
Referenced by play_scenario(), and play_scenario_main_loop().
void playsingle_controller::play_scenario_main_loop | ( | ) |
Definition at line 310 of file playsingle_controller.cpp.
References statistics_record::campaign_stats_t::clear_current_scenario(), end_turn_requested_, game_data::GAME_ENDED, resources::gameboard, play_controller::gamestate(), play_controller::get_saved_game(), play_controller::get_teams(), i, reset_gamestate_exception::level, ai_testing::log_game_start(), LOG_NG, play_scenario_init(), play_some(), statistics_record::campaign_stats_t::read(), replay_controller_, play_controller::reset_gamestate(), utf8::size(), reset_gamestate_exception::start_replay, saved_game::statistics(), reset_gamestate_exception::stats_, game_board::teams(), and play_controller::timer().
Referenced by play_scenario().
void playsingle_controller::play_side | ( | ) |
Definition at line 234 of file playsingle_controller.cpp.
References play_controller::get_teams(), play_controller::is_regular_game_end(), play_controller::maybe_do_init_side(), play_side_impl(), play_controller::player_type_changed_, sync_end_turn(), t, and update_viewing_player().
Referenced by play_some().
|
protected |
Definition at line 489 of file playsingle_controller.cpp.
References after_human_turn(), before_human_turn(), play_controller::current_side(), play_controller::current_team(), do_idle_notification(), end_turn_enable(), end_turn_requested_, ERR_NG, play_controller::gamestate(), string_enums::enum_base< Definition >::get_string(), play_controller::get_units(), play_controller::is_regular_game_end(), LOG_NG, play_ai_turn(), play_human_turn(), play_idle_loop(), play_network_turn(), play_controller::player_type_changed_, replay_controller_, require_end_turn(), team::side(), game_data::TURN_PLAYING, and game_data::TURN_STARTING_WAITING.
Referenced by play_side().
void playsingle_controller::play_some | ( | ) |
Definition at line 203 of file playsingle_controller.cpp.
References do_end_level(), game_data::end_turn_forced(), end_turn_requested_, finish_side_turn(), game_data::GAME_ENDED, game_data::GAME_ENDING, game_state::gamedata_, play_controller::gamestate(), play_controller::get_end_level_data(), play_controller::get_teams(), video::headless(), play_controller::is_regular_game_end(), transient_end_level::linger_mode, maybe_linger(), play_side(), game_data::set_phase(), end_level_data::transient, game_data::TURN_ENDED, game_data::TURN_PLAYING, and game_data::TURN_STARTING_WAITING.
Referenced by play_scenario_main_loop().
void playsingle_controller::require_end_turn | ( | ) |
Definition at line 744 of file playsingle_controller.cpp.
References end_turn_requested_.
Referenced by end_turn(), play_ai_turn(), and play_side_impl().
|
protected |
Definition at line 828 of file playsingle_controller.cpp.
References ERR_NG, and replay_controller_.
Referenced by playsingle_controller::hotkey_handler::reset_replay().
|
inline |
Definition at line 83 of file playsingle_controller.hpp.
References play_controller::player_type_changed_.
Referenced by on_replay_end().
|
overridevirtual |
Reimplemented from play_controller.
Definition at line 852 of file playsingle_controller.cpp.
References play_controller::current_team(), end_turn_requested_, play_controller::gamestate(), play_controller::is_regular_game_end(), play_controller::player_type_changed_, replay_controller_, game_data::TURN_ENDED, and game_data::TURN_STARTING_WAITING.
Referenced by execute_gotos(), play_ai_turn(), play_human_turn(), playmp_controller::play_human_turn(), play_idle_loop(), playmp_controller::play_idle_loop(), and playmp_controller::play_network_turn().
|
protected |
Definition at line 555 of file playsingle_controller.cpp.
References _(), b, game_state::board_, play_controller::current_side(), play_controller::gamestate(), prefs::get(), game_board::get_team(), play_controller::gui_, utils::interpolate_variables_into_string(), play_controller::is_regular_game_end(), gui2::show_transient_message(), and team::side_name().
Referenced by play_human_turn(), and playmp_controller::play_human_turn().
playsingle_controller::ses_result playsingle_controller::skip_empty_sides | ( | int | side_num | ) |
Calculates the current side, starting at side_num that is non-empty.
Definition at line 189 of file playsingle_controller.cpp.
References play_controller::gamestate(), play_controller::get_teams(), and modulo().
Referenced by finish_side_turn(), and play_scenario_init().
|
overrideprotectedvirtual |
Reimplemented from play_controller.
Definition at line 768 of file playsingle_controller.cpp.
References ai_fallback_, play_controller::current_team(), replay::end_turn(), end_turn_requested_, game_state::gamedata_, play_controller::gamestate(), play_controller::gamestate_, team::make_ai(), resources::recorder, game_data::set_phase(), game_data::TURN_ENDED, game_data::TURN_PLAYING, and synced_context::UNSYNCED.
Referenced by play_side().
|
protected |
Definition at line 596 of file playsingle_controller.cpp.
References play_controller::get_end_level_data(), play_controller::gui_, play_controller::is_linger_mode(), game_display::LINGER, game_display::RUNNING, and play_controller::update_gui_to_player().
Referenced by init_gui(), and linger().
|
overrideprotectedvirtual |
Implements play_controller.
Definition at line 817 of file playsingle_controller.cpp.
References find_viewing_side(), play_controller::gui_, replay_controller_, and play_controller::update_gui_to_player().
Referenced by play_scenario_init(), play_side(), and playmp_controller::process_network_change_controller_impl().
|
protected |
true when the current side is actually an ai side but was taken over by a human (usually for debugging purposes), we need this variable to remember to give the ai control back next turn.
Definition at line 109 of file playsingle_controller.hpp.
Referenced by play_ai_turn(), and sync_end_turn().
|
protected |
Definition at line 102 of file playsingle_controller.hpp.
|
protected |
true iff the user has pressed the end turn button this turn.
(or wants to end linger mode, which is implemented via the same button)
Definition at line 106 of file playsingle_controller.hpp.
Referenced by end_turn(), finish_side_turn(), force_end_turn(), linger(), maybe_linger(), playmp_controller::maybe_linger(), play_human_turn(), playmp_controller::play_human_turn(), play_scenario_main_loop(), play_side_impl(), play_some(), require_end_turn(), should_return_to_play_side(), and sync_end_turn().
|
protected |
non-null when replay mode in active, is used in singleplayer and for the "back to turn" feature in multiplayer.
Definition at line 111 of file playsingle_controller.hpp.
Referenced by enable_replay(), get_replay_controller(), linger(), playmp_controller::maybe_linger(), on_replay_end(), play_scenario_main_loop(), play_side_impl(), reset_replay(), should_return_to_play_side(), and update_viewing_player().