Game Develop C++ Platform: RuntimeVariablesContainer Class Reference

| Game Develop C++ Platform Platform for developing native games based on OpenGL and SFML with Game Develop

- Main Page
- Modules
- Classes
- Files

- Class List
- Class Index
- Class Hierarchy
- Class Members

All Classes Namespaces Files Functions Variables Typedefs Enumerations Groups Pages
Public Member Functions | Static Public Member Functions | List of all members
RuntimeVariablesContainer Class Reference
Game engine

Container for gd::Variable used at by games at runtime. More...

`#include <RuntimeVariablesContainer.h>`

Inheritance diagram for RuntimeVariablesContainer:
[legend]

## Public Member Functions

| RuntimeVariablesContainer (const gd::VariablesContainer &container)
| Construct a RuntimeVariablesContainer from a gd::VariablesContainer. More...
| RuntimeVariablesContainer ()
| Construct an empty container.
RuntimeVariablesContainer & | operator= (const gd::VariablesContainer &container)
| Initialize a RuntimeVariablesContainer from a gd::VariablesContainer. More...
virtual | ~RuntimeVariablesContainer ()
| Destructor: Properly clear the container.
bool | Has (const std::string &name) const
| Return true if the specified variable is in the container.
virtual gd::Variable & | Get (const std::string &name)
| Return a reference to the variable called name.
virtual const gd::Variable & | Get (const std::string &name) const
| Return a reference to the variable called name.
virtual gd::Variable & | Get (unsigned int index)
| Return a reference to the variable at the @ index position in the list. More...
virtual const gd::Variable & | Get (unsigned int index) const
| Return a reference to the variable at the @ index position in the list. More...
virtual void | Merge (const gd::VariablesContainer &container)
| Merge the variables from the container with the already existing variables. More...
const std::map< std::string, gd::Variable * > & | DumpAllVariables ()

## Static Public Member Functions

static gd::Variable & | GetBadVariable ()
| Return a "bad" variable that can be used when no other valid variable can be used.
static RuntimeVariablesContainer & | GetBadVariablesContainer ()
| Return a "bad" variables container that can be used when no other valid container can be used.

## Detailed Description

Container for gd::Variable used at by games at runtime.

See gd::VariablesContainer for the container used for storage.

See Also
  gd::VariablesContainer
  RuntimeScene
  RuntimeObject

## Constructor & Destructor Documentation

RuntimeVariablesContainer::RuntimeVariablesContainer | ( | const gd::VariablesContainer & | container) |  |

Construct a RuntimeVariablesContainer from a gd::VariablesContainer.

Variables contained in the original container will be accessible thanks to their index.

Here is the call graph for this function:

## Member Function Documentation

const std::map< std::string, gd::Variable* >& RuntimeVariablesContainer::DumpAllVariables | ( | ) |  |

inline

Get a map containing all variables.

virtual gd::Variable& RuntimeVariablesContainer::Get | ( | unsigned int | index) |  |

inlinevirtual

Return a reference to the variable at the @ index position in the list.

Warning
  No bound check is made. Please use other overload of gd::VariablesContainer::Get when you do not have any efficiency request.

Note
  This specific overload can used by code generated from events when a variable index is known at the time of the code generation.

Reimplemented in BadRuntimeVariablesContainer.

virtual const gd::Variable& RuntimeVariablesContainer::Get | ( | unsigned int | index) |  | const

inlinevirtual

Return a reference to the variable at the @ index position in the list.

Warning
  No bound check is made. Please use other overload of gd::VariablesContainer::GetVariable when you do not have any efficiency request.

Note
  This specific overload can used by code generated from events when a variable index is known at the time of the code generation.

Reimplemented in BadRuntimeVariablesContainer.

void RuntimeVariablesContainer::Merge | ( | const gd::VariablesContainer & | container) |  |

virtual

Merge the variables from the container with the already existing variables.

Already existing variables values are replaced. Newly added variables are available thanks to their index. Be careful: If the container was not empty, the index of the new variables are not the same as their index in the original container.

Reimplemented in BadRuntimeVariablesContainer.

Here is the call graph for this function:

RuntimeVariablesContainer & RuntimeVariablesContainer::operator= | ( | const gd::VariablesContainer & | container) |  |

Initialize a RuntimeVariablesContainer from a gd::VariablesContainer.

Variables contained in the original container will be accessible thanks to their index.
Already existing variables will be erased.

Here is the call graph for this function:

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

- RuntimeVariablesContainer.h
- RuntimeVariablesContainer.cpp