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

#include <callable_objects.hpp>

Inheritance diagram for game_logic::safe_call_callable:
Inheritance graph

Public Member Functions

 safe_call_callable (const variant &main, const expression_ptr &backup)
 
const variantget_main () const
 
const expression_ptrget_backup () const
 
void set_backup_result (const variant &v)
 
- 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< game_logic::formula_input > *inputs) const
 

Private Attributes

variant main_
 
variant backup_
 
expression_ptr backup_formula_
 

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 204 of file callable_objects.hpp.

Constructor & Destructor Documentation

game_logic::safe_call_callable::safe_call_callable ( const variant main,
const expression_ptr backup 
)
inline

Definition at line 212 of file callable_objects.hpp.

Member Function Documentation

const expression_ptr& game_logic::safe_call_callable::get_backup ( ) const
inline

Definition at line 219 of file callable_objects.hpp.

References backup_formula_.

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

void game_logic::safe_call_callable::get_inputs ( std::vector< game_logic::formula_input > *  inputs) const
privatevirtual

Reimplemented from game_logic::formula_callable.

Definition at line 297 of file callable_objects.cpp.

References game_logic::FORMULA_READ_ONLY.

const variant& game_logic::safe_call_callable::get_main ( ) const
inline

Definition at line 218 of file callable_objects.hpp.

References main_.

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

variant game_logic::safe_call_callable::get_value ( const std::string key) const
privatevirtual

Implements game_logic::formula_callable.

Definition at line 287 of file callable_objects.cpp.

References backup_, and main_.

void game_logic::safe_call_callable::set_backup_result ( const variant v)
inline

Definition at line 221 of file callable_objects.hpp.

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

Member Data Documentation

variant game_logic::safe_call_callable::backup_
private

Definition at line 206 of file callable_objects.hpp.

Referenced by get_value().

expression_ptr game_logic::safe_call_callable::backup_formula_
private

Definition at line 207 of file callable_objects.hpp.

Referenced by get_backup().

variant game_logic::safe_call_callable::main_
private

Definition at line 205 of file callable_objects.hpp.

Referenced by get_main(), and get_value().


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