The Battle for Wesnoth  1.19.5+dev
Public Member Functions | Private Attributes | List of all members
actions::move_unit_spectator Class Reference

#include <move.hpp>

Inheritance diagram for actions::move_unit_spectator:

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_iteratorget_ambusher () const
 get the location of an ambusher More...
 
const unit_map::const_iteratorget_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_iteratorget_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_iteratorseen_enemies_
 
std::vector< unit_map::const_iteratorseen_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_
 

Detailed Description

Definition at line 36 of file move.hpp.

Constructor & Destructor Documentation

◆ move_unit_spectator() [1/2]

actions::move_unit_spectator::move_unit_spectator ( const unit_map units)

constructor

Definition at line 102 of file move.cpp.

◆ move_unit_spectator() [2/2]

actions::move_unit_spectator::move_unit_spectator ( )

Definition at line 113 of file move.cpp.

◆ ~move_unit_spectator()

actions::move_unit_spectator::~move_unit_spectator ( )
virtual

destructor

Definition at line 125 of file move.cpp.

Member Function Documentation

◆ add_seen_enemy()

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().

◆ add_seen_friend()

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().

◆ error()

void actions::move_unit_spectator::error ( const std::string &  message)
overridevirtual

ingerited from action_spectator

Reimplemented from action_spectator.

Definition at line 140 of file move.cpp.

References ERR_NG.

◆ get_ambusher()

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().

◆ get_failed_teleport()

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().

◆ get_interrupted()

bool actions::move_unit_spectator::get_interrupted ( ) const
inline

Definition at line 97 of file move.hpp.

References interrupted_.

◆ get_seen_enemies()

const std::vector< unit_map::const_iterator > & actions::move_unit_spectator::get_seen_enemies ( ) const

get the locations of seen enemies

Definition at line 84 of file move.cpp.

References seen_enemies_.

◆ get_seen_friends()

const std::vector< unit_map::const_iterator > & actions::move_unit_spectator::get_seen_friends ( ) const

get the locations of seen friends

Definition at line 90 of file move.cpp.

References seen_friends_.

◆ get_tiles_entered()

std::size_t actions::move_unit_spectator::get_tiles_entered ( ) const
inline

Definition at line 100 of file move.hpp.

References tiles_entered_.

Referenced by ai::move_result::do_execute().

◆ get_unit()

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().

◆ is_ai_move()

bool actions::move_unit_spectator::is_ai_move ( ) const
inline

Definition at line 94 of file move.hpp.

References is_ai_move_.

◆ reset()

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_.

◆ set_ai_move()

void actions::move_unit_spectator::set_ai_move ( bool  ai_move = true)
inline

Definition at line 93 of file move.hpp.

References ai::ai_move(), and is_ai_move_.

Referenced by ai::move_result::do_execute().

◆ set_ambusher()

void actions::move_unit_spectator::set_ambusher ( const unit_map::const_iterator u)

set the location of an ambusher

Definition at line 145 of file move.cpp.

References ambusher_.

◆ set_failed_teleport()

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_.

◆ set_interrupted()

void actions::move_unit_spectator::set_interrupted ( bool  interrupted)
inline

Definition at line 96 of file move.hpp.

References interrupted_.

◆ set_tiles_entered()

void actions::move_unit_spectator::set_tiles_entered ( std::size_t  tiles_entered)
inline

Definition at line 99 of file move.hpp.

References tiles_entered_.

◆ set_unit()

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().

Member Data Documentation

◆ ambusher_

unit_map::const_iterator actions::move_unit_spectator::ambusher_
private

Definition at line 103 of file move.hpp.

Referenced by get_ambusher(), reset(), and set_ambusher().

◆ failed_teleport_

unit_map::const_iterator actions::move_unit_spectator::failed_teleport_
private

Definition at line 104 of file move.hpp.

Referenced by get_failed_teleport(), reset(), and set_failed_teleport().

◆ interrupted_

bool actions::move_unit_spectator::interrupted_
private

Definition at line 109 of file move.hpp.

Referenced by get_interrupted(), reset(), and set_interrupted().

◆ is_ai_move_

bool actions::move_unit_spectator::is_ai_move_ = false
private

Definition at line 110 of file move.hpp.

Referenced by is_ai_move(), and set_ai_move().

◆ seen_enemies_

std::vector<unit_map::const_iterator> actions::move_unit_spectator::seen_enemies_
private

Definition at line 105 of file move.hpp.

Referenced by add_seen_enemy(), get_seen_enemies(), and reset().

◆ seen_friends_

std::vector<unit_map::const_iterator> actions::move_unit_spectator::seen_friends_
private

Definition at line 106 of file move.hpp.

Referenced by add_seen_friend(), get_seen_friends(), and reset().

◆ tiles_entered_

std::size_t actions::move_unit_spectator::tiles_entered_
private

Definition at line 108 of file move.hpp.

Referenced by get_tiles_entered(), reset(), and set_tiles_entered().

◆ unit_

unit_map::const_iterator actions::move_unit_spectator::unit_
private

Definition at line 107 of file move.hpp.

Referenced by get_unit(), reset(), and set_unit().


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