![]() |
Olympe Engine 2.0
2D Game Engine with ECS Architecture
|
#include <ComponentDefinition.h>
Collaboration diagram for ComponentParameter:Public Types | |
| enum class | Type : uint8_t { Unknown = 0 , Bool , Int , Float , String , Vector2 , Vector3 , Color , Array , EntityRef } |
Public Member Functions | |
| bool | AsBool () const |
| int | AsInt () const |
| float | AsFloat () const |
| std::string | AsString () const |
| Vector | AsVector () const |
| SDL_Color | AsColor () const |
| EntityID | AsEntityRef () const |
| const nlohmann::json & | AsArray () const |
Static Public Member Functions | |
| static ComponentParameter | FromBool (bool value) |
| static ComponentParameter | FromInt (int value) |
| static ComponentParameter | FromFloat (float value) |
| static ComponentParameter | FromString (const std::string &value) |
| static ComponentParameter | FromVector2 (float x, float y) |
| static ComponentParameter | FromVector3 (float x, float y, float z) |
| static ComponentParameter | FromColor (uint8_t r, uint8_t g, uint8_t b, uint8_t a=255) |
| static ComponentParameter | FromEntityRef (EntityID entityId) |
| static ComponentParameter | FromArray (const nlohmann::json &arrayData) |
Public Attributes | |
| Type | type = Type::Unknown |
| bool | boolValue = false |
| int | intValue = 0 |
| float | floatValue = 0.0f |
| std::string | stringValue |
| Vector | vectorValue |
| SDL_Color | colorValue = { 255, 255, 255, 255 } |
| EntityID | entityRefValue = INVALID_ENTITY_ID |
| std::shared_ptr< nlohmann::json > | arrayValue |
Definition at line 26 of file ComponentDefinition.h.
|
strong |
| Enumerator | |
|---|---|
| Unknown | |
| Bool | |
| Int | |
| Float | |
| String | |
| Vector2 | |
| Vector3 | |
| Color | |
| Array | |
| EntityRef | |
Definition at line 28 of file ComponentDefinition.h.
| const nlohmann::json & ComponentParameter::AsArray | ( | ) | const |
Definition at line 378 of file ComponentDefinition.cpp.
References Array, arrayValue, GetComponentTypeID_Static(), and type.
Here is the call graph for this function:| bool ComponentParameter::AsBool | ( | ) | const |
Definition at line 126 of file ComponentDefinition.cpp.
References Bool, boolValue, EntityRef, entityRefValue, Float, floatValue, GetComponentTypeID_Static(), Int, intValue, INVALID_ENTITY_ID, String, stringValue, and type.
Here is the call graph for this function:| SDL_Color ComponentParameter::AsColor | ( | ) | const |
Definition at line 283 of file ComponentDefinition.cpp.
References ClampColorValue(), Color, colorValue, GetComponentTypeID_Static(), String, stringValue, SYSTEM_LOG, and type.
Here is the call graph for this function:| EntityID ComponentParameter::AsEntityRef | ( | ) | const |
Definition at line 358 of file ComponentDefinition.cpp.
References EntityRef, entityRefValue, Int, intValue, INVALID_ENTITY_ID, String, stringValue, and type.
| float ComponentParameter::AsFloat | ( | ) | const |
Definition at line 174 of file ComponentDefinition.cpp.
References Bool, boolValue, Float, floatValue, Int, intValue, String, stringValue, and type.
| int ComponentParameter::AsInt | ( | ) | const |
Definition at line 150 of file ComponentDefinition.cpp.
References Bool, boolValue, EntityRef, entityRefValue, Float, floatValue, Int, intValue, String, stringValue, and type.
| std::string ComponentParameter::AsString | ( | ) | const |
Definition at line 196 of file ComponentDefinition.cpp.
References Array, arrayValue, Bool, boolValue, Color, colorValue, EntityRef, entityRefValue, Float, floatValue, GetComponentTypeID_Static(), Int, intValue, String, stringValue, type, Vector2, Vector3, vectorValue, Vector::x, Vector::y, and Vector::z.
Here is the call graph for this function:| Vector ComponentParameter::AsVector | ( | ) | const |
Definition at line 240 of file ComponentDefinition.cpp.
References GetComponentTypeID_Static(), String, stringValue, type, Vector2, Vector3, and vectorValue.
Here is the call graph for this function:
|
static |
Definition at line 113 of file ComponentDefinition.cpp.
References Array, GetComponentTypeID_Static(), and type.
Referenced by anonymous_namespace{World.cpp}::JsonValueToComponentParameter(), and ParseParameterWithSchema().
Here is the call graph for this function:
Here is the caller graph for this function:
|
static |
Definition at line 49 of file ComponentDefinition.cpp.
References Bool, GetComponentTypeID_Static(), and type.
Referenced by ParameterResolver::ConvertLevelProperty(), World::ExtractCustomProperties(), ParameterSchemaRegistry::InitializeBuiltInSchemas(), anonymous_namespace{World.cpp}::JsonValueToComponentParameter(), ParameterSchemaRegistry::LoadFromJSON(), ParameterSchemaRegistry::ParseDefaultValue(), and ParseParameterWithSchema().
Here is the call graph for this function:
Here is the caller graph for this function:
|
static |
Definition at line 97 of file ComponentDefinition.cpp.
References Color, GetComponentTypeID_Static(), and type.
Referenced by ParameterResolver::ConvertLevelProperty(), ParameterSchemaRegistry::InitializeBuiltInSchemas(), ParameterSchemaRegistry::ParseDefaultValue(), and ParseParameterWithSchema().
Here is the call graph for this function:
Here is the caller graph for this function:
|
static |
Definition at line 105 of file ComponentDefinition.cpp.
References EntityRef, GetComponentTypeID_Static(), and type.
Referenced by ParameterResolver::ConvertLevelProperty(), and ParseParameterWithSchema().
Here is the call graph for this function:
Here is the caller graph for this function:
|
static |
Definition at line 65 of file ComponentDefinition.cpp.
References Float, GetComponentTypeID_Static(), and type.
Referenced by ParameterResolver::ConvertLevelProperty(), World::ExtractCustomProperties(), ParameterSchemaRegistry::InitializeBuiltInSchemas(), anonymous_namespace{World.cpp}::JsonValueToComponentParameter(), ParameterSchemaRegistry::LoadFromJSON(), ParameterSchemaRegistry::ParseDefaultValue(), ParseParameterWithSchema(), and ParameterResolver::ResolveComponent().
Here is the call graph for this function:
Here is the caller graph for this function:
|
static |
Definition at line 57 of file ComponentDefinition.cpp.
References GetComponentTypeID_Static(), Int, and type.
Referenced by ParameterResolver::ConvertLevelProperty(), World::ExtractCustomProperties(), ParameterSchemaRegistry::InitializeBuiltInSchemas(), anonymous_namespace{World.cpp}::JsonValueToComponentParameter(), ParameterSchemaRegistry::LoadFromJSON(), ParameterSchemaRegistry::ParseDefaultValue(), and ParseParameterWithSchema().
Here is the call graph for this function:
Here is the caller graph for this function:
|
static |
Definition at line 73 of file ComponentDefinition.cpp.
References GetComponentTypeID_Static(), String, and type.
Referenced by ParameterResolver::ConvertLevelProperty(), ParameterSchemaRegistry::InitializeBuiltInSchemas(), anonymous_namespace{World.cpp}::JsonValueToComponentParameter(), ParameterSchemaRegistry::LoadFromJSON(), ParameterSchemaRegistry::ParseDefaultValue(), and ParseParameterWithSchema().
Here is the call graph for this function:
Here is the caller graph for this function:
|
static |
Definition at line 81 of file ComponentDefinition.cpp.
References GetComponentTypeID_Static(), type, and Vector2.
Referenced by ParameterSchemaRegistry::InitializeBuiltInSchemas(), and ParseParameterWithSchema().
Here is the call graph for this function:
Here is the caller graph for this function:
|
static |
Definition at line 89 of file ComponentDefinition.cpp.
References GetComponentTypeID_Static(), type, and Vector3.
Referenced by ParameterResolver::ConvertLevelProperty(), ParameterSchemaRegistry::InitializeBuiltInSchemas(), anonymous_namespace{World.cpp}::JsonValueToComponentParameter(), ParameterSchemaRegistry::ParseDefaultValue(), and ParseParameterWithSchema().
Here is the call graph for this function:
Here is the caller graph for this function:| std::shared_ptr<nlohmann::json> ComponentParameter::arrayValue |
Definition at line 55 of file ComponentDefinition.h.
Referenced by AsArray(), and AsString().
Definition at line 45 of file ComponentDefinition.h.
Referenced by AsBool(), AsFloat(), AsInt(), and AsString().
| SDL_Color ComponentParameter::colorValue = { 255, 255, 255, 255 } |
Definition at line 50 of file ComponentDefinition.h.
Referenced by AsColor(), and AsString().
| EntityID ComponentParameter::entityRefValue = INVALID_ENTITY_ID |
Definition at line 51 of file ComponentDefinition.h.
Referenced by AsBool(), AsEntityRef(), AsInt(), and AsString().
| float ComponentParameter::floatValue = 0.0f |
Definition at line 47 of file ComponentDefinition.h.
Referenced by AsBool(), AsFloat(), AsInt(), and AsString().
| int ComponentParameter::intValue = 0 |
Definition at line 46 of file ComponentDefinition.h.
Referenced by AsBool(), AsEntityRef(), AsFloat(), AsInt(), and AsString().
| std::string ComponentParameter::stringValue |
Definition at line 48 of file ComponentDefinition.h.
Referenced by AsBool(), AsColor(), AsEntityRef(), AsFloat(), AsInt(), AsString(), and AsVector().
| Type ComponentParameter::type = Type::Unknown |
Definition at line 42 of file ComponentDefinition.h.
Referenced by AsArray(), AsBool(), AsColor(), AsEntityRef(), AsFloat(), AsInt(), AsString(), AsVector(), FromArray(), FromBool(), FromColor(), FromEntityRef(), FromFloat(), FromInt(), FromString(), FromVector2(), and FromVector3().
| Vector ComponentParameter::vectorValue |
Definition at line 49 of file ComponentDefinition.h.
Referenced by AsString(), and AsVector().