The Battle for Wesnoth  1.19.7+dev
Public Member Functions | Static 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)
 
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 ()
 
virtual ~undo_action ()
 

Static Public Member Functions

static const char * get_type_impl ()
 

Public Attributes

unit_ptr dismissed_unit
 

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)
explicit

Definition at line 29 of file undo_dismiss_action.cpp.

◆ ~dismiss_action()

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

Definition at line 31 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.

Definition at line 29 of file undo_dismiss_action.hpp.

References get_type_impl().

◆ get_type_impl()

static const char* actions::undo::dismiss_action::get_type_impl ( )
inlinestatic

Definition at line 28 of file undo_dismiss_action.hpp.

Referenced by get_type().

◆ 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, 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: