#include <playsingle_controller.hpp>
Classes | |
class | hotkey_handler |
Protected Types | |
enum | END_TURN_STATE { END_TURN_NONE, END_TURN_REQUIRED, END_TURN_SYNCED } |
Protected Member Functions | |
virtual 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 () |
void | store_recalls () |
void | store_gold (bool obs=false) |
void | linger () |
void | sync_end_turn () |
void | update_viewing_player () |
void | reset_replay () |
Protected Member Functions inherited from play_controller | |
void | play_slice_catch () |
bool | 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. More... | |
void | process_focus_keydown_event (const SDL_Event &event) |
Process keydown (only when the general map display does not have focus). More... | |
void | process_keydown_event (const SDL_Event &event) |
Process keydown (always). More... | |
void | process_keyup_event (const SDL_Event &event) |
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 () |
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_list & | undo_stack () |
const actions::undo_list & | undo_stack () const |
const std::string & | select_victory_music () const |
const std::string & | select_defeat_music () const |
void | set_victory_music_list (const std::string &list) |
void | set_defeat_music_list (const std::string &list) |
void | reset_gamestate (const config &level, int replay_pos) |
virtual void | check_time_over () |
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, double joystickx, double joysticky) |
Handle scrolling by keyboard, joystick and moving mouse near map edges. More... | |
void | handle_event (const SDL_Event &event) |
Process mouse- and keypress-events from SDL. More... | |
void | handle_window_event (const SDL_Event &) |
virtual void | show_menu (const std::vector< std::string > &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 |
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) | |
virtual | ~sdl_handler () |
virtual std::vector < sdl_handler * > | handler_members () |
Additional Inherited Members | |
Static Public Member Functions inherited from controller_base | |
static const config & | get_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 () |
Definition at line 37 of file playsingle_controller.hpp.
|
protected |
Enumerator | |
---|---|
END_TURN_NONE |
The turn was not ended yet. |
END_TURN_REQUIRED |
And endturn was required eigher by the player, by the ai or by [end_turn]. |
END_TURN_SYNCED |
An [end_turn] was added to the replay. |
Definition at line 89 of file playsingle_controller.hpp.
playsingle_controller::playsingle_controller | ( | const config & | level, |
saved_game & | state_of_game, | ||
const config & | game_config, | ||
const tdata_cache & | tdata, | ||
CVideo & | video, | ||
bool | skip_replay | ||
) |
Definition at line 72 of file playsingle_controller.cpp.
References play_controller::recieve_from_wesnothd().
|
virtual |
Definition at line 113 of file playsingle_controller.cpp.
References ai::manager::clear_ais(), and ai::manager::remove_observer().
|
protectedvirtual |
Reimplemented in playmp_controller.
Definition at line 513 of file playsingle_controller.cpp.
References play_controller::gui_.
Referenced by playmp_controller::after_human_turn(), and play_side_impl().
|
protected |
Definition at line 401 of file playsingle_controller.cpp.
References savegame::autosave_savegame::autosave(), preferences::autosavemax(), game_config::disable_autosave, end_turn_, END_TURN_NONE, play_controller::gui_, preferences::INFINITE_AUTO_SAVES, play_controller::init_side_done_now_, play_controller::is_regular_game_end(), play_controller::linger_, log_scope, sound::play_bell(), save(), preferences::save_compression_format(), play_controller::saved_game_, game_config::sounds::turn_bell, and preferences::turn_bell().
Referenced by play_side_impl().
|
virtual |
Implements play_controller.
Definition at line 611 of file playsingle_controller.cpp.
References game_state::board_, play_controller::gamestate(), play_controller::get_scenario_name(), play_controller::gui_, play_controller::is_browsing(), play_controller::is_regular_game_end(), team::objectives(), team::objectives_changed(), team::reset_objectives_changed(), dialogs::show_objectives(), and game_board::teams().
Referenced by playmp_controller::play_human_turn(), and play_human_turn().
std::string playsingle_controller::describe_result | ( | ) | const |
Definition at line 100 of file playsingle_controller.cpp.
References play_controller::get_end_level_data_const(), and play_controller::is_regular_game_end().
|
protectedvirtual |
Will handle sending a networked notification in descendent classes.
Reimplemented in playmp_controller.
Definition at line 573 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 670 of file playsingle_controller.cpp.
References play_controller::gamestate(), on_replay_end(), replay_, saved_game::replay_start(), and play_controller::saved_game_.
void playsingle_controller::end_turn | ( | ) |
Definition at line 598 of file playsingle_controller.cpp.
References play_controller::current_side(), events::menu_handler::end_turn(), end_turn_, END_TURN_REQUIRED, play_controller::is_browsing(), play_controller::linger_, and play_controller::menu_handler_.
Referenced by playmp_controller::play_linger_turn().
|
protected |
Definition at line 506 of file playsingle_controller.cpp.
References play_controller::get_hotkey_command_executor(), play_controller::gui_, and hotkey::command_executor::set_button_state().
Referenced by playmp_controller::handle_generic_event(), linger(), play_ai_turn(), playmp_controller::play_human_turn(), play_human_turn(), playmp_controller::play_linger_turn(), playmp_controller::play_network_turn(), and play_side_impl().
|
protected |
Definition at line 433 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 playmp_controller::play_human_turn(), and play_human_turn().
|
virtual |
Implements play_controller.
Definition at line 606 of file playsingle_controller.cpp.
References end_turn_, END_TURN_REQUIRED, and skip_next_turn_.
|
inline |
Definition at line 60 of file playsingle_controller.hpp.
References play_controller::player_type_changed_.
|
inline |
Definition at line 63 of file playsingle_controller.hpp.
References replay_.
Referenced by playsingle_controller::hotkey_handler::get_replay_controller(), and is_replay().
|
virtual |
Reimplemented from play_controller.
Reimplemented in playmp_controller.
Definition at line 590 of file playsingle_controller.cpp.
References controller_base::play_slice().
Referenced by playmp_controller::handle_generic_event().
|
protectedvirtual |
Reimplemented from play_controller.
Definition at line 119 of file playsingle_controller.cpp.
References play_controller::gamestate(), play_controller::get_hotkey_command_executor(), play_controller::gui_, play_controller::init_gui(), play_controller::is_skipping_replay(), LOG_NG, events::raise_draw_event(), hotkey::command_executor::set_button_state(), play_controller::ticks(), and display::WARP.
|
inlinevirtual |
Reimplemented from play_controller.
Definition at line 64 of file playsingle_controller.hpp.
References get_replay_controller().
|
protected |
Definition at line 464 of file playsingle_controller.cpp.
References game_state::board_, end_turn_, end_turn_enable(), END_TURN_NONE, game::load_game_exception::game, play_controller::gamestate(), play_controller::gui_, game_display::LINGER, play_controller::linger_, LOG_NG, controller_base::play_slice(), game_display::RUNNING, play_controller::saved_game_, and game_board::set_all_units_user_end_turn().
Referenced by playsingle_controller::hotkey_handler::can_execute_command(), and maybe_linger().
|
virtual |
Reimplemented in playmp_controller.
Definition at line 622 of file playsingle_controller.cpp.
References play_controller::gamestate(), play_controller::get_end_level_data_const(), play_controller::is_regular_game_end(), and linger().
|
inlinevirtual |
Implements play_controller.
Reimplemented in playmp_controller.
Definition at line 51 of file playsingle_controller.hpp.
void playsingle_controller::on_replay_end | ( | bool | is_unit_test | ) |
Definition at line 691 of file playsingle_controller.cpp.
References e, play_controller::is_regular_game_end(), end_level_data::is_victory, end_level_data::proceed_to_next_level, replay_, and play_controller::set_end_level_data().
Referenced by enable_replay().
|
protected |
Definition at line 520 of file playsingle_controller.cpp.
References team::auto_shroud_updates(), actions::undo_list::clear(), play_controller::current_side(), play_controller::current_team(), cursor_setter, end_turn_, end_turn_enable(), END_TURN_REQUIRED, replay_helper::get_auto_shroud(), play_controller::gui_, LOG_NG, team::make_human(), ai::manager::play_turn(), play_controller::player_type_changed_, synced_context::run_and_store(), turn_info::send_data(), should_return_to_play_side(), turn_info::sync_network(), turn_data_, play_controller::undo_stack(), and cursor::WAIT.
Referenced by play_side_impl().
|
protectedvirtual |
Reimplemented in playmp_controller.
Definition at line 448 of file playsingle_controller.cpp.
References check_objectives(), preferences::disable_auto_moves(), end_turn_enable(), execute_gotos(), play_controller::gui_, 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 344 of file playsingle_controller.cpp.
References play_controller::gui_, 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 583 of file playsingle_controller.cpp.
References ERR_NG.
Referenced by play_side_impl().
LEVEL_RESULT playsingle_controller::play_scenario | ( | const config & | level | ) |
Definition at line 213 of file playsingle_controller.cpp.
References _(), game_state::board_, config::child_range(), sound::commit_music_changes(), transient_end_level::custom_endlevel_music, sdl::draw_solid_tinted_rectangle(), e, persist_manager::end_transaction(), ERR_NG, game_config::exit_at_end, game_events::t_pump::fire(), game::load_game_exception::game, play_controller::gamestate(), play_controller::get_end_level_data_const(), play_controller::get_scenario_name(), play_controller::gui_, game_board::heal_all_survivors(), play_controller::is_observer(), play_controller::is_regular_game_end(), play_controller::is_skipping_replay(), end_level_data::is_victory, play_controller::linger_, ai_testing::log_game_end(), LOG_NG, play_controller::persist_, sound::play_music_config(), sound::play_music_once(), play_scenario_init(), play_scenario_main_loop(), game_data::PRESTART, end_level_data::proceed_to_next_level, play_controller::pump(), storyscreen::QUIT, saved_game::remove_snapshot(), save(), preferences::save_compression_format(), savegame::savegame::save_game_interactive(), play_controller::saved_game_, play_controller::select_defeat_music(), play_controller::select_victory_music(), play_controller::send_to_wesnothd(), play_controller::set_defeat_music_list(), saved_game::set_snapshot(), play_controller::set_victory_music_list(), show_story(), gui2::show_transient_message(), play_controller::soundsources_manager_, play_controller::ticks(), end_level_data::transient, update_rect(), and gui::YES_NO.
Referenced by campaign_controller::playmp_scenario().
void playsingle_controller::play_scenario_init | ( | ) |
Definition at line 135 of file playsingle_controller.cpp.
References _(), saved_game::classification(), config::empty(), play_controller::gui_, play_controller::is_networked_mp(), game_classification::random_mode, saved_game::replay_start(), play_controller::saved_game_, gui2::show_transient_message(), play_controller::start_game(), and play_controller::to_config().
Referenced by play_scenario(), and play_scenario_main_loop().
void playsingle_controller::play_scenario_main_loop | ( | ) |
Definition at line 154 of file playsingle_controller.cpp.
References game_state::board_, ERR_NG, play_controller::gamestate(), play_controller::gamestate_, i, play_controller::is_regular_game_end(), reset_gamestate_exception::level, ai_testing::log_game_start(), LOG_NG, play_scenario_init(), play_controller::play_turn(), replay_, play_controller::reset_gamestate(), turn_info::send_data(), reset_gamestate_exception::start_replay, game_board::teams(), play_controller::ticks(), and turn_data_.
Referenced by play_scenario().
|
protectedvirtual |
Reimplemented from play_controller.
Reimplemented in playmp_controller.
Definition at line 353 of file playsingle_controller.cpp.
References after_human_turn(), before_human_turn(), game_state::board_, team::controller(), play_controller::current_side(), play_controller::current_team(), do_idle_notification(), end_turn_, end_turn_enable(), END_TURN_NONE, END_TURN_REQUIRED, END_TURN_SYNCED, ERR_NG, play_controller::gamestate(), 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_, team::proxy_controller(), replay_, REPLAY_FOUND_END_TURN, team::side(), unit_map::size(), skip_next_turn_, and game_board::units().
Referenced by playmp_controller::play_side_impl().
|
protected |
Definition at line 659 of file playsingle_controller.cpp.
References ERR_NG, and replay_.
Referenced by playsingle_controller::hotkey_handler::reset_replay().
|
inline |
Definition at line 61 of file playsingle_controller.hpp.
References play_controller::player_type_changed_.
|
virtual |
Reimplemented from play_controller.
Definition at line 678 of file playsingle_controller.cpp.
References play_controller::current_team(), end_turn_, END_TURN_NONE, team::is_network(), play_controller::is_regular_game_end(), play_controller::player_type_changed_, and replay_.
Referenced by execute_gotos(), play_ai_turn(), playmp_controller::play_human_turn(), play_human_turn(), playmp_controller::play_idle_loop(), and play_idle_loop().
|
protected |
Definition at line 420 of file playsingle_controller.cpp.
References _(), game_state::board_, play_controller::current_side(), play_controller::gamestate(), play_controller::gui_, utils::interpolate_variables_into_string(), play_controller::is_regular_game_end(), gui2::show_transient_message(), game_board::teams(), and preferences::turn_dialog().
Referenced by playmp_controller::play_human_turn(), and play_human_turn().
|
protected |
|
protected |
|
protectedvirtual |
Reimplemented from play_controller.
Definition at line 631 of file playsingle_controller.cpp.
References play_controller::current_team(), replay::end_turn(), end_turn_, END_TURN_REQUIRED, END_TURN_SYNCED, resources::recorder, skip_next_turn_, and synced_context::UNSYNCED.
|
protectedvirtual |
Implements play_controller.
Definition at line 646 of file playsingle_controller.cpp.
References play_controller::find_last_visible_team(), play_controller::gui_, replay_, and play_controller::update_gui_to_player().
|
protected |
Definition at line 83 of file playsingle_controller.hpp.
Referenced by play_ai_turn().
|
protected |
Definition at line 98 of file playsingle_controller.hpp.
Referenced by before_human_turn(), end_turn(), force_end_turn(), playmp_controller::linger(), linger(), play_ai_turn(), playmp_controller::play_human_turn(), playmp_controller::play_linger_turn(), playmp_controller::play_network_turn(), play_side_impl(), playmp_controller::process_network_data(), should_return_to_play_side(), and sync_end_turn().
|
protected |
Definition at line 87 of file playsingle_controller.hpp.
Referenced by playmp_controller::play_linger_turn(), playmp_controller::process_network_data(), and playmp_controller::wait_for_upload().
|
protected |
Definition at line 100 of file playsingle_controller.hpp.
Referenced by enable_replay(), get_replay_controller(), on_replay_end(), play_scenario_main_loop(), play_side_impl(), reset_replay(), should_return_to_play_side(), and update_viewing_player().
|
protected |
Definition at line 86 of file playsingle_controller.hpp.
|
protected |
Definition at line 99 of file playsingle_controller.hpp.
Referenced by force_end_turn(), play_side_impl(), and sync_end_turn().
|
protected |
Definition at line 84 of file playsingle_controller.hpp.
|
protected |
Definition at line 88 of file playsingle_controller.hpp.
Referenced by playmp_controller::after_human_turn(), playmp_controller::handle_generic_event(), playmp_controller::linger(), play_ai_turn(), playmp_controller::play_human_turn(), playmp_controller::play_idle_loop(), playmp_controller::play_linger_turn(), playmp_controller::play_network_turn(), play_scenario_main_loop(), playmp_controller::playmp_controller(), playmp_controller::process_network_data(), playmp_controller::pull_remote_choice(), playmp_controller::send_user_choice(), playmp_controller::wait_for_upload(), and playmp_controller::~playmp_controller().