26 #include <boost/scoped_ptr.hpp>
29 #define DBG_NG LOG_STREAM(debug, log_engine)
32 #define DBG_REPLAY LOG_STREAM(debug, log_replay)
33 #define LOG_REPLAY LOG_STREAM(info, log_replay)
34 #define ERR_REPLAY LOG_STREAM(err, log_replay)
40 replay_play_nostop() {}
47 replay_play_moves(
int moves_todo) : moves_todo_(moves_todo) {}
48 virtual void move_done() { --moves_todo_; }
49 virtual bool should_stop() {
return moves_todo_ == 0; }
56 replay_play_turn(
int turn_begin) : turn_begin_(turn_begin), turn_current_(turn_begin) {}
57 virtual void new_side_turn(
int ,
int turn) { turn_current_ = turn; }
58 virtual bool should_stop() {
return turn_begin_ != turn_current_; }
64 replay_play_side() : next_side_(
false) {}
71 : controller_(controller)
75 , reset_state_(reset_state)
76 , on_end_replay_(on_end_replay)
77 , return_to_play_side_(false)
166 play_b->enable(
false);
170 stop_b->enable(
false);
174 reset_b->enable(
false);
178 play_turn_b->enable(
false);
182 play_side_b->enable(
false);
186 play_move_b->enable(
false);
281 if( name ==
"completely_redrawn" ) {
static const config & get_theme(const config &game_config, std::string theme_name)
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_
boost::optional< REPLAY_VISION > vision_
void replay_ui_playback_should_stop()
bool return_to_play_side_
static lg::log_domain log_engine("engine")
void redraw_everything()
Invalidates entire screen, including all tiles and sidebar.
Stores all information related to functions that can be bound to hotkeys.
void play_slice(bool is_delay_enabled=true)
bool is_skipping_replay() const
virtual void draw()
Draws invalidated items.
REPLAY_RETURN do_replay(bool one_move)
bool is_controlling_view() const
void redraw_minimap()
Schedule the minimap to be redrawn.
std::shared_ptr< gui::button > play_button()
bool recorder_at_end() const
boost::scoped_ptr< replay_stop_condition > stop_condition_
void handle_generic_event(const std::string &name) override
static game_config_manager * get()
static UNUSEDNOWARN std::string _(const char *str)
int current_side() const
Returns the number of the side whose turn it is.
std::shared_ptr< gui::button > play_turn_button()
void recalculate_minimap()
Schedule the minimap for recalculation.
events::generic_event & theme_reset_event()
std::shared_ptr< gui::button > stop_button()
void modify(const config &cfg)
void replay_show_everything()
virtual void new_side_turn(int, int)
REPLAY_RETURN play_side_impl()
replay_controller(play_controller &controller, bool control_view, const boost::shared_ptr< config > &reset_state, const std::function< void()> &on_end_replay=nop)
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.
bool allow_reset_replay() const
virtual bool should_stop()
virtual bool attach_handler(observer *obs)
void rebuild_replay_theme()
static lg::log_domain log_replay("replay")
Game configuration data as global variables.
void modify_label(const std::string &id, const std::string &text)
bool replay_ui_has_all_buttons()
GLuint const GLchar * name
std::shared_ptr< gui::button > play_side_button()
void replay_ui_playback_should_start()
const hotkey::HOTKEY_COMMAND id
the names are strange: the "hotkey::HOTKEY_COMMAND" is named id, and the string to identify the objec...
void toggle_skipping_replay()
config & child(const std::string &key, int n=0)
Returns the nth child with the given key, or a reference to an invalid config if there is none...
play_controller & controller_
Standard logging facilities (interface).
game_display & get_display()
Get a reference to a display member a derived class uses.
virtual bool detach_handler(observer *obs)
A config object defines a single node in a WML file, with access to child nodes.
bool can_execute_command(const hotkey::hotkey_command &cmd, int index) const
std::shared_ptr< gui::button > reset_button()
GLsizei const GLcharARB ** string
std::shared_ptr< gui::button > play_move_button()