47 struct floating_label_context;
89 bool can_undo()
const;
90 bool can_redo()
const;
98 void save_game_auto(
const std::string& filename);
100 void save_replay_auto(
const std::string& filename);
104 void init_side_begin();
109 void maybe_do_init_side();
116 void init_side_end();
118 virtual void force_end_turn() = 0;
119 virtual void check_objectives() = 0;
121 virtual void on_not_observer() = 0;
128 virtual void process_oos(
const std::string&
msg)
const;
132 gamestate().end_level_data_ = data;
137 gamestate().end_level_data_.reset();
142 return gamestate().end_level_data_.has_value();
147 return *gamestate().end_level_data_;
152 return gamestate().board_.teams();
157 return gamestate().board_.teams();
162 return gamestate().board_.units();
167 return gamestate().board_.units();
172 return gamestate().board_.map();
177 return gamestate().tod_manager_;
182 return gamestate().board_.is_observer();
187 return gamestate().do_healing_;
192 gamestate().do_healing_ = do_healing;
210 void check_victory();
212 std::size_t
turn()
const {
return gamestate().tod_manager_.turn();}
227 void toggle_skipping_replay();
233 void do_consolesave(
const std::string& filename);
238 std::shared_ptr<wb::manager> get_whiteboard()
const;
246 int get_ticks()
const;
254 bool is_browsing()
const override;
260 bool is_replay()
const {
return get_replay_controller() !=
nullptr; }
264 return level_[
"name"].t_str();
269 return level_[
"disallow_recall"].to_bool();
274 return level_[
"loaded_resources"].str();
279 return gamestate_->get_game_data()->get_theme();
284 return is_regular_game_end();
289 if(should_return_to_play_side() && !linger_ ) {
298 team& current_team();
299 const team& current_team()
const;
301 bool can_use_synced_wml_menu()
const;
302 std::set<std::string> all_players()
const;
303 int ticks()
const {
return ticks_; }
306 void update_savegame_snapshot()
const;
310 void update_gui_to_player(
const int team_index,
const bool observe =
false);
316 void refresh_objectives()
const;
317 void show_objectives()
const;
330 void play_slice_catch();
331 bool have_keyboard_focus()
override;
332 void process_focus_keydown_event(
const SDL_Event& event)
override;
333 void process_keydown_event(
const SDL_Event& event)
override;
334 void process_keyup_event(
const SDL_Event& event)
override;
336 void init_managers();
339 void fire_prestart();
342 virtual void init_gui();
343 void finish_side_turn();
345 bool enemies_visible()
const;
347 void enter_textbox();
351 bool is_team_visible(
int team_num,
bool observer)
const;
353 int find_last_visible_team()
const;
383 std::unique_ptr<game_display>
gui_;
384 const std::unique_ptr<unit_experience_accelerator>
xp_mod_;
400 const std::string& select_music(
bool victory)
const;
402 void reset_gamestate(
const config& level,
int replay_pos);
419 virtual void check_time_over();
420 virtual void update_viewing_player() = 0;
bool player_type_changed_
virtual replay_controller * get_replay_controller() const
virtual bool should_return_to_play_side() const
std::unique_ptr< soundsource::manager > soundsources_manager_
help::help_manager help_manager_
saved_game & get_saved_game()
This class represents a single unit of a specific type.
std::unique_ptr< game_display > gui_
bool victory_when_enemies_defeated_
const unit_map & get_units() const
Note: Specific to sdl_ttf.
events::mouse_handler mouse_handler_
std::unique_ptr< plugins_context > plugins_context_
bool is_skipping_replay() const
std::unique_ptr< replay > replay_
Exception used to escape form the ai or ui code to playsingle_controller::play_side.
std::unique_ptr< hotkey_handler > hotkey_handler_
void set_do_healing(bool do_healing)
const gamemap & get_map() const
static void msg(const char *act, debug_info &i, const char *to="", const char *result="")
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 ...
bool ignore_replay_errors_
std::unique_ptr< tooltips::manager > tooltips_manager_
events::menu_handler menu_handler_
bool get_disallow_recall() const
int get_server_request_number() const
std::unique_ptr< game_state > gamestate_
bool is_lingering() const
std::vector< std::string > defeat_music_
This class stores all the data for a single 'side' (in game nomenclature).
void reset_end_level_data()
struct utils::detail::formula_initer init
const std::unique_ptr< const statistics::scenario_context > statistics_context_
bool is_linger_mode() const
Implements a quit confirmation dialog.
bool is_regular_game_end() const
Encapsulates the map of the game.
std::vector< team > & get_teams()
std::string theme() const
Encapsulates the map of the game.
actions::undo_list & get_undo_stack()
void set_end_level_data(const end_level_data &data)
virtual bool is_networked_mp() const
const actions::undo_list & undo_stack() const
hotkey::scope_changer scope_
std::shared_ptr< wb::manager > whiteboard_manager_
t_string get_scenario_name() const
Additional information on the game outcome which can be provided by WML.
std::unique_ptr< font::floating_label_context > labels_manager_
actions::undo_list & undo_stack()
const end_level_data & get_end_level_data() const
virtual void handle_generic_event(const std::string &) override
virtual bool receive_from_wesnothd(config &) const
Class to store the actions that a player can undo and redo.
void maybe_throw_return_to_play_side() const
const std::unique_ptr< unit_experience_accelerator > xp_mod_
const tod_manager & get_tod_manager() const
events::menu_handler & get_menu_handler()
int current_side() const
Returns the number of the side whose turn it is.
bool is_skipping_story() const
const game_state & gamestate() const
Container associating units to locations.
std::string get_loaded_resources() const
std::vector< std::string > victory_music_
actions::undo_list * undo_stack
const play_controller & controller_
A config object defines a single node in a WML file, with access to child nodes.
const std::vector< team > & get_teams() const
virtual void send_to_wesnothd(const config &, const std::string &="unknown") const
virtual void play_side_impl()
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()