#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/general.hpp"
#include "preferences/game.hpp"
#include "game_events/pump.hpp"
#include "map/map.hpp"
#include "units/helper.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) |
Functions | |
SYNCED_COMMAND_HANDLER_FUNCTION (recruit, child, use_undo, show, error_handler) | |
SYNCED_COMMAND_HANDLER_FUNCTION (recall, child, use_undo, show, error_handler) | |
SYNCED_COMMAND_HANDLER_FUNCTION (attack, child,, show, error_handler) | |
SYNCED_COMMAND_HANDLER_FUNCTION (disband, child,,, error_handler) | |
SYNCED_COMMAND_HANDLER_FUNCTION (move, child, use_undo, show, error_handler) | |
SYNCED_COMMAND_HANDLER_FUNCTION (fire_event, child, use_undo,,) | |
SYNCED_COMMAND_HANDLER_FUNCTION (custom_command, child, use_undo,,) | |
SYNCED_COMMAND_HANDLER_FUNCTION (auto_shroud, child, use_undo,,) | |
SYNCED_COMMAND_HANDLER_FUNCTION (update_shroud,, use_undo,, error_handler) | |
SYNCED_COMMAND_HANDLER_FUNCTION (debug_terrain, child, use_undo,,) | |
SYNCED_COMMAND_HANDLER_FUNCTION (debug_unit, child, use_undo,,) | |
SYNCED_COMMAND_HANDLER_FUNCTION (debug_create_unit, child, use_undo,, error_handler) | |
SYNCED_COMMAND_HANDLER_FUNCTION (debug_lua, child, use_undo,,) | |
SYNCED_COMMAND_HANDLER_FUNCTION (debug_kill, child, use_undo,,) | |
SYNCED_COMMAND_HANDLER_FUNCTION (debug_next_level, child, use_undo,,) | |
SYNCED_COMMAND_HANDLER_FUNCTION (debug_turn_limit, child, use_undo,,) | |
SYNCED_COMMAND_HANDLER_FUNCTION (debug_turn, child, use_undo,,) | |
SYNCED_COMMAND_HANDLER_FUNCTION (debug_set_var, child, use_undo,,) | |
SYNCED_COMMAND_HANDLER_FUNCTION (debug_gold, child, use_undo,,) | |
SYNCED_COMMAND_HANDLER_FUNCTION (debug_event, child, use_undo,,) | |
SYNCED_COMMAND_HANDLER_FUNCTION (debug_fog,, use_undo,,) | |
SYNCED_COMMAND_HANDLER_FUNCTION (debug_shroud,, use_undo,,) | |
Variables | |
static lg::log_domain | log_replay ("replay") |
#define DBG_REPLAY LOG_STREAM(debug, log_replay) |
Definition at line 46 of file synced_commands.cpp.
#define ERR_REPLAY LOG_STREAM(err, log_replay) |
Definition at line 49 of file synced_commands.cpp.
#define LOG_REPLAY LOG_STREAM(info, log_replay) |
Definition at line 47 of file synced_commands.cpp.
#define WRN_REPLAY LOG_STREAM(warn, log_replay) |
Definition at line 48 of file synced_commands.cpp.
SYNCED_COMMAND_HANDLER_FUNCTION | ( | attack | , |
child | , | ||
show | , | ||
error_handler | |||
) |
Definition at line 152 of file synced_commands.cpp.
References attack_unit_and_advance(), actions::undo_list::clear(), DBG_REPLAY, unit_map::find(), resources::gameboard, resources::gamedata, LOG_REPLAY, gui2::dialogs::tip::show(), resources::undo_stack, game_board::units(), unit_map::iterator_base< iter_types >::valid(), and WRN_REPLAY.
SYNCED_COMMAND_HANDLER_FUNCTION | ( | auto_shroud | , |
child | , | ||
use_undo | |||
) |
Definition at line 367 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 | , | ||
use_undo | |||
) |
Definition at line 353 of file synced_commands.cpp.
References actions::undo_list::add_dummy(), actions::undo_list::clear(), game_lua_kernel::custom_command(), resources::lua_kernel, synced_context::undo_blocked(), and resources::undo_stack.
SYNCED_COMMAND_HANDLER_FUNCTION | ( | debug_create_unit | , |
child | , | ||
use_undo | , | ||
error_handler | |||
) |
Definition at line 541 of file synced_commands.cpp.
References actions::actor_sighted(), actions::undo_list::clear(), 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(), resources::undo_stack, 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 | , | ||
use_undo | |||
) |
Definition at line 715 of file synced_commands.cpp.
References actions::undo_list::clear(), resources::controller, game_events::wml_event_pump::fire(), display::get_singleton(), play_controller::pump(), display::queue_rerender(), and resources::undo_stack.
SYNCED_COMMAND_HANDLER_FUNCTION | ( | debug_fog | , |
use_undo | |||
) |
Definition at line 730 of file synced_commands.cpp.
References actions::undo_list::clear(), resources::controller, play_controller::current_team(), display::get_singleton(), display::queue_rerender(), actions::recalculate_fog(), display::recalculate_minimap(), team::set_fog(), team::side(), resources::undo_stack, and team::uses_fog().
SYNCED_COMMAND_HANDLER_FUNCTION | ( | debug_gold | , |
child | , | ||
use_undo | |||
) |
Definition at line 701 of file synced_commands.cpp.
References actions::undo_list::clear(), resources::controller, play_controller::current_team(), display::get_singleton(), display::queue_rerender(), team::spend_gold(), and resources::undo_stack.
SYNCED_COMMAND_HANDLER_FUNCTION | ( | debug_kill | , |
child | , | ||
use_undo | |||
) |
Definition at line 601 of file synced_commands.cpp.
References actions::undo_list::clear(), 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(), resources::undo_stack, unit_display::unit_die(), game_board::units(), and resources::whiteboard.
SYNCED_COMMAND_HANDLER_FUNCTION | ( | debug_lua | , |
child | , | ||
use_undo | |||
) |
Definition at line 589 of file synced_commands.cpp.
References actions::undo_list::clear(), resources::controller, game_events::wml_event_pump::flush_messages(), resources::lua_kernel, play_controller::pump(), lua_kernel_base::run(), and resources::undo_stack.
SYNCED_COMMAND_HANDLER_FUNCTION | ( | debug_next_level | , |
child | , | ||
use_undo | |||
) |
Definition at line 630 of file synced_commands.cpp.
References actions::undo_list::clear(), resources::controller, e, play_controller::force_end_turn(), resources::gamedata, play_controller::set_end_level_data(), game_data::set_next_scenario(), and resources::undo_stack.
SYNCED_COMMAND_HANDLER_FUNCTION | ( | debug_set_var | , |
child | , | ||
use_undo | |||
) |
Definition at line 683 of file synced_commands.cpp.
References actions::undo_list::clear(), resources::gamedata, game_data::set_variable(), and resources::undo_stack.
SYNCED_COMMAND_HANDLER_FUNCTION | ( | debug_shroud | , |
use_undo | |||
) |
Definition at line 749 of file synced_commands.cpp.
References actions::undo_list::clear(), actions::clear_shroud(), resources::controller, play_controller::current_team(), display::get_singleton(), display::queue_rerender(), display::recalculate_minimap(), team::set_shroud(), team::side(), resources::undo_stack, and team::uses_shroud().
SYNCED_COMMAND_HANDLER_FUNCTION | ( | debug_terrain | , |
child | , | ||
use_undo | |||
) |
Definition at line 450 of file synced_commands.cpp.
References game_board::change_terrain(), actions::undo_list::clear(), resources::gameboard, display::get_singleton(), game_display::get_singleton(), display::invalidate(), game_display::maybe_rebuild(), game_display::needs_rebuild(), and resources::undo_stack.
SYNCED_COMMAND_HANDLER_FUNCTION | ( | debug_turn | , |
child | , | ||
use_undo | |||
) |
Definition at line 667 of file synced_commands.cpp.
References actions::undo_list::clear(), resources::gamedata, display::get_singleton(), game_display::get_singleton(), game_display::new_turn(), display::queue_rerender(), tod_manager::set_turn(), resources::tod_manager, and resources::undo_stack.
SYNCED_COMMAND_HANDLER_FUNCTION | ( | debug_turn_limit | , |
child | , | ||
use_undo | |||
) |
Definition at line 654 of file synced_commands.cpp.
References actions::undo_list::clear(), display::get_singleton(), display::queue_rerender(), tod_manager::set_number_of_turns(), resources::tod_manager, and resources::undo_stack.
SYNCED_COMMAND_HANDLER_FUNCTION | ( | debug_unit | , |
child | , | ||
use_undo | |||
) |
Definition at line 470 of file synced_commands.cpp.
References advance_unit_at(), actions::undo_list::clear(), 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(), resources::undo_stack, game_board::units(), resources::whiteboard, and WRN_REPLAY.
SYNCED_COMMAND_HANDLER_FUNCTION | ( | disband | , |
child | , | ||
error_handler | |||
) |
Definition at line 233 of file synced_commands.cpp.
References actions::undo_list::add_dismissal(), resources::controller, play_controller::current_side(), recall_list_manager::erase_if_matches_id(), recall_list_manager::find_if_matches_id(), resources::gameboard, game_board::get_team(), team::recall_list(), recall_list_manager::size(), and resources::undo_stack.
SYNCED_COMMAND_HANDLER_FUNCTION | ( | fire_event | , |
child | , | ||
use_undo | |||
) |
Definition at line 326 of file synced_commands.cpp.
References actions::undo_list::add_dummy(), actions::undo_list::clear(), 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 | , | ||
use_undo | , | ||
show | , | ||
error_handler | |||
) |
Definition at line 260 of file synced_commands.cpp.
References resources::controller, play_controller::current_side(), unit_map::find(), game_board::find_visible_unit(), resources::gameboard, game_board::get_team(), team::is_local_ai(), team::is_network_ai(), actions::move_unit_from_replay(), read_locations(), gui2::dialogs::tip::show(), preferences::skip_ai_moves(), resources::undo_stack, game_board::units(), unit_map::iterator_base< iter_types >::valid(), and WRN_REPLAY.
SYNCED_COMMAND_HANDLER_FUNCTION | ( | recall | , |
child | , | ||
use_undo | , | ||
show | , | ||
error_handler | |||
) |
Definition at line 134 of file synced_commands.cpp.
References resources::controller, play_controller::current_side(), resources::gameboard, resources::gamedata, game_board::get_team(), map_location::NDIRECTIONS, actions::recall_unit(), and gui2::dialogs::tip::show().
SYNCED_COMMAND_HANDLER_FUNCTION | ( | recruit | , |
child | , | ||
use_undo | , | ||
show | , | ||
error_handler | |||
) |
Definition at line 70 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(), gui2::dialogs::tip::show(), unit_types, and map_location::valid().
SYNCED_COMMAND_HANDLER_FUNCTION | ( | update_shroud | , |
use_undo | , | ||
error_handler | |||
) |
Definition at line 383 of file synced_commands.cpp.
References actions::undo_list::add_update_shroud(), team::auto_shroud_updates(), actions::undo_list::clear(), actions::undo_list::commit_vision(), resources::controller, play_controller::current_team(), and resources::undo_stack.
|
static |