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 Member Functions | Private Attributes | List of all members
game_logic::map_formula_callable Class Reference

#include <callable.hpp>

Inheritance diagram for game_logic::map_formula_callable:
Inheritance graph

Public Types

typedef std::map< std::string,
variant >::const_iterator 
const_iterator
 

Public Member Functions

 map_formula_callable (const formula_callable *fallback=nullptr)
 
map_formula_callableadd (const std::string &key, const variant &value)
 
void set_fallback (const formula_callable *fallback)
 
bool empty () const
 
void clear ()
 
const_iterator begin () const
 
const_iterator end () 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 Member Functions

variant get_value (const std::string &key) const
 
void get_inputs (std::vector< formula_input > *inputs) const
 
void set_value (const std::string &key, const variant &value)
 

Private Attributes

std::map< std::string, variantvalues_
 
const formula_callablefallback_
 

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 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 155 of file callable.hpp.

Member Typedef Documentation

Definition at line 163 of file callable.hpp.

Constructor & Destructor Documentation

game_logic::map_formula_callable::map_formula_callable ( const formula_callable fallback = nullptr)
explicit

Definition at line 35 of file formula.cpp.

Member Function Documentation

map_formula_callable & game_logic::map_formula_callable::add ( const std::string key,
const variant value 
)
const_iterator game_logic::map_formula_callable::begin ( ) const
inline

Definition at line 165 of file callable.hpp.

References values_.

Referenced by ai::formula_ai::to_config().

void game_logic::map_formula_callable::clear ( )
inline

Definition at line 161 of file callable.hpp.

References values_.

bool game_logic::map_formula_callable::empty ( ) const
inline

Definition at line 160 of file callable.hpp.

References values_.

Referenced by ai::formula_ai::to_config().

const_iterator game_logic::map_formula_callable::end ( ) const
inline

Definition at line 166 of file callable.hpp.

References values_.

Referenced by ai::formula_ai::to_config().

void game_logic::map_formula_callable::get_inputs ( std::vector< formula_input > *  inputs) const
privatevirtual
variant game_logic::map_formula_callable::get_value ( const std::string key) const
privatevirtual
void game_logic::map_formula_callable::set_fallback ( const formula_callable fallback)
inline

Definition at line 159 of file callable.hpp.

References fallback_.

Referenced by game_logic::formula_function_expression::execute().

void game_logic::map_formula_callable::set_value ( const std::string key,
const variant value 
)
privatevirtual

Reimplemented from game_logic::formula_callable.

Definition at line 70 of file formula.cpp.

References values_.

Member Data Documentation

const formula_callable* game_logic::map_formula_callable::fallback_
private

Definition at line 173 of file callable.hpp.

Referenced by get_inputs(), get_value(), and set_fallback().

std::map<std::string,variant> game_logic::map_formula_callable::values_
private

Definition at line 172 of file callable.hpp.

Referenced by add(), begin(), clear(), empty(), end(), get_inputs(), get_value(), and set_value().


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