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

#include <actions.hpp>

Inheritance diagram for ai::move_result:

Public Types

enum  result {
  E_EMPTY_MOVE = 2001 , E_NO_UNIT = 2002 , E_NOT_OWN_UNIT = 2003 , E_INCAPACITATED_UNIT = 2004 ,
  E_AMBUSHED = 2005 , E_FAILED_TELEPORT = 2006 , E_OFF_MAP = 2007 , E_NO_ROUTE = 2008
}
 
- Public Types inherited from ai::action_result
enum  result { AI_ACTION_SUCCESS = 0 , AI_ACTION_STARTED = 1 , AI_ACTION_FAILURE = -1 }
 

Public Member Functions

 move_result (side_number side, const map_location &from, const map_location &to, bool remove_movement, bool unreach_is_ok)
 
virtual std::string do_describe () const
 
virtual const map_locationget_unit_location () 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 ()
 
bool test_route (const unit &un)
 

Private Attributes

const map_location from_
 
const map_location to_
 
bool remove_movement_
 
std::shared_ptr< pathfind::plain_routeroute_
 
map_location unit_location_
 
bool unreach_is_ok_
 
bool has_ambusher_
 
bool has_interrupted_teleport_
 

Detailed Description

Definition at line 163 of file actions.hpp.

Member Enumeration Documentation

◆ result

Enumerator
E_EMPTY_MOVE 
E_NO_UNIT 
E_NOT_OWN_UNIT 
E_INCAPACITATED_UNIT 
E_AMBUSHED 
E_FAILED_TELEPORT 
E_OFF_MAP 
E_NO_ROUTE 

Definition at line 171 of file actions.hpp.

Constructor & Destructor Documentation

◆ move_result()

ai::move_result::move_result ( side_number  side,
const map_location from,
const map_location to,
bool  remove_movement,
bool  unreach_is_ok 
)

Definition at line 323 of file actions.cpp.

Member Function Documentation

◆ do_check_after()

void ai::move_result::do_check_after ( )
protectedvirtual

◆ do_check_before()

void ai::move_result::do_check_before ( )
protectedvirtual

Implements ai::action_result.

Definition at line 391 of file actions.cpp.

References get_unit(), LOG_AI_ACTIONS, and test_route().

◆ do_describe()

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

Implements ai::action_result.

Definition at line 425 of file actions.cpp.

References from_, ai::action_result::get_side(), remove_movement_, s, and to_.

Referenced by do_check_after(), and operator<<().

◆ do_execute()

void ai::move_result::do_execute ( )
protectedvirtual

◆ do_init_for_execution()

void ai::move_result::do_init_for_execution ( )
protectedvirtual

Implements ai::action_result.

Definition at line 514 of file actions.cpp.

◆ get_unit()

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

◆ get_unit_location()

const map_location & ai::move_result::get_unit_location ( ) const
virtual

◆ test_route()

bool ai::move_result::test_route ( const unit un)
private

Member Data Documentation

◆ from_

const map_location ai::move_result::from_
private

Definition at line 192 of file actions.hpp.

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

◆ has_ambusher_

bool ai::move_result::has_ambusher_
private

Definition at line 198 of file actions.hpp.

Referenced by do_check_after(), and do_execute().

◆ has_interrupted_teleport_

bool ai::move_result::has_interrupted_teleport_
private

Definition at line 199 of file actions.hpp.

Referenced by do_check_after(), and do_execute().

◆ remove_movement_

bool ai::move_result::remove_movement_
private

Definition at line 194 of file actions.hpp.

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

◆ route_

std::shared_ptr<pathfind::plain_route> ai::move_result::route_
private

Definition at line 195 of file actions.hpp.

Referenced by do_execute(), and test_route().

◆ to_

const map_location ai::move_result::to_
private

Definition at line 193 of file actions.hpp.

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

◆ unit_location_

map_location ai::move_result::unit_location_
private

Definition at line 196 of file actions.hpp.

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

◆ unreach_is_ok_

bool ai::move_result::unreach_is_ok_
private

Definition at line 197 of file actions.hpp.

Referenced by do_check_after().


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