48 struct floating_label_context;
90 bool can_undo()
const;
91 bool can_redo()
const;
99 void save_game_auto(
const std::string& filename);
101 void save_replay_auto(
const std::string& filename);
105 void init_side_begin();
110 void maybe_do_init_side();
117 void init_side_end();
119 virtual void force_end_turn() = 0;
120 virtual void check_objectives() = 0;
122 virtual void on_not_observer() = 0;
129 virtual void process_oos(
const std::string&
msg)
const;
133 gamestate().end_level_data_ = data;
138 gamestate().end_level_data_.reset();
143 return gamestate().end_level_data_.has_value();
148 return *gamestate().end_level_data_;
153 return gamestate().board_.teams();
158 return gamestate().board_.teams();
163 return gamestate().board_.units();
168 return gamestate().board_.units();
173 return gamestate().board_.map();
178 return gamestate().tod_manager_;
183 return gamestate().board_.is_observer();
188 return gamestate().do_healing_;
193 gamestate().do_healing_ = do_healing;
211 void check_victory();
213 std::size_t
turn()
const {
return gamestate().tod_manager_.turn();}
228 void toggle_skipping_replay();
234 void do_consolesave(
const std::string& filename);
239 std::shared_ptr<wb::manager> get_whiteboard()
const;
247 int get_ticks()
const;
255 bool is_browsing()
const override;
261 bool is_replay()
const {
return get_replay_controller() !=
nullptr; }
265 return level_[
"name"].t_str();
270 return level_[
"disallow_recall"].to_bool();
275 return level_[
"loaded_resources"].str();
280 return gamestate_->get_game_data()->get_theme();
285 return is_regular_game_end();
290 if(should_return_to_play_side() && !linger_ ) {
299 team& current_team();
300 const team& current_team()
const;
302 bool can_use_synced_wml_menu()
const;
303 std::set<std::string> all_players()
const;
304 int ticks()
const {
return ticks_; }
307 void update_savegame_snapshot()
const;
311 void update_gui_to_player(
const int team_index,
const bool observe =
false);
317 void refresh_objectives()
const;
318 void show_objectives()
const;
331 void play_slice_catch();
332 bool have_keyboard_focus()
override;
333 void process_focus_keydown_event(
const SDL_Event& event)
override;
334 void process_keydown_event(
const SDL_Event& event)
override;
335 void process_keyup_event(
const SDL_Event& event)
override;
337 void init_managers();
340 void fire_prestart();
343 virtual void init_gui();
344 void finish_side_turn();
346 bool enemies_visible()
const;
348 void enter_textbox();
349 void textbox_move_vertically(
bool up);
353 bool is_team_visible(
int team_num,
bool observer)
const;
355 int find_last_visible_team()
const;
385 std::unique_ptr<game_display>
gui_;
386 const std::unique_ptr<unit_experience_accelerator>
xp_mod_;
402 const std::string& select_music(
bool victory)
const;
404 void reset_gamestate(
const config& level,
int replay_pos);
413 void check_next_scenario_is_known();
426 virtual void check_time_over();
427 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
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_
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_
The help implementation caches data parsed from the game_config.
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()