12 ComponentSchema ComponentSchema::FromJson(
const json& data) {
ComponentSchema s;
if (data.contains(
"componentName")) {
s.
componentName = data[
"componentName"].get<std::string>(); }
if (data.contains(
"category")) {
s.category = data[
"category"].get<std::string>(); }
if (data.contains(
"description")) {
s.description = data[
"description"].get<std::string>(); }
if (data.contains(
"isDeprecated")) {
s.isDeprecated = data[
"isDeprecated"].get<
bool>(); }
return s; }
18 EntityPrefab EntityPrefab::FromJson(
const json& data) {
EntityPrefab p;
if (data.contains(
"prefabName")) {
p.
prefabName = data[
"prefabName"].get<std::string>(); }
if (data.contains(
"prefabPath")) {
p.prefabPath = data[
"prefabPath"].get<std::string>(); }
if (data.contains(
"schemaVersion")) {
p.schemaVersion = data[
"schemaVersion"].get<
int>(); }
return p; }
ComponentTypeID GetComponentTypeID_Static()
static void SaveJsonToFile(const std::string &filePath, const json &data)
static EntityPrefab LoadFromFile(const std::string &filePath)
static bool ValidatePrefab(const EntityPrefab &prefab)
static json LoadJsonFromFile(const std::string &filePath)
static std::vector< ComponentSchema > LoadAllSchemas(const std::string &schemasPath)
static ComponentSchema ParseSchemaV4(const json &data)
static void SaveToFile(const std::string &filePath, const EntityPrefab &prefab)
static bool ValidateComponentData(const ComponentData &component, const ComponentSchema &schema)
static std::string GetSchemaVersion(const json &data)
static ComponentSchema ParseComponentSchema(const json &schemaJson)
static json SerializeSchemaV4(const EntityPrefab &prefab)
< Provides AssetID and INVALID_ASSET_ID
static ComponentData FromJson(const json &data)
std::string componentType
std::map< std::string, std::string > properties
std::string componentName
static ComponentSchema FromJson(const json &data)
std::vector< ParameterDefinition > parameters
std::string componentName
std::vector< ComponentData > components
std::map< std::string, std::string > metadata
static EntityPrefab FromJson(const json &data)
static ParameterDefinition FromJson(const json &data)