#include <actions.hpp>
Public Types | |
enum | tresult { E_NOT_AVAILABLE_FOR_RECALLING = 6001, E_NO_GOLD = 6003, E_NO_LEADER = 6004, E_LEADER_NOT_ON_KEEP = 6005, E_BAD_RECALL_LOCATION = 6006 } |
Public Types inherited from ai::action_result | |
enum | tresult { AI_ACTION_SUCCESS = 0, AI_ACTION_STARTED = 1, AI_ACTION_FAILURE = -1 } |
Public Member Functions | |
recall_result (side_number side, const std::string &unit_id, const map_location &where, const map_location &from) | |
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_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 | |
unit_const_ptr | get_recall_unit (const team &my_team) |
bool | test_enough_gold (const team &my_team) |
Private Attributes | |
const std::string & | unit_id_ |
const map_location | where_ |
map_location | recall_location_ |
map_location | recall_from_ |
bool | location_checked_ |
Definition at line 207 of file actions.hpp.
Enumerator | |
---|---|
E_NOT_AVAILABLE_FOR_RECALLING | |
E_NO_GOLD | |
E_NO_LEADER | |
E_LEADER_NOT_ON_KEEP | |
E_BAD_RECALL_LOCATION |
Definition at line 211 of file actions.hpp.
ai::recall_result::recall_result | ( | side_number | side, |
const std::string & | unit_id, | ||
const map_location & | where, | ||
const map_location & | from | ||
) |
Definition at line 526 of file actions.cpp.
|
protectedvirtual |
Implements ai::action_result.
Definition at line 600 of file actions.cpp.
References ai::action_result::AI_ACTION_FAILURE, unit_map::find(), resources::gameboard, ai::action_result::get_side(), recall_location_, ai::action_result::set_error(), and resources::units.
|
protectedvirtual |
Implements ai::action_result.
Definition at line 555 of file actions.cpp.
References actions::check_recall_location(), E_BAD_RECALL_LOCATION, E_LEADER_NOT_ON_KEEP, E_NO_LEADER, ai::action_result::get_my_team(), get_recall_unit(), ai::action_result::get_side(), location_checked_, LOG_AI_ACTIONS, recall_from_, recall_location_, actions::RECRUIT_ALTERNATE_LOCATION, actions::RECRUIT_NO_ABLE_LEADER, actions::RECRUIT_NO_KEEP_LEADER, actions::RECRUIT_NO_LEADER, actions::RECRUIT_NO_VACANCY, actions::RECRUIT_OK, ai::action_result::set_error(), test_enough_gold(), and map_location::valid().
|
virtual |
Implements ai::action_result.
Definition at line 618 of file actions.cpp.
References ai::action_result::get_side(), map_location::null_location(), unit_id_, and where_.
Referenced by operator<<().
|
protectedvirtual |
Implements ai::action_result.
Definition at line 633 of file actions.cpp.
References DBG_AI_ACTIONS, replay_helper::get_recall(), ai::action_result::get_side(), synced_context::ignore_error_function(), ai::action_result::is_ok(), ai::action_result::is_success(), location_checked_, LOG_AI_ACTIONS, ai::manager::raise_gamestate_changed(), recall_from_, recall_location_, synced_context::run_in_synced_context_if_not_already(), ai::action_result::set_gamestate_changed(), preferences::show_ai_moves(), ai::action_result::sim_gamestate_changed, ai::simulated_recall(), resources::simulation_, and unit_id_.
|
protectedvirtual |
Implements ai::action_result.
Definition at line 671 of file actions.cpp.
|
private |
Definition at line 537 of file actions.cpp.
References E_NOT_AVAILABLE_FOR_RECALLING, recall_list_manager::find_if_matches_id(), team::recall_list(), ai::action_result::set_error(), and unit_id_.
Referenced by do_check_before().
|
private |
Definition at line 546 of file actions.cpp.
References E_NO_GOLD, team::gold(), team::recall_cost(), and ai::action_result::set_error().
Referenced by do_check_before().
|
private |
Definition at line 235 of file actions.hpp.
Referenced by do_check_before(), and do_execute().
|
private |
Definition at line 234 of file actions.hpp.
Referenced by do_check_before(), and do_execute().
|
private |
Definition at line 233 of file actions.hpp.
Referenced by do_check_after(), do_check_before(), and do_execute().
|
private |
Definition at line 231 of file actions.hpp.
Referenced by do_describe(), do_execute(), and get_recall_unit().
|
private |
Definition at line 232 of file actions.hpp.
Referenced by do_describe().