#include <move.hpp>
Public Member Functions | |
void | error (const std::string &message) override |
ingerited from action_spectator More... | |
void | add_seen_friend (const unit_map::const_iterator &u) |
add a location of a seen friend More... | |
void | add_seen_enemy (const unit_map::const_iterator &u) |
add the location of new seen enemy More... | |
const unit_map::const_iterator & | get_ambusher () const |
get the location of an ambusher More... | |
const unit_map::const_iterator & | get_failed_teleport () const |
get the location of a failed teleport More... | |
const std::vector< unit_map::const_iterator > & | get_seen_enemies () const |
get the locations of seen enemies More... | |
const std::vector< unit_map::const_iterator > & | get_seen_friends () const |
get the locations of seen friends More... | |
const unit_map::const_iterator & | get_unit () const |
get new location of moved unit More... | |
move_unit_spectator (const unit_map &units) | |
constructor More... | |
move_unit_spectator () | |
virtual | ~move_unit_spectator () |
destructor More... | |
void | reset (const unit_map &units) |
reset all locations to empty values More... | |
void | set_ambusher (const unit_map::const_iterator &u) |
set the location of an ambusher More... | |
void | set_failed_teleport (const unit_map::const_iterator &u) |
set the location of a failed teleport More... | |
void | set_unit (const unit_map::const_iterator &u) |
set the iterator to moved unit More... | |
void | set_ai_move (bool ai_move=true) |
bool | is_ai_move () const |
void | set_interrupted (bool interrupted) |
bool | get_interrupted () const |
void | set_tiles_entered (std::size_t tiles_entered) |
std::size_t | get_tiles_entered () const |
Public Member Functions inherited from action_spectator | |
action_spectator ()=default | |
action_spectator (error_handler_function eh) | |
virtual | ~action_spectator ()=default |
Private Attributes | |
unit_map::const_iterator | ambusher_ |
unit_map::const_iterator | failed_teleport_ |
std::vector< unit_map::const_iterator > | seen_enemies_ |
std::vector< unit_map::const_iterator > | seen_friends_ |
unit_map::const_iterator | unit_ |
std::size_t | tiles_entered_ |
bool | interrupted_ |
bool | is_ai_move_ = false |
Additional Inherited Members | |
Public Types inherited from action_spectator | |
typedef std::function< void(const std::string &)> | error_handler_function |
Public Attributes inherited from action_spectator | |
error_handler_function | eh_ |
actions::move_unit_spectator::move_unit_spectator | ( | const unit_map & | units | ) |
|
virtual |
void actions::move_unit_spectator::add_seen_enemy | ( | const unit_map::const_iterator & | u | ) |
add the location of new seen enemy
Definition at line 66 of file move.cpp.
References seen_enemies_.
Referenced by actions::shroud_clearer::clear_loc().
void actions::move_unit_spectator::add_seen_friend | ( | const unit_map::const_iterator & | u | ) |
add a location of a seen friend
Definition at line 60 of file move.cpp.
References seen_friends_.
Referenced by actions::shroud_clearer::clear_loc().
|
overridevirtual |
ingerited from action_spectator
Reimplemented from action_spectator.
Definition at line 140 of file move.cpp.
References ERR_NG.
const unit_map::const_iterator & actions::move_unit_spectator::get_ambusher | ( | ) | const |
get the location of an ambusher
Definition at line 72 of file move.cpp.
References ambusher_.
Referenced by ai::move_result::do_execute().
const unit_map::const_iterator & actions::move_unit_spectator::get_failed_teleport | ( | ) | const |
get the location of a failed teleport
Definition at line 78 of file move.cpp.
References failed_teleport_.
Referenced by ai::move_result::do_execute().
|
inline |
Definition at line 97 of file move.hpp.
References interrupted_.
const std::vector< unit_map::const_iterator > & actions::move_unit_spectator::get_seen_enemies | ( | ) | const |
const std::vector< unit_map::const_iterator > & actions::move_unit_spectator::get_seen_friends | ( | ) | const |
|
inline |
Definition at line 100 of file move.hpp.
References tiles_entered_.
Referenced by ai::move_result::do_execute().
const unit_map::const_iterator & actions::move_unit_spectator::get_unit | ( | ) | const |
get new location of moved unit
Definition at line 96 of file move.cpp.
References unit_.
Referenced by ai::move_result::do_execute().
|
inline |
Definition at line 94 of file move.hpp.
References is_ai_move_.
void actions::move_unit_spectator::reset | ( | const unit_map & | units | ) |
reset all locations to empty values
Definition at line 129 of file move.cpp.
References ambusher_, unit_map::end(), failed_teleport_, interrupted_, seen_enemies_, seen_friends_, tiles_entered_, and unit_.
|
inline |
Definition at line 93 of file move.hpp.
References ai::ai_move(), and is_ai_move_.
Referenced by ai::move_result::do_execute().
void actions::move_unit_spectator::set_ambusher | ( | const unit_map::const_iterator & | u | ) |
void actions::move_unit_spectator::set_failed_teleport | ( | const unit_map::const_iterator & | u | ) |
set the location of a failed teleport
Definition at line 151 of file move.cpp.
References failed_teleport_.
|
inline |
Definition at line 96 of file move.hpp.
References interrupted_.
|
inline |
Definition at line 99 of file move.hpp.
References tiles_entered_.
void actions::move_unit_spectator::set_unit | ( | const unit_map::const_iterator & | u | ) |
set the iterator to moved unit
Definition at line 157 of file move.cpp.
References unit_.
Referenced by ai::move_result::do_execute().
|
private |
Definition at line 103 of file move.hpp.
Referenced by get_ambusher(), reset(), and set_ambusher().
|
private |
Definition at line 104 of file move.hpp.
Referenced by get_failed_teleport(), reset(), and set_failed_teleport().
|
private |
Definition at line 109 of file move.hpp.
Referenced by get_interrupted(), reset(), and set_interrupted().
|
private |
Definition at line 110 of file move.hpp.
Referenced by is_ai_move(), and set_ai_move().
|
private |
Definition at line 105 of file move.hpp.
Referenced by add_seen_enemy(), get_seen_enemies(), and reset().
|
private |
Definition at line 106 of file move.hpp.
Referenced by add_seen_friend(), get_seen_friends(), and reset().
|
private |
Definition at line 108 of file move.hpp.
Referenced by get_tiles_entered(), reset(), and set_tiles_entered().
|
private |
Definition at line 107 of file move.hpp.
Referenced by get_unit(), reset(), and set_unit().