Context passed to components during generation.
More...
#include <entitygen.hpp>
|
| bool | has (const std::wstring &component_key) const |
| | Check if a component value has already been generated.
|
| |
| template<typename T > |
| T | get (const std::wstring &component_key) const |
| | Typed retrieval of an already-generated component value.
|
| |
| effolkronium::random_local & | random () const |
| | Access the random engine for this generation.
|
| |
Context passed to components during generation.
Provides access to previously generated component values and a seeded random engine. Created and populated by the entity generator; not user-constructible.
- See also
- component::generate()
Definition at line 38 of file entitygen.hpp.
◆ get()
template<typename T >
| T dasmig::generation_context::get |
( |
const std::wstring & |
component_key | ) |
const |
|
inline |
Typed retrieval of an already-generated component value.
- Template Parameters
-
| T | The expected type of the stored value. |
- Parameters
-
| component_key | The component key to retrieve. |
- Returns
- The value cast to
T.
- Exceptions
-
| std::bad_any_cast | If T does not match the stored type. |
Definition at line 55 of file entitygen.hpp.
◆ has()
| bool dasmig::generation_context::has |
( |
const std::wstring & |
component_key | ) |
const |
|
inline |
Check if a component value has already been generated.
- Parameters
-
| component_key | The component key to look up. |
- Returns
true if a value for the key exists in the context.
Definition at line 44 of file entitygen.hpp.
◆ random()
| effolkronium::random_local & dasmig::generation_context::random |
( |
| ) |
const |
|
inline |
Access the random engine for this generation.
- Returns
- A reference to the per-component seeded random engine.
Definition at line 62 of file entitygen.hpp.
◆ eg
The documentation for this class was generated from the following file: