16 #ifndef PLAY_CONTROLLER_H_INCLUDED
17 #define PLAY_CONTROLLER_H_INCLUDED
31 #include <boost/scoped_ptr.hpp>
32 #include <boost/shared_ptr.hpp>
85 CVideo& video,
bool skip_replay);
220 class hotkey_handler;
226 return level_[
"name"].t_str();
231 return level_[
"disallow_recall"].to_bool();
236 return level_[
"theme"].str();
247 throw return_to_play_side_exception();
334 boost::scoped_ptr<game_display>
gui_;
335 boost::scoped_ptr<unit_experience_accelerator>
xp_mod_;
339 boost::scoped_ptr<replay>
replay_;
play_controller(const config &level, saved_game &state_of_game, const config &game_config, const tdata_cache &tdata, CVideo &video, bool skip_replay)
const unit_map & get_units_const() const
bool player_type_changed_
events::mouse_handler & get_mouse_handler_base()
Get a reference to a mouse handler member a derived class uses.
virtual void send_to_wesnothd(const config &, const std::string &="unknown") const
help::help_manager help_manager_
bool is_team_visible(int team_num, bool observer) const
virtual const unit_map & units() const
font::floating_label_context labels_manager_
const end_level_data & get_end_level_data_const() const
void save_replay_auto(const std::string &filename)
bool victory_when_enemies_defeated_
const mp_game_settings & get_mp_settings()
boost::scoped_ptr< plugins_context > plugins_context_
events::mouse_handler mouse_handler_
virtual void process_oos(const std::string &msg) const
Asks the user whether to continue on an OOS error.
virtual void handle_generic_event(const std::string &)
int server_request_number_
virtual void update_viewing_player()=0
bool can_use_synced_wml_menu() const
virtual bool recieve_from_wesnothd(config &) const
void process_focus_keydown_event(const SDL_Event &event)
Process keydown (only when the general map display does not have focus).
boost::scoped_ptr< hotkey_handler > hotkey_handler_
void check_victory()
Checks to see if a side has won.
boost::scoped_ptr< soundsource::manager > soundsources_manager_
bool is_skipping_replay() const
Contains the exception interfaces used to signal completion of a scenario, campaign or turn...
controller_base framework: controller_base is roughly analogous to a "dialog" class in a GUI toolkit ...
void init(CVideo &video, const config &level)
bool ignore_replay_errors_
GLint GLenum GLsizei GLint GLsizei const GLvoid * data
const std::string & select_victory_music() const
const tdata_cache & tdata_
void process_keydown_event(const SDL_Event &event)
Process keydown (always).
boost::scoped_ptr< unit_experience_accelerator > xp_mod_
events::menu_handler menu_handler_
const gamemap & get_map_const() const
void process_keyup_event(const SDL_Event &event)
Process keyup (always).
~scoped_savegame_snapshot()
bool enemies_visible() const
void do_consolesave(const std::string &filename)
std::vector< std::string > defeat_music_
game_events::t_pump & pump()
This class stores all the data for a single 'side' (in game nomenclature).
scoped_savegame_snapshot(const play_controller &controller)
void save_game_auto(const std::string &filename)
void reset_end_level_data()
int current_side() const
Returns the number of the side whose turn it is.
int get_server_request_number() const
std::vector< team > teams_
bool is_regular_game_end() const
void update_savegame_snapshot() const
virtual void check_time_over()
Implements a quit confirmation dialog.
t_string get_scenario_name()
virtual bool should_return_to_play_side()
Encapsulates the map of the game.
void maybe_do_init_side()
Called by turn_info::process_network_data() or init_side() to call do_init_side() if necessary...
boost::scoped_ptr< actions::undo_list > undo_stack_
undo_stack_ is never nullptr.
bool is_lingering() const
std::set< std::string > all_players() const
const game_state & gamestate() const
bool is_browsing() const override
virtual plugins_context * get_plugins_context()
Get (optionally) a plugins context a derived class uses.
hotkey::command_executor * get_hotkey_command_executor()
Get (optionally) a command executor to handle context menu events.
void update_gui_to_player(const int team_index, const bool observe=false)
Changes the UI for this client to the passed side index.
virtual void force_end_turn()=0
void do_init_side()
Called by replay handler or init_side() to do actual work for turn change.
virtual ~play_controller()
actions::undo_list & get_undo_stack()
void maybe_throw_return_to_play_side()
void set_end_level_data(const end_level_data &data)
Game configuration data as global variables.
t_possible_end_level_data end_level_data_
hotkey::scope_changer scope_
void reset_gamestate(const config &level, int replay_pos)
structure which will hide all current floating labels, and cause floating labels instantiated after i...
static void msg(const char *act, debug_info &i, const char *to="", const char *result="")
const std::vector< team > & get_teams_const() const
boost::scoped_ptr< tooltips::manager > tooltips_manager_
Additional information on the game outcome which can be provided by WML.
actions::undo_list & undo_stack()
void set_defeat_music_list(const std::string &list)
const tod_manager & get_tod_manager_const() const
bool get_disallow_recall()
virtual const gamemap & map() const
const game_classification & get_classification()
boost::scoped_ptr< game_state > gamestate_
Class to store the actions that a player can undo and redo.
boost::shared_ptr< wb::manager > get_whiteboard()
bool have_keyboard_focus()
Derived classes should override this to return false when arrow keys should not scroll the map...
events::menu_handler & get_menu_handler()
void toggle_skipping_replay()
boost::shared_ptr< wb::manager > whiteboard_manager_
config to_config() const
Builds the snapshot config from members and their respective configs.
virtual void on_not_observer()=0
game_display & get_display()
Get a reference to a display member a derived class uses.
bool is_observer() const
Check if we are an observer in this game.
Container associating units to locations.
const actions::undo_list & undo_stack() const
void fire_preload()
preload events cannot be synced
void set_victory_music_list(const std::string &list)
boost::scoped_ptr< game_display > gui_
std::vector< std::string > victory_music_
const std::string & select_defeat_music() const
virtual bool is_networked_mp() const
const play_controller & controller_
virtual soundsource::manager * get_soundsource_man()
Get (optionally) a soundsources manager a derived class uses.
boost::scoped_ptr< const statistics::scenario_context > statistics_context_
A config object defines a single node in a WML file, with access to child nodes.
GLsizei const GLcharARB ** string
bool is_linger_mode() const
virtual void check_objectives()=0
int find_last_visible_team() const
returns 0 if no such team was found.
virtual void play_side_impl()
boost::scoped_ptr< replay > replay_
bool init_side_done_now_
Whether we did init sides in this session (false = we did init sides before we reloaded the game)...
bool remove_from_carryover_on_defeat_
void increase_server_request_number()
virtual void sync_end_turn()