25 #define DBG_NG LOG_STREAM(debug, log_engine) 28 #define DBG_REPLAY LOG_STREAM(debug, log_replay) 29 #define LOG_REPLAY LOG_STREAM(info, log_replay) 30 #define ERR_REPLAY LOG_STREAM(err, log_replay) 36 replay_play_nostop() {}
43 replay_play_moves(
int moves_todo) : moves_todo_(moves_todo) {}
44 virtual void move_done() { --moves_todo_; }
45 virtual bool should_stop() {
return moves_todo_ == 0; }
52 replay_play_turn(
int turn_begin) : turn_begin_(turn_begin), turn_current_(turn_begin) {}
53 virtual void new_side_turn(
int ,
int turn) { turn_current_ = turn; }
54 virtual bool should_stop() {
return turn_begin_ != turn_current_; }
60 replay_play_side() : next_side_(
false) {}
61 virtual void new_side_turn(
int ,
int) { next_side_ =
true; }
62 virtual bool should_stop() {
return next_side_; }
67 : controller_(controller)
71 , reset_state_(reset_state)
72 , on_end_replay_(on_end_replay)
73 , return_to_play_side_(false)
94 if (
const auto replay_theme_cfg = res->optional_child(
"replay")) {
144 if(name ==
"theme_reset") {
std::shared_ptr< gui::button > find_action_button(const std::string &id)
Retrieves a pointer to a theme UI button.
std::function< void()> on_end_replay_
void queue_rerender()
Marks everything for rendering including all tiles and sidebar.
replay_controller(play_controller &controller, bool control_view, const std::shared_ptr< config > &reset_state, const std::function< void()> &on_end_replay=nop)
bool is_skipping_replay() const
bool return_to_play_side_
static lg::log_domain log_engine("engine")
game_display & get_display() override
Get a reference to a display member a derived class uses.
Stores all information related to functions that can be bound to hotkeys.
virtual void play_slice(bool is_delay_enabled=true)
HOTKEY_COMMAND command
The command associated with this hotkey.
REPLAY_RETURN do_replay(bool one_move)
bool recorder_at_end() const
void handle_generic_event(const std::string &name) override
static const config & get_theme_config(const std::string &id)
Returns the saved config for the theme with the given ID.
std::unique_ptr< replay_stop_condition > stop_condition_
std::optional< REPLAY_VISION > vision_
events::generic_event & theme_reset_event()
void update_enabled_buttons()
Refresh the states of the replay-control buttons, this will cause the hotkey framework to query can_e...
void modify(const config &cfg)
void replay_show_everything()
std::string theme() const
utils::optional_reference< config > optional_child(config_key_type key, int n=0)
Euivalent to child, but returns an empty optional if the nth child was not found. ...
REPLAY_RETURN play_side_impl()
void invalidate_all()
Function to invalidate all tiles.
void update_viewing_player()
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 bool should_stop()
bool allow_reset_replay() const
virtual bool attach_handler(observer *obs)
bool can_execute_command(const hotkey::hotkey_command &cmd, int index) const
static lg::log_domain log_replay("replay")
void toggle_skipping_replay()
play_controller & controller_
bool is_controlling_view() const
Standard logging facilities (interface).
int current_side() const
Returns the number of the side whose turn it is.
virtual bool detach_handler(observer *obs)
A config object defines a single node in a WML file, with access to child nodes.