#include <actions.hpp>
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_location & | get_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_info & | get_info () const |
| team & | get_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 unit * | get_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_ |
Definition at line 163 of file actions.hpp.
| 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.
| 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.
|
protectedvirtual |
Implements ai::action_result.
Definition at line 408 of file actions.cpp.
References DBG_AI_ACTIONS, do_describe(), E_AMBUSHED, E_FAILED_TELEPORT, has_ambusher_, has_interrupted_teleport_, ai::action_result::set_error(), to_, unit_location_, and unreach_is_ok_.
|
protectedvirtual |
Implements ai::action_result.
Definition at line 391 of file actions.cpp.
References get_unit(), LOG_AI_ACTIONS, and test_route().
|
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<<().
|
protectedvirtual |
Implements ai::action_result.
Definition at line 440 of file actions.cpp.
References DBG_AI_ACTIONS, ai::actions::execute_stopunit_action(), utils::find(), unit_map::find(), from_, resources::gameboard, actions::move_unit_spectator::get_ambusher(), actions::move_unit_spectator::get_failed_teleport(), ai::action_result::get_side(), ai::manager::get_singleton(), actions::move_unit_spectator::get_tiles_entered(), actions::move_unit_spectator::get_unit(), has_ambusher_, has_interrupted_teleport_, ai::action_result::is_gamestate_changed(), ai::action_result::is_ok(), ai::action_result::is_success(), LOG_AI_ACTIONS, actions::move_unit_and_record(), ai::manager::raise_gamestate_changed(), remove_movement_, route_, actions::move_unit_spectator::set_ai_move(), ai::action_result::set_error(), ai::action_result::set_gamestate_changed(), actions::move_unit_spectator::set_unit(), ai::action_result::sim_gamestate_changed, ai::simulated_move(), ai::simulated_stopunit(), resources::simulation, to_, unit_location_, game_board::units(), and unit_map::iterator_base< iter_types >::valid().
|
protectedvirtual |
Implements ai::action_result.
Definition at line 514 of file actions.cpp.
|
private |
Definition at line 337 of file actions.cpp.
References E_INCAPACITATED_UNIT, E_NO_UNIT, E_NOT_OWN_UNIT, unit_map::find(), from_, resources::gameboard, ai::action_result::get_side(), unit::incapacitated(), ai::action_result::set_error(), unit::side(), and game_board::units().
Referenced by do_check_before().
|
virtual |
Definition at line 403 of file actions.cpp.
References unit_location_.
|
private |
Definition at line 356 of file actions.cpp.
References pathfind::a_star_search(), E_EMPTY_MOVE, E_NO_ROUTE, E_OFF_MAP, from_, resources::gameboard, unit::get_location(), ai::action_result::get_my_team(), pathfind::get_teleport_locations(), gamemap_base::h(), game_board::map(), unit::movement_left(), gamemap_base::on_board(), remove_movement_, route_, ai::action_result::set_error(), to_, map_location::valid(), and gamemap_base::w().
Referenced by do_check_before().
|
private |
Definition at line 192 of file actions.hpp.
Referenced by do_describe(), do_execute(), get_unit(), and test_route().
|
private |
Definition at line 198 of file actions.hpp.
Referenced by do_check_after(), and do_execute().
|
private |
Definition at line 199 of file actions.hpp.
Referenced by do_check_after(), and do_execute().
|
private |
Definition at line 194 of file actions.hpp.
Referenced by do_describe(), do_execute(), and test_route().
|
private |
Definition at line 195 of file actions.hpp.
Referenced by do_execute(), and test_route().
|
private |
Definition at line 193 of file actions.hpp.
Referenced by do_check_after(), do_describe(), do_execute(), and test_route().
|
private |
Definition at line 196 of file actions.hpp.
Referenced by do_check_after(), do_execute(), and get_unit_location().
|
private |
Definition at line 197 of file actions.hpp.
Referenced by do_check_after().