The Battle for Wesnoth  1.13.4+dev
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
Public Types | Public Member Functions | Private Attributes | List of all members
unit_callable Class Reference

#include <callable_objects.hpp>

Inheritance diagram for unit_callable:
Inheritance graph

Public Types

typedef map_location location
 

Public Member Functions

 unit_callable (const location &loc, const unit &u)
 
 unit_callable (const unit &u)
 
const unitget_unit () const
 
const locationget_location () const
 
variant get_value (const std::string &key) const
 
void get_inputs (std::vector< game_logic::formula_input > *inputs) const
 
int do_compare (const formula_callable *callable) const
 
- Public Member Functions inherited from game_logic::formula_callable
 formula_callable (bool has_self=true)
 
variant query_value (const std::string &key) const
 
void mutate_value (const std::string &key, const variant &value)
 
std::vector< formula_inputinputs () const
 
bool equals (const formula_callable *other) const
 
bool less (const formula_callable *other) const
 
void serialize (std::string &str) const
 
bool has_key (const std::string &key) const
 
- Public Member Functions inherited from reference_counted_object
 reference_counted_object ()
 
 reference_counted_object (const reference_counted_object &)
 
reference_counted_objectoperator= (const reference_counted_object &)
 
virtual ~reference_counted_object ()
 
void add_ref () const
 
void dec_ref () const
 
int refcount () const
 

Private Attributes

const locationloc_
 
const unitu_
 

Additional Inherited Members

- Protected Types inherited from game_logic::formula_callable
enum  TYPE {
  FORMULA_C, TERRAIN_C, LOCATION_C, UNIT_TYPE_C,
  UNIT_C, ATTACK_TYPE_C, MOVE_PARTIAL_C, MOVE_C,
  ATTACK_C, MOVE_MAP_C
}
 
- Protected Member Functions inherited from game_logic::formula_callable
virtual ~formula_callable ()
 
virtual void set_value (const std::string &key, const variant &value)
 
virtual int do_compare (const formula_callable *callable) const
 
virtual void serialize_to_string (std::string &) const
 
- Protected Member Functions inherited from reference_counted_object
void turn_reference_counting_off () const
 
- Protected Attributes inherited from game_logic::formula_callable
TYPE type_
 

Detailed Description

Definition at line 145 of file callable_objects.hpp.

Member Typedef Documentation

Definition at line 147 of file callable_objects.hpp.

Constructor & Destructor Documentation

unit_callable::unit_callable ( const location loc,
const unit u 
)
inline
unit_callable::unit_callable ( const unit u)
inline

Member Function Documentation

int unit_callable::do_compare ( const formula_callable callable) const

Definition at line 365 of file callable_objects.cpp.

References u_, and unit::underlying_id().

void unit_callable::get_inputs ( std::vector< game_logic::formula_input > *  inputs) const
virtual

Reimplemented from game_logic::formula_callable.

Definition at line 321 of file callable_objects.cpp.

References game_logic::FORMULA_READ_ONLY.

const location& unit_callable::get_location ( ) const
inline

Definition at line 161 of file callable_objects.hpp.

References loc_.

Referenced by game_logic::attack_candidate_action::evaluate().

const unit& unit_callable::get_unit ( ) const
inline

Definition at line 160 of file callable_objects.hpp.

References u_.

variant unit_callable::get_value ( const std::string key) const
virtual

Member Data Documentation

const location& unit_callable::loc_
private

Definition at line 167 of file callable_objects.hpp.

Referenced by get_location(), and get_value().

const unit& unit_callable::u_
private

Definition at line 168 of file callable_objects.hpp.

Referenced by do_compare(), get_unit(), and get_value().


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