#include <replay_controller.hpp>
Classes | |
class | replay_stop_condition |
Public Member Functions | |
replay_controller (play_controller &controller, bool control_view, const boost::shared_ptr< config > &reset_state, const std::function< void()> &on_end_replay=nop) | |
~replay_controller () | |
void | play_replay () |
void | stop_replay () |
void | replay_next_turn () |
void | replay_next_side () |
void | replay_next_move () |
REPLAY_RETURN | play_side_impl () |
bool | recorder_at_end () const |
bool | should_stop () const |
bool | can_execute_command (const hotkey::hotkey_command &cmd, int index) const |
bool | is_controlling_view () const |
bool | allow_reset_replay () const |
const boost::shared_ptr< config > & | get_reset_state () |
void | return_to_play_side (bool r=true) |
void | replay_show_everything () |
void | replay_show_each () |
void | replay_show_team1 () |
void | update_teams () |
void | update_viewing_player () |
Public Member Functions inherited from events::observer | |
virtual | ~observer () |
Static Public Member Functions | |
static void | nop () |
Private Types | |
enum | REPLAY_VISION { HUMAN_TEAM, CURRENT_TEAM, SHOW_ALL } |
Private Member Functions | |
void | add_replay_theme () |
void | init () |
void | update_gui () |
void | rebuild_replay_theme () |
void | handle_generic_event (const std::string &name) override |
void | reset_replay_ui () |
void | update_replay_ui () |
void | replay_ui_playback_should_start () |
void | replay_ui_playback_should_stop () |
std::shared_ptr< gui::button > | play_button () |
std::shared_ptr< gui::button > | stop_button () |
std::shared_ptr< gui::button > | reset_button () |
std::shared_ptr< gui::button > | play_turn_button () |
std::shared_ptr< gui::button > | play_side_button () |
std::shared_ptr< gui::button > | play_move_button () |
bool | replay_ui_has_all_buttons () |
Private Attributes | |
play_controller & | controller_ |
boost::scoped_ptr < replay_stop_condition > | stop_condition_ |
events::command_disabler | disabler_ |
boost::optional< REPLAY_VISION > | vision_ |
boost::shared_ptr< config > | reset_state_ |
std::function< void()> | on_end_replay_ |
bool | return_to_play_side_ |
Definition at line 25 of file replay_controller.hpp.
|
private |
Enumerator | |
---|---|
HUMAN_TEAM | |
CURRENT_TEAM | |
SHOW_ALL |
Definition at line 88 of file replay_controller.hpp.
replay_controller::replay_controller | ( | play_controller & | controller, |
bool | control_view, | ||
const boost::shared_ptr< config > & | reset_state, | ||
const std::function< void()> & | on_end_replay = nop |
||
) |
Definition at line 70 of file replay_controller.cpp.
References events::generic_event::attach_handler(), controller_, display::create_buttons(), play_controller::get_display(), display::get_theme(), HUMAN_TEAM, display::redraw_everything(), theme::theme_reset_event(), and vision_.
replay_controller::~replay_controller | ( | ) |
Definition at line 86 of file replay_controller.cpp.
References controller_, display::create_buttons(), events::generic_event::detach_handler(), play_controller::get_display(), display::get_theme(), play_controller::is_skipping_replay(), display::redraw_everything(), theme::theme_reset_event(), and play_controller::toggle_skipping_replay().
|
private |
Definition at line 96 of file replay_controller.cpp.
References config::child(), controller_, game_config_manager::get(), play_controller::get_display(), controller_base::get_theme(), display::get_theme(), display::invalidate_theme(), theme::modify(), and play_controller::theme().
Referenced by handle_generic_event().
|
inline |
Definition at line 52 of file replay_controller.hpp.
References reset_state_.
Referenced by can_execute_command().
bool replay_controller::can_execute_command | ( | const hotkey::hotkey_command & | cmd, |
int | index | ||
) | const |
Definition at line 332 of file replay_controller.cpp.
References allow_reset_replay(), events::commands_disabled, hotkey::HOTKEY_REPLAY_NEXT_MOVE, hotkey::HOTKEY_REPLAY_NEXT_SIDE, hotkey::HOTKEY_REPLAY_NEXT_TURN, hotkey::HOTKEY_REPLAY_PLAY, hotkey::HOTKEY_REPLAY_RESET, hotkey::HOTKEY_REPLAY_SHOW_EACH, hotkey::HOTKEY_REPLAY_SHOW_EVERYTHING, hotkey::HOTKEY_REPLAY_SHOW_TEAM1, hotkey::HOTKEY_REPLAY_SKIP_ANIMATION, hotkey::HOTKEY_REPLAY_STOP, hotkey::hotkey_command::id, is_controlling_view(), recorder_at_end(), and should_stop().
|
inline |
Definition at line 53 of file replay_controller.hpp.
References reset_state_.
|
overrideprivatevirtual |
Implements events::observer.
Definition at line 278 of file replay_controller.cpp.
References add_replay_theme(), controller_, display::find_action_button(), play_controller::get_display(), play_controller::is_skipping_replay(), and update_replay_ui().
|
private |
|
inline |
Definition at line 51 of file replay_controller.hpp.
References vision_.
Referenced by can_execute_command().
|
inlinestatic |
Definition at line 36 of file replay_controller.hpp.
|
private |
Definition at line 126 of file replay_controller.cpp.
References controller_, display::find_action_button(), and play_controller::get_display().
Referenced by replay_ui_has_all_buttons(), replay_ui_playback_should_start(), replay_ui_playback_should_stop(), reset_replay_ui(), and update_replay_ui().
|
private |
Definition at line 151 of file replay_controller.cpp.
References controller_, display::find_action_button(), and play_controller::get_display().
Referenced by replay_ui_playback_should_start(), replay_ui_playback_should_stop(), and update_replay_ui().
void replay_controller::play_replay | ( | ) |
Definition at line 264 of file replay_controller.cpp.
References stop_condition_.
Referenced by playsingle_controller::hotkey_handler::play_replay().
|
private |
Definition at line 146 of file replay_controller.cpp.
References controller_, display::find_action_button(), and play_controller::get_display().
Referenced by replay_ui_has_all_buttons(), replay_ui_playback_should_start(), replay_ui_playback_should_stop(), reset_replay_ui(), and update_replay_ui().
REPLAY_RETURN replay_controller::play_side_impl | ( | ) |
Definition at line 296 of file replay_controller.cpp.
References controller_, play_controller::current_side(), do_replay(), play_controller::gamestate(), on_end_replay_, controller_base::play_slice(), resources::recorder, REPLAY_FOUND_END_MOVE, REPLAY_FOUND_END_TURN, REPLAY_FOUND_INIT_TURN, REPLAY_RETURN_AT_END, replay_ui_playback_should_stop(), return_to_play_side_, stop_condition_, stop_replay(), game_state::tod_manager_, and tod_manager::turn().
|
private |
Definition at line 141 of file replay_controller.cpp.
References controller_, display::find_action_button(), and play_controller::get_display().
Referenced by replay_ui_has_all_buttons(), replay_ui_playback_should_start(), replay_ui_playback_should_stop(), reset_replay_ui(), and update_replay_ui().
|
private |
Definition at line 111 of file replay_controller.cpp.
References _(), config::child(), controller_, game_config_manager::get(), play_controller::get_display(), controller_base::get_theme(), display::get_theme(), display::invalidate_theme(), theme::modify(), theme::modify_label(), and play_controller::theme().
bool replay_controller::recorder_at_end | ( | ) | const |
Definition at line 291 of file replay_controller.cpp.
References replay::at_end(), and resources::recorder.
Referenced by can_execute_command().
void replay_controller::replay_next_move | ( | ) |
Definition at line 258 of file replay_controller.cpp.
References stop_condition_.
Referenced by playsingle_controller::hotkey_handler::replay_next_move().
void replay_controller::replay_next_side | ( | ) |
Definition at line 253 of file replay_controller.cpp.
References stop_condition_.
Referenced by playsingle_controller::hotkey_handler::replay_next_side().
void replay_controller::replay_next_turn | ( | ) |
Definition at line 248 of file replay_controller.cpp.
References controller_, play_controller::gamestate(), stop_condition_, game_state::tod_manager_, and tod_manager::turn().
Referenced by playsingle_controller::hotkey_handler::replay_next_turn().
void replay_controller::replay_show_each | ( | ) |
Definition at line 366 of file replay_controller.cpp.
References CURRENT_TEAM, update_teams(), and vision_.
Referenced by playsingle_controller::hotkey_handler::replay_show_each().
void replay_controller::replay_show_everything | ( | ) |
Definition at line 360 of file replay_controller.cpp.
References SHOW_ALL, update_teams(), and vision_.
Referenced by playsingle_controller::hotkey_handler::replay_show_everything().
void replay_controller::replay_show_team1 | ( | ) |
Definition at line 372 of file replay_controller.cpp.
References HUMAN_TEAM, update_teams(), and vision_.
Referenced by playsingle_controller::hotkey_handler::replay_show_team1().
|
inlineprivate |
Definition at line 80 of file replay_controller.hpp.
References play_button(), play_side_button(), play_turn_button(), reset_button(), and stop_button().
Referenced by replay_ui_playback_should_start(), replay_ui_playback_should_stop(), reset_replay_ui(), and update_replay_ui().
|
private |
Definition at line 191 of file replay_controller.cpp.
References play_button(), play_move_button(), play_side_button(), play_turn_button(), replay_ui_has_all_buttons(), and reset_button().
|
private |
Definition at line 203 of file replay_controller.cpp.
References play_button(), play_move_button(), play_side_button(), play_turn_button(), resources::recorder, replay_ui_has_all_buttons(), reset_button(), stop_button(), and stop_condition_.
Referenced by play_side_impl().
|
private |
Definition at line 136 of file replay_controller.cpp.
References controller_, display::find_action_button(), and play_controller::get_display().
Referenced by replay_ui_has_all_buttons(), replay_ui_playback_should_start(), replay_ui_playback_should_stop(), reset_replay_ui(), and update_replay_ui().
|
private |
Definition at line 230 of file replay_controller.cpp.
References play_button(), play_side_button(), play_turn_button(), replay_ui_has_all_buttons(), reset_button(), and stop_button().
|
inline |
Definition at line 54 of file replay_controller.hpp.
References return_to_play_side_.
|
inline |
Definition at line 49 of file replay_controller.hpp.
References stop_condition_.
Referenced by can_execute_command().
|
private |
Definition at line 131 of file replay_controller.cpp.
References controller_, display::find_action_button(), and play_controller::get_display().
Referenced by replay_ui_has_all_buttons(), replay_ui_playback_should_stop(), reset_replay_ui(), and update_replay_ui().
void replay_controller::stop_replay | ( | ) |
Definition at line 243 of file replay_controller.cpp.
References stop_condition_.
Referenced by play_side_impl(), and playsingle_controller::hotkey_handler::stop_replay().
|
private |
Definition at line 269 of file replay_controller.cpp.
References controller_, display::draw(), play_controller::get_display(), display::invalidate_all(), events::raise_draw_event(), display::recalculate_minimap(), and display::redraw_minimap().
Referenced by update_teams().
|
private |
Definition at line 156 of file replay_controller.cpp.
References play_button(), play_move_button(), play_side_button(), play_turn_button(), replay_ui_has_all_buttons(), reset_button(), and stop_button().
Referenced by handle_generic_event().
void replay_controller::update_teams | ( | ) |
Definition at line 378 of file replay_controller.cpp.
References controller_, play_controller::get_display(), display::invalidate_all(), update_gui(), and update_viewing_player().
Referenced by replay_show_each(), replay_show_everything(), and replay_show_team1().
void replay_controller::update_viewing_player | ( | ) |
Definition at line 385 of file replay_controller.cpp.
References controller_, play_controller::current_side(), game_state::first_human_team_, play_controller::gamestate(), HUMAN_TEAM, SHOW_ALL, play_controller::update_gui_to_player(), and vision_.
Referenced by update_teams().
|
private |
Definition at line 84 of file replay_controller.hpp.
Referenced by add_replay_theme(), handle_generic_event(), play_button(), play_move_button(), play_side_button(), play_side_impl(), play_turn_button(), rebuild_replay_theme(), replay_controller(), replay_next_turn(), reset_button(), stop_button(), update_gui(), update_teams(), update_viewing_player(), and ~replay_controller().
|
private |
Definition at line 86 of file replay_controller.hpp.
|
private |
Definition at line 96 of file replay_controller.hpp.
Referenced by play_side_impl().
|
private |
Definition at line 95 of file replay_controller.hpp.
Referenced by allow_reset_replay(), and get_reset_state().
|
private |
Definition at line 97 of file replay_controller.hpp.
Referenced by play_side_impl(), and return_to_play_side().
|
private |
Definition at line 85 of file replay_controller.hpp.
Referenced by play_replay(), play_side_impl(), replay_next_move(), replay_next_side(), replay_next_turn(), replay_ui_playback_should_stop(), should_stop(), and stop_replay().
|
private |
Definition at line 94 of file replay_controller.hpp.
Referenced by is_controlling_view(), replay_controller(), replay_show_each(), replay_show_everything(), replay_show_team1(), and update_viewing_player().