23 #define DBG_NG LOG_STREAM(debug, log_engine)
26 #define DBG_REPLAY LOG_STREAM(debug, log_replay)
27 #define LOG_REPLAY LOG_STREAM(info, log_replay)
28 #define ERR_REPLAY LOG_STREAM(err, log_replay)
34 replay_play_nostop() {}
41 replay_play_moves(
int moves_todo) : moves_todo_(moves_todo) {}
42 virtual void move_done() { --moves_todo_; }
43 virtual bool should_stop() {
return moves_todo_ == 0; }
50 replay_play_turn(
int turn_begin) : turn_begin_(turn_begin), turn_current_(turn_begin) {}
51 virtual void new_side_turn(
int ,
int turn) { turn_current_ = turn; }
52 virtual bool should_stop() {
return turn_begin_ != turn_current_; }
58 replay_play_side() : next_side_(
false) {}
69 , reset_state_(reset_state)
70 , on_end_replay_(on_end_replay)
71 , return_to_play_side_(false)
92 if (
const auto replay_theme_cfg = res->optional_child(
"replay")) {
142 if(name ==
"theme_reset") {
252 if(viewing_side_num != 0) {
A config object defines a single node in a WML file, with access to child nodes.
optional_config_impl< config > optional_child(config_key_type key, int n=0)
Equivalent to mandatory_child, but returns an empty optional if the nth child was not found.
virtual void play_slice()
std::shared_ptr< gui::button > find_action_button(const std::string &id)
Retrieves a pointer to a theme UI button.
void invalidate_all()
Function to invalidate all tiles.
void queue_rerender()
Marks everything for rendering including all tiles and sidebar.
virtual bool attach_handler(observer *obs)
virtual bool detach_handler(observer *obs)
virtual int find_viewing_side() const =0
returns 0 if no such team was found.
bool is_regular_game_end() const
game_display & get_display() override
Get a reference to a display member a derived class uses.
void toggle_skipping_replay()
std::string theme() const
int current_side() const
Returns the number of the side whose turn it is.
bool is_skipping_replay() const
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 new_side_turn(int, int)
virtual bool should_stop()
replay_controller(play_controller &controller, bool control_view, const std::shared_ptr< config > &reset_state, const std::function< void()> &on_end_replay=nop)
void replay_show_everything()
bool recorder_at_end() const
void update_viewing_player()
play_controller & controller_
void handle_generic_event(const std::string &name) override
bool is_controlling_view() const
utils::optional< REPLAY_VISION > vision_
std::function< void()> on_end_replay_
Called when there are no more moves in the [replay] to process.
std::unique_ptr< replay_stop_condition > stop_condition_
bool can_execute_command(const hotkey::ui_command &cmd) const
bool allow_reset_replay() const
bool return_to_play_side_
Used by unit tests.
void update_enabled_buttons()
Refresh the states of the replay-control buttons, this will cause the hotkey framework to query can_e...
static NOT_DANGLING const config & get_theme_config(const std::string &id)
Returns the saved config for the theme with the given ID.
events::generic_event & theme_reset_event()
void modify(const config &cfg)
Standard logging facilities (interface).
@ HOTKEY_REPLAY_NEXT_TURN
@ HOTKEY_REPLAY_SHOW_EVERYTHING
@ HOTKEY_REPLAY_SHOW_TEAM1
@ HOTKEY_REPLAY_NEXT_SIDE
@ HOTKEY_REPLAY_NEXT_MOVE
@ HOTKEY_REPLAY_SKIP_ANIMATION
@ HOTKEY_REPLAY_SHOW_EACH
REPLAY_RETURN do_replay(bool one_move)
static lg::log_domain log_engine("engine")
static lg::log_domain log_replay("replay")
Used as the main paramneter for can_execute_command/do_execute_command These functions are used to ex...
hotkey::HOTKEY_COMMAND hotkey_command
The hotkey::HOTKEY_COMMAND associated with this action, HOTKEY_NULL for actions that don't allow hotk...