#include "synced_commands.hpp"
#include <cassert>
#include "log.hpp"
#include "map/location.hpp"
#include "game_data.hpp"
#include "units/unit.hpp"
#include "team.hpp"
#include "play_controller.hpp"
#include "actions/create.hpp"
#include "actions/advancement.hpp"
#include "actions/attack.hpp"
#include "actions/move.hpp"
#include "actions/undo.hpp"
#include "preferences/preferences.hpp"
#include "game_events/pump.hpp"
#include "map/map.hpp"
#include "recall_list_manager.hpp"
#include "resources.hpp"
#include "savegame.hpp"
#include "scripting/game_lua_kernel.hpp"
#include "formula/string_utils.hpp"
#include "units/types.hpp"
#include "units/udisplay.hpp"
#include "whiteboard/manager.hpp"
#include "font/standard_colors.hpp"
Go to the source code of this file.
Macros | |
#define | DBG_REPLAY LOG_STREAM(debug, log_replay) |
#define | LOG_REPLAY LOG_STREAM(info, log_replay) |
#define | WRN_REPLAY LOG_STREAM(warn, log_replay) |
#define | ERR_REPLAY LOG_STREAM(err, log_replay) |
Variables | |
static lg::log_domain | log_replay ("replay") |
#define DBG_REPLAY LOG_STREAM(debug, log_replay) |
Definition at line 44 of file synced_commands.cpp.
#define ERR_REPLAY LOG_STREAM(err, log_replay) |
Definition at line 47 of file synced_commands.cpp.
#define LOG_REPLAY LOG_STREAM(info, log_replay) |
Definition at line 45 of file synced_commands.cpp.
#define WRN_REPLAY LOG_STREAM(warn, log_replay) |
Definition at line 46 of file synced_commands.cpp.
SYNCED_COMMAND_HANDLER_FUNCTION | ( | attack | , |
child | , | ||
spectator | |||
) |
Definition at line 149 of file synced_commands.cpp.
References attack_unit_and_advance(), synced_context::block_undo(), resources::controller, DBG_REPLAY, dst, unit_map::find(), resources::gameboard, resources::gamedata, play_controller::is_skipping_replay(), LOG_REPLAY, gui2::dialogs::tip::show(), src, game_board::units(), unit_map::iterator_base< iter_types >::valid(), and WRN_REPLAY.
SYNCED_COMMAND_HANDLER_FUNCTION | ( | auto_shroud | , |
child | |||
) |
Definition at line 346 of file synced_commands.cpp.
References actions::undo_list::add_auto_shroud(), team::auto_shroud_updates(), actions::undo_list::commit_vision(), resources::controller, play_controller::current_team(), team::set_auto_shroud_updates(), and resources::undo_stack.
SYNCED_COMMAND_HANDLER_FUNCTION | ( | custom_command | , |
child | |||
) |
Definition at line 333 of file synced_commands.cpp.
References actions::undo_list::add_dummy(), synced_context::block_undo(), game_lua_kernel::custom_command(), resources::lua_kernel, synced_context::undo_blocked(), and resources::undo_stack.
SYNCED_COMMAND_HANDLER_FUNCTION | ( | debug_create_unit | , |
child | , | ||
spectator | |||
) |
Definition at line 514 of file synced_commands.cpp.
References actions::actor_sighted(), synced_context::block_undo(), actions::shroud_clearer::clear_unit(), resources::controller, unit::create(), play_controller::current_side(), unit_type_data::find(), game_events::wml_event_pump::fire(), actions::shroud_clearer::fire_events(), resources::game_events, resources::gameboard, game_display::get_singleton(), actions::get_village(), game_display::invalidate_unit(), N_, unit_race::NUM_GENDERS, game_events::manager::pump(), unit_map::replace(), string_gender(), unit_display::unit_recruited(), unit_types, game_board::units(), unit_map::iterator_base< iter_types >::valid(), and resources::whiteboard.
SYNCED_COMMAND_HANDLER_FUNCTION | ( | debug_event | , |
child | |||
) |
Definition at line 691 of file synced_commands.cpp.
References synced_context::block_undo(), resources::controller, game_events::wml_event_pump::fire(), display::get_singleton(), play_controller::pump(), and display::queue_rerender().
SYNCED_COMMAND_HANDLER_FUNCTION | ( | debug_fog | ) |
Definition at line 704 of file synced_commands.cpp.
References synced_context::block_undo(), resources::controller, play_controller::current_team(), display::get_singleton(), display::queue_rerender(), actions::recalculate_fog(), display::recalculate_minimap(), team::set_fog(), team::side(), and team::uses_fog().
SYNCED_COMMAND_HANDLER_FUNCTION | ( | debug_gold | , |
child | |||
) |
Definition at line 679 of file synced_commands.cpp.
References synced_context::block_undo(), resources::controller, play_controller::current_team(), display::get_singleton(), display::queue_rerender(), and team::spend_gold().
SYNCED_COMMAND_HANDLER_FUNCTION | ( | debug_kill | , |
child | |||
) |
Definition at line 589 of file synced_commands.cpp.
References synced_context::block_undo(), resources::controller, unit_map::erase(), unit_map::find(), game_events::wml_event_pump::fire(), resources::gameboard, display::get_singleton(), i, play_controller::pump(), actions::recalculate_fog(), display::redraw_minimap(), unit_display::unit_die(), game_board::units(), and resources::whiteboard.
SYNCED_COMMAND_HANDLER_FUNCTION | ( | debug_lua | , |
child | |||
) |
Definition at line 560 of file synced_commands.cpp.
References synced_context::block_undo(), resources::controller, game_events::wml_event_pump::flush_messages(), resources::lua_kernel, play_controller::pump(), and lua_kernel_base::run().
SYNCED_COMMAND_HANDLER_FUNCTION | ( | debug_next_level | , |
child | |||
) |
Definition at line 616 of file synced_commands.cpp.
References synced_context::block_undo(), resources::controller, e, play_controller::force_end_turn(), resources::gamedata, play_controller::set_end_level_data(), and game_data::set_next_scenario().
SYNCED_COMMAND_HANDLER_FUNCTION | ( | debug_set_var | , |
child | |||
) |
Definition at line 663 of file synced_commands.cpp.
References synced_context::block_undo(), resources::gamedata, and game_data::set_variable().
SYNCED_COMMAND_HANDLER_FUNCTION | ( | debug_shroud | ) |
Definition at line 721 of file synced_commands.cpp.
References synced_context::block_undo(), actions::clear_shroud(), resources::controller, play_controller::current_team(), display::get_singleton(), display::queue_rerender(), display::recalculate_minimap(), team::set_shroud(), team::side(), and team::uses_shroud().
SYNCED_COMMAND_HANDLER_FUNCTION | ( | debug_teleport | , |
child | |||
) |
Definition at line 570 of file synced_commands.cpp.
References synced_context::block_undo(), unit_map::find(), resources::gameboard, display::get_singleton(), display::redraw_minimap(), actions::teleport_unit_from_replay(), game_board::units(), and unit_map::iterator_base< iter_types >::valid().
SYNCED_COMMAND_HANDLER_FUNCTION | ( | debug_terrain | , |
child | |||
) |
Definition at line 427 of file synced_commands.cpp.
References synced_context::block_undo(), game_board::change_terrain(), resources::gameboard, display::get_singleton(), game_display::get_singleton(), display::invalidate(), game_display::maybe_rebuild(), and game_display::needs_rebuild().
SYNCED_COMMAND_HANDLER_FUNCTION | ( | debug_turn | , |
child | |||
) |
Definition at line 649 of file synced_commands.cpp.
References synced_context::block_undo(), resources::gamedata, display::get_singleton(), game_display::get_singleton(), game_display::new_turn(), display::queue_rerender(), tod_manager::set_turn(), and resources::tod_manager.
SYNCED_COMMAND_HANDLER_FUNCTION | ( | debug_turn_limit | , |
child | |||
) |
Definition at line 638 of file synced_commands.cpp.
References synced_context::block_undo(), display::get_singleton(), display::queue_rerender(), tod_manager::set_number_of_turns(), and resources::tod_manager.
SYNCED_COMMAND_HANDLER_FUNCTION | ( | debug_unit | , |
child | |||
) |
Definition at line 445 of file synced_commands.cpp.
References advance_unit_at(), synced_context::block_undo(), unit::create(), e, unit_map::erase(), ERR_REPLAY, unit_map::find(), resources::gameboard, display::get_singleton(), game_display::get_singleton(), i, unit_map::insert(), display::invalidate(), game_display::invalidate_unit(), utils::split(), game_board::units(), resources::whiteboard, and WRN_REPLAY.
SYNCED_COMMAND_HANDLER_FUNCTION | ( | disband | , |
child | , | ||
spectator | |||
) |
Definition at line 231 of file synced_commands.cpp.
References actions::undo_list::add_dismissal(), resources::controller, play_controller::current_team(), recall_list_manager::erase_if_matches_id(), recall_list_manager::find_if_matches_id(), team::recall_list(), recall_list_manager::size(), and resources::undo_stack.
SYNCED_COMMAND_HANDLER_FUNCTION | ( | fire_event | , |
child | |||
) |
Definition at line 310 of file synced_commands.cpp.
References actions::undo_list::add_dummy(), synced_context::block_undo(), game_events::wml_event_pump::fire(), resources::game_events, resources::gamedata, events::pump(), game_events::manager::pump(), synced_context::undo_blocked(), and resources::undo_stack.
SYNCED_COMMAND_HANDLER_FUNCTION | ( | move | , |
child | , | ||
spectator | |||
) |
Definition at line 257 of file synced_commands.cpp.
References resources::controller, play_controller::current_team(), dst, actions::execute_move_unit(), unit_map::find(), game_board::find_visible_unit(), resources::gameboard, read_locations(), src, game_board::units(), unit_map::iterator_base< iter_types >::valid(), and WRN_REPLAY.
SYNCED_COMMAND_HANDLER_FUNCTION | ( | recall | , |
child | , | ||
spectator | |||
) |
Definition at line 132 of file synced_commands.cpp.
References resources::controller, play_controller::current_side(), resources::gameboard, resources::gamedata, game_board::get_team(), map_location::indeterminate, and actions::recall_unit().
SYNCED_COMMAND_HANDLER_FUNCTION | ( | recruit | , |
child | , | ||
spectator | |||
) |
Definition at line 68 of file synced_commands.cpp.
References resources::controller, unit_type::cost(), play_controller::current_side(), unit_type_data::find(), actions::find_recruit_location(), resources::gameboard, resources::gamedata, game_board::get_team(), team::gold(), LOG_REPLAY, actions::recruit_unit(), unit_types, and map_location::valid().
SYNCED_COMMAND_HANDLER_FUNCTION | ( | update_shroud | , |
spectator | |||
) |
Definition at line 361 of file synced_commands.cpp.
References actions::undo_list::add_update_shroud(), team::auto_shroud_updates(), synced_context::block_undo(), actions::undo_list::commit_vision(), resources::controller, play_controller::current_team(), and resources::undo_stack.
|
static |