![]() |
Olympe Engine 2.0
2D Game Engine with ECS Architecture
|
#include <ParameterSchema.h>
Public Member Functions | |
| ParameterSchemaRegistry (const ParameterSchemaRegistry &)=delete | |
| ParameterSchemaRegistry & | operator= (const ParameterSchemaRegistry &)=delete |
| ParameterSchemaRegistry (ParameterSchemaRegistry &&)=delete | |
| ParameterSchemaRegistry & | operator= (ParameterSchemaRegistry &&)=delete |
| void | InitializeBuiltInSchemas () |
| bool | LoadFromJSON (const std::string &filepath) |
| bool | LoadSchemaFromFile (const std::string &filepath) |
| size_t | GetSchemaCount () const |
| const ParameterSchemaEntry * | FindParameterSchema (const std::string ¶meterName) const |
| const ComponentSchema * | GetComponentSchema (const std::string &componentType) const |
| bool | ValidateParameter (const std::string ¶meterName, const ComponentParameter ¶m) const |
| void | RegisterParameterSchema (const ParameterSchemaEntry &entry) |
| void | DiscoverComponentSchema (const ComponentDefinition &componentDef) |
| void | DiscoverSchemasFromPrefab (const PrefabBlueprint &prefab) |
Static Public Member Functions | |
| static ParameterSchemaRegistry & | GetInstance () |
Private Member Functions | |
| ParameterSchemaRegistry ()=default | |
| ~ParameterSchemaRegistry ()=default | |
| void | EnsureInitialized () |
| void | AutoRegisterParameter (const std::string &componentType, const std::string ¶mName, ComponentParameter::Type paramType, const ComponentParameter &defaultValue) |
| ComponentParameter::Type | StringToParameterType (const std::string &typeStr) const |
| ComponentParameter | ParseDefaultValue (const nlohmann::json &valueJson, ComponentParameter::Type type) const |
Private Attributes | |
| bool | isInitialized_ = false |
| std::map< std::string, ComponentSchema > | componentSchemas_ |
| std::map< std::string, std::string > | parameterToComponent_ |
| std::map< std::string, std::string > | aliasToParameter_ |
Definition at line 67 of file ParameterSchema.h.
|
delete |
|
delete |
|
privatedefault |
|
privatedefault |
|
private |
Definition at line 714 of file ParameterSchema.cpp.
References GetComponentTypeID_Static(), and RegisterParameterSchema().
Referenced by DiscoverComponentSchema().
Here is the call graph for this function:
Here is the caller graph for this function:| void ParameterSchemaRegistry::DiscoverComponentSchema | ( | const ComponentDefinition & | componentDef | ) |
Definition at line 673 of file ParameterSchema.cpp.
References AutoRegisterParameter(), componentSchemas_, GetComponentTypeID_Static(), and SYSTEM_LOG.
Referenced by DiscoverSchemasFromPrefab().
Here is the call graph for this function:
Here is the caller graph for this function:| void ParameterSchemaRegistry::DiscoverSchemasFromPrefab | ( | const PrefabBlueprint & | prefab | ) |
Definition at line 706 of file ParameterSchema.cpp.
References DiscoverComponentSchema(), and GetComponentTypeID_Static().
Referenced by PrefabScanner::ParsePrefab().
Here is the call graph for this function:
Here is the caller graph for this function:
|
private |
Definition at line 19 of file ParameterSchema.cpp.
References InitializeBuiltInSchemas(), isInitialized_, and SYSTEM_LOG.
Referenced by GetInstance().
Here is the call graph for this function:
Here is the caller graph for this function:| const ParameterSchemaEntry * ParameterSchemaRegistry::FindParameterSchema | ( | const std::string & | parameterName | ) | const |
Definition at line 559 of file ParameterSchema.cpp.
References aliasToParameter_, componentSchemas_, GetComponentTypeID_Static(), ComponentSchema::parameters, and parameterToComponent_.
Referenced by ValidateParameter().
Here is the call graph for this function:
Here is the caller graph for this function:| const ComponentSchema * ParameterSchemaRegistry::GetComponentSchema | ( | const std::string & | componentType | ) | const |
Definition at line 596 of file ParameterSchema.cpp.
References componentSchemas_, and GetComponentTypeID_Static().
Referenced by ParseParameterWithSchema().
Here is the call graph for this function:
Here is the caller graph for this function:
|
inlinestatic |
Definition at line 71 of file ParameterSchema.h.
References EnsureInitialized(), and GetComponentTypeID_Static().
Referenced by ParameterResolver::ApplyPropertyOverride(), ParameterResolver::ExtractComponentParameters(), PrefabScanner::Initialize(), ParseParameterWithSchema(), PrefabScanner::ParsePrefab(), and ParameterResolver::ValidateResolvedComponent().
Here is the call graph for this function:
Here is the caller graph for this function:| size_t ParameterSchemaRegistry::GetSchemaCount | ( | ) | const |
Definition at line 554 of file ParameterSchema.cpp.
References parameterToComponent_.
Referenced by PrefabScanner::Initialize().
Here is the caller graph for this function:| void ParameterSchemaRegistry::InitializeBuiltInSchemas | ( | ) |
Definition at line 29 of file ParameterSchema.cpp.
References aliasToParameter_, ComponentParameter::Bool, ComponentParameter::Color, ComponentParameter::Float, ComponentParameter::FromBool(), ComponentParameter::FromColor(), ComponentParameter::FromFloat(), ComponentParameter::FromInt(), ComponentParameter::FromString(), ComponentParameter::FromVector2(), ComponentParameter::FromVector3(), ComponentParameter::Int, parameterToComponent_, RegisterParameterSchema(), ComponentParameter::String, SYSTEM_LOG, ComponentParameter::Vector2, and ComponentParameter::Vector3.
Referenced by EnsureInitialized().
Here is the call graph for this function:
Here is the caller graph for this function:Definition at line 376 of file ParameterSchema.cpp.
References ComponentParameter::Bool, ComponentParameter::Float, ComponentParameter::FromBool(), ComponentParameter::FromFloat(), ComponentParameter::FromInt(), ComponentParameter::FromString(), GetComponentTypeID_Static(), ComponentParameter::Int, ParseDefaultValue(), RegisterParameterSchema(), ComponentParameter::String, StringToParameterType(), and SYSTEM_LOG.
Referenced by LoadSchemaFromFile().
Here is the call graph for this function:
Here is the caller graph for this function:Definition at line 370 of file ParameterSchema.cpp.
References LoadFromJSON().
Here is the call graph for this function:
|
delete |
|
delete |
|
private |
Definition at line 495 of file ParameterSchema.cpp.
References ComponentParameter::Array, ComponentParameter::Bool, ComponentParameter::Color, ComponentParameter::Float, ComponentParameter::FromBool(), ComponentParameter::FromColor(), ComponentParameter::FromFloat(), ComponentParameter::FromInt(), ComponentParameter::FromString(), ComponentParameter::FromVector3(), GetComponentTypeID_Static(), ComponentParameter::Int, ComponentParameter::String, ComponentParameter::Vector2, and ComponentParameter::Vector3.
Referenced by LoadFromJSON().
Here is the call graph for this function:
Here is the caller graph for this function:| void ParameterSchemaRegistry::RegisterParameterSchema | ( | const ParameterSchemaEntry & | entry | ) |
Definition at line 650 of file ParameterSchema.cpp.
References componentSchemas_, ComponentSchema::componentType, GetComponentTypeID_Static(), and parameterToComponent_.
Referenced by AutoRegisterParameter(), InitializeBuiltInSchemas(), and LoadFromJSON().
Here is the call graph for this function:
Here is the caller graph for this function:
|
private |
Definition at line 481 of file ParameterSchema.cpp.
References ComponentParameter::Array, ComponentParameter::Bool, ComponentParameter::Color, ComponentParameter::EntityRef, ComponentParameter::Float, GetComponentTypeID_Static(), ComponentParameter::Int, ComponentParameter::String, ComponentParameter::Unknown, ComponentParameter::Vector2, and ComponentParameter::Vector3.
Referenced by LoadFromJSON().
Here is the call graph for this function:
Here is the caller graph for this function:| bool ParameterSchemaRegistry::ValidateParameter | ( | const std::string & | parameterName, |
| const ComponentParameter & | param | ||
| ) | const |
Definition at line 606 of file ParameterSchema.cpp.
References FindParameterSchema(), ComponentParameter::Float, GetComponentTypeID_Static(), ComponentParameter::Int, SYSTEM_LOG, ComponentParameter::Unknown, ComponentParameter::Vector2, and ComponentParameter::Vector3.
Here is the call graph for this function:
|
private |
Definition at line 136 of file ParameterSchema.h.
Referenced by FindParameterSchema(), and InitializeBuiltInSchemas().
|
private |
Definition at line 134 of file ParameterSchema.h.
Referenced by DiscoverComponentSchema(), FindParameterSchema(), GetComponentSchema(), and RegisterParameterSchema().
Definition at line 118 of file ParameterSchema.h.
Referenced by EnsureInitialized().
|
private |
Definition at line 135 of file ParameterSchema.h.
Referenced by FindParameterSchema(), GetSchemaCount(), InitializeBuiltInSchemas(), and RegisterParameterSchema().