The Battle for Wesnoth  1.19.6+dev
Public Types | Public Member Functions | Protected Member Functions | Private Member Functions | Private Attributes | List of all members
ai::stopunit_result Class Reference

#include <actions.hpp>

Inheritance diagram for ai::stopunit_result:

Public Types

enum  result { E_NO_UNIT = 4002 , E_NOT_OWN_UNIT = 4003 , E_INCAPACITATED_UNIT = 4004 }
 
- Public Types inherited from ai::action_result
enum  result { AI_ACTION_SUCCESS = 0 , AI_ACTION_STARTED = 1 , AI_ACTION_FAILURE = -1 }
 

Public Member Functions

 stopunit_result (side_number side, const map_location &unit_location, bool remove_movement, bool remove_attacks)
 
virtual std::string do_describe () const
 
- Public Member Functions inherited from ai::action_result
virtual ~action_result ()
 
void check_before ()
 
void execute ()
 
bool is_gamestate_changed () const
 
bool is_ok ()
 
int get_status () const
 

Protected Member Functions

virtual void do_check_before ()
 
virtual void do_check_after ()
 
virtual void do_execute ()
 
virtual void do_init_for_execution ()
 
- Protected Member Functions inherited from ai::action_result
 action_result (side_number side)
 
bool is_execution () const
 
int get_side () const
 
game_infoget_info () const
 
teamget_my_team () const
 
void set_error (int error_code, bool log_as_error=true)
 
bool is_success () const
 
void set_gamestate_changed ()
 

Private Member Functions

const unitget_unit ()
 

Private Attributes

const map_locationunit_location_
 
const bool remove_movement_
 
const bool remove_attacks_
 

Detailed Description

Definition at line 267 of file actions.hpp.

Member Enumeration Documentation

◆ result

Enumerator
E_NO_UNIT 
E_NOT_OWN_UNIT 
E_INCAPACITATED_UNIT 

Definition at line 274 of file actions.hpp.

Constructor & Destructor Documentation

◆ stopunit_result()

ai::stopunit_result::stopunit_result ( side_number  side,
const map_location unit_location,
bool  remove_movement,
bool  remove_attacks 
)

Definition at line 810 of file actions.cpp.

Member Function Documentation

◆ do_check_after()

void ai::stopunit_result::do_check_after ( )
protectedvirtual

◆ do_check_before()

void ai::stopunit_result::do_check_before ( )
protectedvirtual

Implements ai::action_result.

Definition at line 834 of file actions.cpp.

References get_unit(), and LOG_AI_ACTIONS.

◆ do_describe()

std::string ai::stopunit_result::do_describe ( ) const
virtual

Implements ai::action_result.

Definition at line 860 of file actions.cpp.

References ai::action_result::get_side(), remove_attacks_, remove_movement_, s, and unit_location_.

Referenced by operator<<().

◆ do_execute()

void ai::stopunit_result::do_execute ( )
protectedvirtual

◆ do_init_for_execution()

void ai::stopunit_result::do_init_for_execution ( )
protectedvirtual

Implements ai::action_result.

Definition at line 912 of file actions.cpp.

◆ get_unit()

const unit * ai::stopunit_result::get_unit ( )
private

Member Data Documentation

◆ remove_attacks_

const bool ai::stopunit_result::remove_attacks_
private

Definition at line 290 of file actions.hpp.

Referenced by do_check_after(), do_describe(), and do_execute().

◆ remove_movement_

const bool ai::stopunit_result::remove_movement_
private

Definition at line 289 of file actions.hpp.

Referenced by do_check_after(), do_describe(), and do_execute().

◆ unit_location_

const map_location& ai::stopunit_result::unit_location_
private

Definition at line 288 of file actions.hpp.

Referenced by do_check_after(), do_describe(), do_execute(), and get_unit().


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