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

#include <callable.hpp>

Inheritance diagram for game_logic::formula_callable:
Inheritance graph

Public Member Functions

 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
 
virtual void get_inputs (std::vector< formula_input > *) 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
 

Protected Types

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

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

TYPE type_
 

Private Member Functions

virtual variant get_value (const std::string &key) const =0
 

Private Attributes

bool has_self_
 

Detailed Description

Definition at line 34 of file callable.hpp.

Member Enumeration Documentation

Enumerator
FORMULA_C 
TERRAIN_C 
LOCATION_C 
UNIT_TYPE_C 
UNIT_C 
ATTACK_TYPE_C 
MOVE_PARTIAL_C 
MOVE_C 
ATTACK_C 
MOVE_MAP_C 

Definition at line 96 of file callable.hpp.

Constructor & Destructor Documentation

game_logic::formula_callable::formula_callable ( bool  has_self = true)
inlineexplicit

Definition at line 36 of file callable.hpp.

virtual game_logic::formula_callable::~formula_callable ( )
inlineprotectedvirtual

Definition at line 75 of file callable.hpp.

Member Function Documentation

virtual int game_logic::formula_callable::do_compare ( const formula_callable callable) const
inlineprotectedvirtual
bool game_logic::formula_callable::equals ( const formula_callable other) const
inline

Definition at line 56 of file callable.hpp.

References do_compare().

Referenced by variant::operator==().

virtual void game_logic::formula_callable::get_inputs ( std::vector< formula_input > *  ) const
inlinevirtual
virtual variant game_logic::formula_callable::get_value ( const std::string key) const
privatepure virtual
bool game_logic::formula_callable::has_key ( const std::string key) const
inline

Definition at line 71 of file callable.hpp.

References variant::is_null(), and query_value().

std::vector<formula_input> game_logic::formula_callable::inputs ( ) const
inline

Definition at line 50 of file callable.hpp.

References get_inputs().

Referenced by ai::formula_ai::on_create(), and variant::to_debug_string().

bool game_logic::formula_callable::less ( const formula_callable other) const
inline

Definition at line 60 of file callable.hpp.

References do_compare().

Referenced by variant::operator<=().

void game_logic::formula_callable::mutate_value ( const std::string key,
const variant value 
)
inline

Definition at line 46 of file callable.hpp.

References set_value().

variant game_logic::formula_callable::query_value ( const std::string key) const
inline
void game_logic::formula_callable::serialize ( std::string str) const
inline

Definition at line 67 of file callable.hpp.

References serialize_to_string().

Referenced by variant::serialize_to_string().

virtual void game_logic::formula_callable::serialize_to_string ( std::string ) const
inlineprotectedvirtual

Reimplemented in location_callable, and game_logic::key_value_pair.

Definition at line 89 of file callable.hpp.

Referenced by serialize().

void game_logic::formula_callable::set_value ( const std::string key,
const variant value 
)
protectedvirtual

Reimplemented in game_logic::map_formula_callable.

Definition at line 29 of file formula.cpp.

Referenced by mutate_value().

Member Data Documentation

bool game_logic::formula_callable::has_self_
private

Definition at line 102 of file callable.hpp.

Referenced by query_value().

TYPE game_logic::formula_callable::type_
protected

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