#include <actions.hpp>
Public Types | |
enum | tresult { 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 | tresult { 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_ |
boost::shared_ptr < pathfind::plain_route > | route_ |
map_location | unit_location_ |
bool | unreach_is_ok_ |
bool | has_ambusher_ |
bool | has_interrupted_teleport_ |
Definition at line 167 of file actions.hpp.
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 175 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 326 of file actions.cpp.
|
protectedvirtual |
Implements ai::action_result.
Definition at line 411 of file actions.cpp.
References E_AMBUSHED, E_FAILED_TELEPORT, E_NOT_REACHED_DESTINATION, 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 394 of file actions.cpp.
References get_unit(), LOG_AI_ACTIONS, and test_route().
|
virtual |
Implements ai::action_result.
Definition at line 429 of file actions.cpp.
References from_, ai::action_result::get_side(), remove_movement_, and to_.
Referenced by operator<<().
|
protectedvirtual |
Implements ai::action_result.
Definition at line 444 of file actions.cpp.
References DBG_AI_ACTIONS, ai::actions::execute_stopunit_action(), gui2::event::find(), unit_map::find(), from_, actions::move_unit_spectator::get_ambusher(), actions::move_unit_spectator::get_failed_teleport(), ai::action_result::get_side(), 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_, ai::action_result::set_error(), ai::action_result::set_gamestate_changed(), actions::move_unit_spectator::set_unit(), preferences::show_ai_moves(), ai::action_result::sim_gamestate_changed, ai::simulated_move(), ai::simulated_stopunit(), resources::simulation_, to_, unit_location_, resources::units, and unit_map::iterator_base< iter_types >::valid().
|
protectedvirtual |
Implements ai::action_result.
Definition at line 520 of file actions.cpp.
|
private |
Definition at line 340 of file actions.cpp.
References E_INCAPACITATED_UNIT, E_NO_UNIT, E_NOT_OWN_UNIT, unit_map::find(), from_, ai::action_result::get_side(), unit::incapacitated(), ai::action_result::set_error(), unit::side(), and resources::units.
Referenced by do_check_before().
|
virtual |
Definition at line 406 of file actions.cpp.
References unit_location_.
|
private |
Definition at line 359 of file actions.cpp.
References pathfind::a_star_search(), E_EMPTY_MOVE, E_NO_ROUTE, from_, resources::gameboard, unit::get_location(), ai::action_result::get_my_team(), pathfind::get_teleport_locations(), gamemap::h(), game_board::map(), unit::movement_left(), remove_movement_, route_, ai::action_result::set_error(), resources::teams, to_, map_location::valid(), and gamemap::w().
Referenced by do_check_before().
|
private |
Definition at line 196 of file actions.hpp.
Referenced by do_describe(), do_execute(), get_unit(), and test_route().
|
private |
Definition at line 202 of file actions.hpp.
Referenced by do_check_after(), and do_execute().
|
private |
Definition at line 203 of file actions.hpp.
Referenced by do_check_after(), and do_execute().
|
private |
Definition at line 198 of file actions.hpp.
Referenced by do_describe(), do_execute(), and test_route().
|
private |
Definition at line 199 of file actions.hpp.
Referenced by do_execute(), and test_route().
|
private |
Definition at line 197 of file actions.hpp.
Referenced by do_check_after(), do_describe(), do_execute(), and test_route().
|
private |
Definition at line 200 of file actions.hpp.
Referenced by do_check_after(), do_execute(), and get_unit_location().
|
private |
Definition at line 201 of file actions.hpp.
Referenced by do_check_after().