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

#include <undo_dismiss_action.hpp>

Inheritance diagram for actions::undo::dismiss_action:

Public Member Functions

 dismiss_action (const unit_const_ptr dismissed)
 
 dismiss_action (const config &cfg, const config &unit_cfg)
 
virtual const char * get_type () const
 
virtual ~dismiss_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 Attributes

unit_ptr dismissed_unit
 
- 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
 

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...
 
- 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 21 of file undo_dismiss_action.hpp.

Constructor & Destructor Documentation

◆ dismiss_action() [1/2]

actions::undo::dismiss_action::dismiss_action ( const unit_const_ptr  dismissed)
explicit

Definition at line 23 of file undo_dismiss_action.cpp.

◆ dismiss_action() [2/2]

actions::undo::dismiss_action::dismiss_action ( const config cfg,
const config unit_cfg 
)
explicit

Definition at line 29 of file undo_dismiss_action.cpp.

◆ ~dismiss_action()

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

Definition at line 29 of file undo_dismiss_action.hpp.

Member Function Documentation

◆ get_type()

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

Implements actions::undo_action_base.

Definition at line 28 of file undo_dismiss_action.hpp.

◆ undo()

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

Undoes this action.

Returns
true on success; false on an error.

Implements actions::undo_action.

Definition at line 48 of file undo_dismiss_action.cpp.

References recall_list_manager::add(), dismissed_unit, actions::undo_action::execute_undo_umc_wml(), resources::gameboard, game_board::get_team(), and team::recall_list().

◆ write()

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

Writes this into the provided config.

Reimplemented from actions::undo_action.

Definition at line 38 of file undo_dismiss_action.cpp.

References config::add_child(), dismissed_unit, and actions::undo_action::write().

Member Data Documentation

◆ dismissed_unit

unit_ptr actions::undo::dismiss_action::dismissed_unit

Definition at line 23 of file undo_dismiss_action.hpp.

Referenced by undo(), and write().


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