The Battle for Wesnoth  1.15.1+dev
Public Member Functions | Public Attributes | List of all members
actions::undo::recruit_action Struct Reference

#include <undo_recruit_action.hpp>

Inheritance diagram for actions::undo::recruit_action:
Inheritance graph

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...
 
- 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 ()
 
- Public Member Functions inherited from actions::undo_action_base
 undo_action_base (const undo_action_base &)=delete
 
undo_action_baseoperator= (const undo_action_base &)=delete
 
 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 route_t::const_iterator &begin, const route_t::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_typeu_type
 
map_location recruit_from
 
- Public Attributes inherited from actions::undo_action
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
 
- Public Attributes inherited from actions::shroud_clearing_action
route_t 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 because it took a village. More...
 

Additional Inherited Members

- Public Types inherited from actions::undo_action
typedef std::vector< undo_eventevent_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_locationroute_t
 
- 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)
 

Detailed Description

Definition at line 26 of file undo_recruit_action.hpp.

Constructor & Destructor Documentation

◆ recruit_action() [1/2]

actions::undo::recruit_action::recruit_action ( const unit_const_ptr  recruited,
const map_location loc,
const map_location from,
int  orig_village_owner,
bool  time_bonus 
)

Definition at line 37 of file undo_recruit_action.cpp.

◆ recruit_action() [2/2]

actions::undo::recruit_action::recruit_action ( const config cfg,
const unit_type type,
const map_location from 
)

Definition at line 45 of file undo_recruit_action.cpp.

◆ ~recruit_action()

virtual actions::undo::recruit_action::~recruit_action ( )
inlinevirtual

Definition at line 36 of file undo_recruit_action.hpp.

References undo(), and write().

Member Function Documentation

◆ get_type()

virtual const char* actions::undo::recruit_action::get_type ( ) const
inlinevirtual

Implements actions::undo_action_base.

Definition at line 35 of file undo_recruit_action.hpp.

◆ undo()

bool actions::undo::recruit_action::undo ( int  side)
virtual

◆ write()

void actions::undo::recruit_action::write ( config cfg) const
virtual

Member Data Documentation

◆ recruit_from

map_location actions::undo::recruit_action::recruit_from

Definition at line 29 of file undo_recruit_action.hpp.

Referenced by write().

◆ u_type

const unit_type& actions::undo::recruit_action::u_type

Definition at line 28 of file undo_recruit_action.hpp.

Referenced by write().


The documentation for this struct was generated from the following files: