The Battle for Wesnoth  1.13.10+dev
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
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:
Inheritance graph

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_NOT_REACHED_DESTINATION = 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_route
route_
 
map_location unit_location_
 
bool unreach_is_ok_
 
bool has_ambusher_
 
bool has_interrupted_teleport_
 

Detailed Description

Definition at line 165 of file actions.hpp.

Member Enumeration Documentation

Enumerator
E_EMPTY_MOVE 
E_NO_UNIT 
E_NOT_OWN_UNIT 
E_INCAPACITATED_UNIT 
E_AMBUSHED 
E_FAILED_TELEPORT 
E_NOT_REACHED_DESTINATION 
E_NO_ROUTE 

Definition at line 173 of file actions.hpp.

Constructor & Destructor Documentation

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 327 of file actions.cpp.

Member Function Documentation

void ai::move_result::do_check_after ( )
protectedvirtual
void ai::move_result::do_check_before ( )
protectedvirtual

Implements ai::action_result.

Definition at line 395 of file actions.cpp.

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

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

Implements ai::action_result.

Definition at line 430 of file actions.cpp.

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

Referenced by operator<<().

void ai::move_result::do_execute ( )
protectedvirtual
void ai::move_result::do_init_for_execution ( )
protectedvirtual

Implements ai::action_result.

Definition at line 521 of file actions.cpp.

const unit * ai::move_result::get_unit ( )
private
const map_location & ai::move_result::get_unit_location ( ) const
virtual

Definition at line 407 of file actions.cpp.

References unit_location_.

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

Member Data Documentation

const map_location ai::move_result::from_
private

Definition at line 194 of file actions.hpp.

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

bool ai::move_result::has_ambusher_
private

Definition at line 200 of file actions.hpp.

Referenced by do_check_after(), and do_execute().

bool ai::move_result::has_interrupted_teleport_
private

Definition at line 201 of file actions.hpp.

Referenced by do_check_after(), and do_execute().

bool ai::move_result::remove_movement_
private

Definition at line 196 of file actions.hpp.

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

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

Definition at line 197 of file actions.hpp.

Referenced by do_execute(), and test_route().

const map_location ai::move_result::to_
private

Definition at line 195 of file actions.hpp.

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

map_location ai::move_result::unit_location_
private

Definition at line 198 of file actions.hpp.

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

bool ai::move_result::unreach_is_ok_
private

Definition at line 199 of file actions.hpp.

Referenced by do_check_after().


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