#include <undo_recruit_action.hpp>
Public Member Functions | |
recruit_action (const unit_const_ptr recruited, const map_location &loc, const map_location &from, int orig_village_owner, bool time_bonus) | |
recruit_action (const config &cfg, const unit_type &type, const map_location &from) | |
virtual const char * | get_type () const |
virtual | ~recruit_action () |
virtual void | write (config &cfg) const |
Writes this into the provided config. More... | |
virtual bool | undo (int side) |
Undoes this action. More... | |
virtual bool | redo (int side) |
Redoes this action. More... | |
Public Member Functions inherited from actions::undo_action | |
undo_action () | |
Default constructor. More... | |
undo_action (const config &cfg) | |
virtual | ~undo_action () |
void | execute_undo_umc_wml () |
void | execute_redo_umc_wml () |
Public Member Functions inherited from actions::undo_action_base | |
undo_action_base () | |
Default constructor. More... | |
virtual | ~undo_action_base () |
Public Member Functions inherited from actions::shroud_clearing_action | |
shroud_clearing_action (const config &cfg) | |
shroud_clearing_action (const unit_const_ptr u, const map_location &loc, int village_owner, bool village_bonus) | |
shroud_clearing_action (const unit_const_ptr u, const t_route::const_iterator &begin, const t_route::const_iterator &end, int village_owner, bool village_bonus) | |
void | return_village () |
Change village owner on undo. More... | |
void | take_village () |
Change village owner on redo. More... | |
void | write (config &cfg) const |
virtual | ~shroud_clearing_action () |
Public Attributes | |
const unit_type & | u_type |
map_location | recruit_from |
Public Attributes inherited from actions::undo_action | |
config | replay_data |
the replay data to do this action, this is only !empty() when this action is on the redo stack we need this because we don't recalculate the redos like they would be in real game, but even undoable commands can have "dependent" (= user_input) commands, which we save here. More... | |
int | unit_id_diff |
the difference in the unit ids TODO: does it really make sense to allow undoing if the unit id counter has changed? More... | |
event_vector | umc_commands_undo |
event_vector | umc_commands_redo |
Public Attributes inherited from actions::shroud_clearing_action | |
t_route | route |
The hexes occupied by the affected unit during this action. More... | |
clearer_info | view_info |
A record of the affected unit's ability to see. More... | |
int | original_village_owner |
The number of the side that preivously owned the village that the unit stepped on Note, that recruit/recall actions can also take a village if the unit was recruits/recalled onto a village. More... | |
bool | take_village_timebonus |
Whether this actions got a timebonus becasue it took a village. More... | |
Additional Inherited Members | |
Public Types inherited from actions::undo_action | |
typedef std::vector< undo_event > | event_vector |
actions wml (specified by wml) that should be executed when undoing this command. More... | |
Public Types inherited from actions::shroud_clearing_action | |
typedef std::vector< map_location > | t_route |
Static Public Member Functions inherited from actions::undo_action | |
static void | read_event_vector (event_vector &vec, const config &cfg, const std::string &tag) |
static void | write_event_vector (const event_vector &vec, config &cfg, const std::string &tag) |
Definition at line 13 of file undo_recruit_action.hpp.
|
inline |
Definition at line 19 of file undo_recruit_action.hpp.
|
inline |
Definition at line 27 of file undo_recruit_action.hpp.
|
inlinevirtual |
Definition at line 34 of file undo_recruit_action.hpp.
|
inlinevirtual |
Implements actions::undo_action_base.
Definition at line 33 of file undo_recruit_action.hpp.
|
virtual |
Redoes this action.
Implements actions::undo_action.
Definition at line 71 of file undo_recruit_action.cpp.
References team::action_bonus_count(), unit_type::base_id(), config::clear(), util::contains(), set_scontext_synced::do_final_checkup(), ERR_NG, actions::find_recruit_location(), actions::get_recruits(), team::last_recruit(), game_logic::msg(), resources::recorder, recruit_from, actions::recruit_unit(), replay::redo(), actions::undo_action::replay_data, actions::shroud_clearing_action::route, resources::screen, team::set_action_bonus_count(), gui2::show_transient_message(), u_type, and display::video().
|
virtual |
Undoes this action.
Implements actions::undo_action.
Definition at line 39 of file undo_recruit_action.cpp.
References team::action_bonus_count(), unit_type::cost(), unit_map::end(), unit_map::erase(), actions::undo_action::execute_undo_umc_wml(), unit_map::find(), display::invalidate(), actions::shroud_clearing_action::return_village(), actions::shroud_clearing_action::route, resources::screen, team::set_action_bonus_count(), team::spend_gold(), unit::type(), statistics::un_recruit_unit(), and resources::units.
Writes this into the provided config.
Reimplemented from actions::undo_action.
Definition at line 25 of file undo_recruit_action.cpp.
References config::add_child(), unit_type::base_id(), config::child(), recruit_from, u_type, actions::undo_action::write(), actions::shroud_clearing_action::write(), and map_location::write().
map_location actions::undo::recruit_action::recruit_from |
Definition at line 16 of file undo_recruit_action.hpp.
const unit_type& actions::undo::recruit_action::u_type |
Definition at line 15 of file undo_recruit_action.hpp.