46 struct floating_label_context;
239 class hotkey_handler;
248 return level_[
"name"].t_str();
253 return level_[
"disallow_recall"].to_bool();
258 return level_[
"loaded_resources"].str();
263 return gamestate_->get_game_data()->get_theme();
366 std::unique_ptr<game_display>
gui_;
367 const std::unique_ptr<unit_experience_accelerator>
xp_mod_;
Class to store the actions that a player can undo and redo.
A config object defines a single node in a WML file, with access to child nodes.
bool is_observer() const
Check if we are an observer in this game.
virtual const std::vector< team > & teams() const override
virtual const unit_map & units() const override
virtual const gamemap & map() const override
utils::optional< end_level_data > end_level_data_
int server_request_number_
const std::unique_ptr< actions::undo_list > undo_stack_
undo_stack_ is never nullptr.
bool do_healing_
True if healing should be done at the beginning of the next side turn.
Encapsulates the map of the game.
game_classification & get_classification()
const std::string & select_music(bool victory) const
virtual void handle_generic_event(const std::string &) override
void process_keydown_event(const SDL_Event &event) override
Process keydown (always).
bool ignore_replay_errors_
events::menu_handler & get_menu_handler()
void maybe_throw_return_to_play_side() const
config to_config() const
Builds the snapshot config from members and their respective configs.
virtual void on_not_observer()=0
void init(const config &level)
const std::vector< team > & get_teams() const
virtual bool receive_from_wesnothd(config &) const
int get_server_request_number() const
std::vector< team > & get_teams()
std::unique_ptr< hotkey_handler > hotkey_handler_
virtual replay_controller * get_replay_controller() const
bool have_keyboard_focus() override
Derived classes should override this to return false when arrow keys should not scroll the map,...
std::unique_ptr< game_state > gamestate_
void show_objectives() const
events::menu_handler menu_handler_
void fire_preload()
preload events cannot be synced
std::vector< std::string > victory_music_
void check_victory()
Checks to see if a side has won.
bool is_linger_mode() const
actions::undo_list & undo_stack()
statistics_t & statistics()
virtual soundsource::manager * get_soundsource_man() override
Get (optionally) a soundsources manager a derived class uses.
void check_next_scenario_is_known()
This shows a warning dialog if either [scenario]next_scenario or any [endlevel]next_scenario would le...
bool reveal_map_default() const
actions::undo_list & get_undo_stack()
const unit_map & get_units() const
play_controller(const config &level, saved_game &state_of_game)
void set_end_level_data(const end_level_data &data)
events::mouse_handler & get_mouse_handler_base() override
Get a reference to a mouse handler member a derived class uses.
void update_savegame_snapshot() const
virtual int find_viewing_side() const =0
returns 0 if no such team was found.
void increase_server_request_number()
void set_do_healing(bool do_healing)
const actions::undo_list & undo_stack() const
bool is_skipping_actions() const
bool is_during_turn() const
bool can_use_synced_wml_menu() const
void reset_gamestate(const config &level, int replay_pos)
bool is_skipping_story() const
void do_consolesave(const std::string &filename)
void save_game_auto(const std::string &filename)
void textbox_move_vertically(bool up)
bool is_regular_game_end() const
saved_game & get_saved_game()
tooltips::manager tooltips_manager_
virtual void check_objectives()=0
void save_replay_auto(const std::string &filename)
hotkey::command_executor * get_hotkey_command_executor() override
Optionally get a command executor to handle context menu events.
bool enemies_visible() const
std::unique_ptr< replay > replay_
const std::unique_ptr< statistics_t > statistics_context_
const mp_game_settings & get_mp_settings()
game_display & get_display() override
Get a reference to a display member a derived class uses.
virtual void update_viewing_player()=0
virtual void sync_end_turn()
std::unique_ptr< game_display > gui_
void toggle_skipping_replay()
void maybe_do_init_side()
Called by turn_info::process_network_data() or init_side() to call do_init_side() if necessary.
virtual void process_oos(const std::string &msg) const
Asks the user whether to continue on an OOS error.
bool is_browsing() const override
virtual void send_to_wesnothd(const config &, const std::string &="unknown") const
std::unique_ptr< soundsource::manager > soundsources_manager_
void reset_end_level_data()
const end_level_data & get_end_level_data() const
void do_init_side()
Called by replay handler or init_side() to do actual work for turn change.
std::string theme() const
const tod_manager & get_tod_manager() const
int current_side() const
Returns the number of the side whose turn it is.
virtual bool is_networked_mp() const
bool is_skipping_replay() const
bool get_disallow_recall() const
const hotkey::scope_changer scope_
std::unique_ptr< font::floating_label_context > labels_manager_
bool did_tod_sound_this_turn_
std::shared_ptr< wb::manager > get_whiteboard() const
std::vector< std::string > defeat_music_
const gamemap & get_map() const
bool did_autosave_this_turn_
Whether we did init sides in this session (false = we did init sides before we reloaded the game).
bool player_type_changed_
true when the controller of the currently playing side has changed.
virtual bool should_return_to_play_side() const
std::set< std::string > all_players() const
virtual void force_end_turn()=0
void update_gui_to_player(const int team_index, const bool observe=false)
Changes the UI for this client to the passed side index.
events::mouse_handler mouse_handler_
const auto & timer() const
std::unique_ptr< plugins_context > plugins_context_
virtual plugins_context * get_plugins_context() override
Get (optionally) a plugins context a derived class uses.
virtual ~play_controller()
const std::unique_ptr< unit_experience_accelerator > xp_mod_
void process_focus_keydown_event(const SDL_Event &event) override
Process keydown (only when the general map display does not have focus).
virtual void send_actions()
Sends replay [command]s to the server.
void refresh_objectives() const
Reevaluate [show_if] conditions and build a new objectives string.
game_events::wml_event_pump & pump()
void process_keyup_event(const SDL_Event &event) override
Process keyup (always).
void finish_side_turn_events()
replay & recorder() const
std::string get_loaded_resources() const
help::help_manager help_manager_
const game_state & gamestate() const
virtual void receive_actions()
Reads and executes replay [command]s from the server.
std::shared_ptr< wb::manager > whiteboard_manager_
virtual void check_time_over()
t_string get_scenario_name() const
Implements a quit confirmation dialog.
This class stores all the data for a single 'side' (in game nomenclature).
Container associating units to locations.
controller_base framework: controller_base is roughly analogous to a "dialog" class in a GUI toolkit ...
Contains the exception interfaces used to signal completion of a scenario, campaign or turn.
static void msg(const char *act, debug_info &i, const char *to="", const char *result="")
std::string filename
Filename.
Additional information on the game outcome which can be provided by WML.
The help implementation caches data parsed from the game_config.
Encapsulates the map of the game.
~scoped_savegame_snapshot()
scoped_savegame_snapshot(const play_controller &controller)
const play_controller & controller_
Reports time elapsed at the end of an object scope.