48 struct floating_label_context;
86 bool start_faded =
false);
93 bool can_undo()
const;
94 bool can_redo()
const;
102 void save_game_auto(
const std::string& filename);
104 void save_replay_auto(
const std::string& filename);
108 void init_side_begin();
113 void maybe_do_init_side();
120 void init_side_end();
122 virtual void force_end_turn() = 0;
123 virtual void check_objectives() = 0;
125 virtual void on_not_observer() = 0;
132 virtual void process_oos(
const std::string&
msg)
const;
136 gamestate().end_level_data_ =
data;
141 gamestate().end_level_data_.reset();
146 return gamestate().end_level_data_.has_value();
149 bool check_regular_game_end();
153 return *gamestate().end_level_data_;
158 return gamestate().board_.teams();
163 return gamestate().board_.teams();
168 return gamestate().board_.units();
173 return gamestate().board_.units();
178 return gamestate().board_.map();
183 return gamestate().tod_manager_;
188 return gamestate().board_.is_observer();
193 return gamestate().do_healing_;
198 gamestate().do_healing_ = do_healing;
216 void check_victory();
218 std::size_t
turn()
const {
return gamestate().tod_manager_.turn();}
233 void toggle_skipping_replay();
238 void do_consolesave(
const std::string& filename);
243 std::shared_ptr<wb::manager> get_whiteboard()
const;
251 int get_ticks()
const;
259 bool is_browsing()
const override;
264 bool is_replay()
const {
return get_replay_controller() !=
nullptr; }
268 return level_[
"name"].t_str();
273 return level_[
"disallow_recall"].to_bool();
278 return level_[
"loaded_resources"].str();
283 return gamestate_->get_game_data()->get_theme();
288 return is_regular_game_end();
291 void maybe_throw_return_to_play_side()
const;
297 team& current_team();
298 const team& current_team()
const;
300 bool can_use_synced_wml_menu()
const;
301 std::set<std::string> all_players()
const;
302 int ticks()
const {
return ticks_; }
305 void update_savegame_snapshot()
const;
309 void update_gui_to_player(
const int team_index,
const bool observe =
false);
315 void refresh_objectives()
const;
316 void show_objectives()
const;
327 bool is_during_turn()
const;
328 bool is_linger_mode()
const;
332 void play_slice_catch();
333 bool have_keyboard_focus()
override;
334 void process_focus_keydown_event(
const SDL_Event& event)
override;
335 void process_keydown_event(
const SDL_Event& event)
override;
336 void process_keyup_event(
const SDL_Event& event)
override;
338 void init_managers();
341 void fire_prestart();
344 virtual void init_gui();
345 void finish_side_turn_events();
347 bool enemies_visible()
const;
349 void enter_textbox();
350 void textbox_move_vertically(
bool up);
354 bool is_team_visible(
int team_num,
bool observer)
const;
356 int find_last_visible_team()
const;
386 std::unique_ptr<game_display>
gui_;
387 const std::unique_ptr<unit_experience_accelerator>
xp_mod_;
406 const std::string& select_music(
bool victory)
const;
408 void reset_gamestate(
const config& level,
int replay_pos);
417 void check_next_scenario_is_known();
436 virtual void check_time_over();
437 virtual void update_viewing_player() = 0;
bool player_type_changed_
true when the controller of the currently playing side has 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
Collection of helper functions relating to Pango formatting.
events::mouse_handler mouse_handler_
std::unique_ptr< plugins_context > plugins_context_
bool is_skipping_replay() const
std::unique_ptr< replay > replay_
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_
bool did_autosave_this_turn_
Whether we did init sides in this session (false = we did init sides before we reloaded the game)...
events::menu_handler menu_handler_
bool get_disallow_recall() const
int get_server_request_number() const
std::unique_ptr< game_state > gamestate_
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_
const hotkey::scope_changer scope_
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
void pump()
Process all events currently in the queue.
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
std::shared_ptr< wb::manager > whiteboard_manager_
The help implementation caches data parsed from the game_config.
bool did_tod_sound_this_turn_
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
tooltips::manager tooltips_manager_
Class to store the actions that a player can undo and redo.
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 remove_from_carryover_on_defeat_
void increase_server_request_number()
virtual void sync_end_turn()