The Battle for Wesnoth  1.13.4+dev
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
Classes | Macros | Functions
callable_objects.hpp File Reference
#include "formula/callable.hpp"
#include "map/map.hpp"
#include "team.hpp"
#include "units/unit.hpp"
Include dependency graph for callable_objects.hpp:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

class  terrain_callable
 
class  location_callable
 
class  attack_type_callable
 
class  unit_callable
 
class  unit_type_callable
 
class  config_callable
 

Macros

#define CALLABLE_WRAPPER_START(klass)
 
#define CALLABLE_WRAPPER_INPUT(VAR)   inputs->push_back(game_logic::formula_input(#VAR, FORMULA_READ_ONLY));
 
#define CALLABLE_WRAPPER_INPUT_END
 
#define CALLABLE_WRAPPER_VAR(VAR)
 
#define CALLABLE_WRAPPER_FN2(VAR, FN)
 
#define CALLABLE_WRAPPER_FN(VAR)   CALLABLE_WRAPPER_FN2(VAR, VAR)
 
#define CALLABLE_WRAPPER_END
 

Functions

template<typename T , typename K >
variant convert_map (const std::map< T, K > &map)
 
template<typename T >
variant convert_vector (const std::vector< T > &input_vector)
 
CALLABLE_WRAPPER_INPUT_END if (key=="terrain")
 

Macro Definition Documentation

#define CALLABLE_WRAPPER_END
Value:
{ return variant(); } \
} \
};

Definition at line 56 of file callable_objects.hpp.

#define CALLABLE_WRAPPER_FN (   VAR)    CALLABLE_WRAPPER_FN2(VAR, VAR)

Definition at line 54 of file callable_objects.hpp.

#define CALLABLE_WRAPPER_FN2 (   VAR,
  FN 
)
Value:
if(key == #VAR) { \
return variant(object_.FN()); \
} else

Definition at line 49 of file callable_objects.hpp.

#define CALLABLE_WRAPPER_INPUT (   VAR)    inputs->push_back(game_logic::formula_input(#VAR, FORMULA_READ_ONLY));

Definition at line 36 of file callable_objects.hpp.

#define CALLABLE_WRAPPER_INPUT_END
Value:
} \
\
variant get_value(const std::string& key) const {
GLsizei const GLcharARB ** string
Definition: glew.h:4503

Definition at line 39 of file callable_objects.hpp.

#define CALLABLE_WRAPPER_START (   klass)
Value:
class klass##_callable : public game_logic::formula_callable { \
const klass& object_; \
public: \
explicit klass##_callable(const klass& object) : object_(object) \
{} \
\
const klass& get_##klass() const { return object_; } \
void get_inputs(std::vector<game_logic::formula_input>* inputs) const \
{ \
GLvoid **typedef void(GLAPIENTRY *PFNGLGETVERTEXATTRIBDVPROC)(GLuint
Definition: glew.h:1806
virtual void get_inputs(std::vector< formula_input > *) const
Definition: callable.hpp:64

Definition at line 24 of file callable_objects.hpp.

#define CALLABLE_WRAPPER_VAR (   VAR)
Value:
if(key == #VAR) { \
return variant(object_.VAR); \
} else

Definition at line 44 of file callable_objects.hpp.

Function Documentation

template<typename T , typename K >
variant convert_map ( const std::map< T, K > &  map)

Definition at line 22 of file callable_objects.cpp.

References i.

Referenced by unit_callable::get_value().

template<typename T >
variant convert_vector ( const std::vector< T > &  input_vector)

Definition at line 34 of file callable_objects.cpp.

References i.

else if ( key  = = "terrain")