The Battle for Wesnoth  1.15.2+dev
Public Member Functions | Public Attributes | List of all members
dummy_action Struct Reference
Inheritance diagram for dummy_action:
Inheritance graph

Public Member Functions

 dummy_action (std::size_t team_index, bool hidden, int id)
 
std::ostream & print (std::ostream &s) const
 
void accept (visitor &)
 
std::shared_ptr< dummy_actionshared_from_this ()
 
void execute (bool &success, bool &complete)
 Output parameters: success: Whether or not to continue an execute-all after this execution complete: Whether or not to delete this action after execution. More...
 
void apply_temp_modifier (unit_map &)
 Applies temporarily the result of this action to the specified unit map. More...
 
void remove_temp_modifier (unit_map &)
 Removes the result of this action from the specified unit map. More...
 
void draw_hex (const map_location &)
 Gets called by display when drawing a hex, to allow actions to draw to the screen. More...
 
map_location get_numbering_hex () const
 
unit_ptr get_unit () const
 Return the unit targeted by this action. More...
 
fake_unit_ptr get_fake_unit ()
 
error check_validity () const
 Check the validity of the action. More...
 
- Public Member Functions inherited from wb::action
 action (std::size_t team_index, bool hidden)
 
 action (const config &, bool hidden)
 
virtual ~action ()
 
virtual void redraw ()
 Redrawing function, called each time the action situation might have changed. More...
 
void hide ()
 Sets whether or not the action should be drawn on the screen. More...
 
void show ()
 
bool hidden () const
 
bool is_numbering_hex (const map_location &hex) const
 Indicates whether this hex is the preferred hex to draw the numbering for this action. More...
 
virtual bool places_new_unit () const
 Returns true for recall and recruit actions. More...
 
virtual std::size_t get_unit_id () const
 Returns the id of the unit targeted by this action. More...
 
std::size_t team_index () const
 Returns the index of the team that owns this action. More...
 
int side_number () const
 Returns the number of the side that owns this action, i.e. More...
 
virtual config to_config () const
 Constructs and returns a config object representing this object. More...
 
bool valid ()
 Returns whether this action is valid or not. More...
 

Public Attributes

int id_
 

Additional Inherited Members

- Public Types inherited from wb::action
enum  error {
  OK, INVALID_LOCATION, NO_UNIT, UNIT_CHANGED,
  LOCATION_OCCUPIED, TOO_FAR, NO_TARGET, NO_ATTACK_LEFT,
  NOT_AN_ENEMY, UNIT_UNAVAILABLE, NOT_ENOUGH_GOLD, NO_LEADER
}
 Possible errors. More...
 
- Static Public Member Functions inherited from wb::action
static action_ptr from_config (const config &, bool hidden)
 Constructs an object of a subclass of wb::action using a config. More...
 

Detailed Description

Definition at line 26 of file test_whiteboard_side_actions.cpp.

Constructor & Destructor Documentation

◆ dummy_action()

dummy_action::dummy_action ( std::size_t  team_index,
bool  hidden,
int  id 
)
inline

Definition at line 27 of file test_whiteboard_side_actions.cpp.

Member Function Documentation

◆ accept()

void dummy_action::accept ( visitor )
inlinevirtual

Implements wb::action.

Definition at line 32 of file test_whiteboard_side_actions.cpp.

◆ apply_temp_modifier()

void dummy_action::apply_temp_modifier ( unit_map unit_map)
inlinevirtual

Applies temporarily the result of this action to the specified unit map.

Implements wb::action.

Definition at line 35 of file test_whiteboard_side_actions.cpp.

◆ check_validity()

error dummy_action::check_validity ( ) const
inlinevirtual

Check the validity of the action.

Returns
the error preventing the action from being executed.
Return values
OKif there isn't any error (the action can be executed.)

Implements wb::action.

Definition at line 41 of file test_whiteboard_side_actions.cpp.

References gui2::OK.

◆ draw_hex()

void dummy_action::draw_hex ( const map_location hex)
inlinevirtual

Gets called by display when drawing a hex, to allow actions to draw to the screen.

Implements wb::action.

Definition at line 37 of file test_whiteboard_side_actions.cpp.

◆ execute()

void dummy_action::execute ( bool &  success,
bool &  complete 
)
inlinevirtual

Output parameters: success: Whether or not to continue an execute-all after this execution complete: Whether or not to delete this action after execution.

Implements wb::action.

Definition at line 34 of file test_whiteboard_side_actions.cpp.

◆ get_fake_unit()

fake_unit_ptr dummy_action::get_fake_unit ( )
inlinevirtual
Returns
pointer to the fake unit used only for visuals

Implements wb::action.

Definition at line 40 of file test_whiteboard_side_actions.cpp.

◆ get_numbering_hex()

map_location dummy_action::get_numbering_hex ( ) const
inlinevirtual

Implements wb::action.

Definition at line 38 of file test_whiteboard_side_actions.cpp.

◆ get_unit()

unit_ptr dummy_action::get_unit ( ) const
inlinevirtual

Return the unit targeted by this action.

Null if unit doesn't exist.

Implements wb::action.

Definition at line 39 of file test_whiteboard_side_actions.cpp.

◆ print()

std::ostream& dummy_action::print ( std::ostream &  s) const
inlinevirtual

Implements wb::action.

Definition at line 31 of file test_whiteboard_side_actions.cpp.

References s.

◆ remove_temp_modifier()

void dummy_action::remove_temp_modifier ( unit_map unit_map)
inlinevirtual

Removes the result of this action from the specified unit map.

Implements wb::action.

Definition at line 36 of file test_whiteboard_side_actions.cpp.

◆ shared_from_this()

std::shared_ptr<dummy_action> dummy_action::shared_from_this ( )
inline

Definition at line 33 of file test_whiteboard_side_actions.cpp.

Member Data Documentation

◆ id_

int dummy_action::id_

Definition at line 28 of file test_whiteboard_side_actions.cpp.


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