![]() |
Olympe Engine 2.0
2D Game Engine with ECS Architecture
|
#include <PrefabScanner.h>
Public Member Functions | |
| PrefabScanner () | |
| ~PrefabScanner () | |
| PrefabRegistry | Initialize (const std::string &prefabDirectory="Gamedata/EntityPrefab") |
| Initialize the prefab system (call once at startup) | |
| std::string | NormalizeType (const std::string &type) const |
| Normalize a type string to canonical form. | |
| bool | AreTypesEquivalent (const std::string &type1, const std::string &type2) const |
| Check if two types are equivalent. | |
| bool | IsTypeRegistered (const std::string &type) const |
| Check if a type is registered. | |
| bool | GetCanonicalInfo (const std::string &type, std::string &outCanonical, std::string &outPrefabFile) const |
| Get canonical type info (for debugging) | |
| std::vector< PrefabBlueprint > | ScanDirectory (const std::string &rootPath) |
| PrefabBlueprint | ParsePrefab (const std::string &filepath) |
| bool | LoadSynonymRegistry (const std::string &directory) |
| std::string | ExtractPrefabType (const nlohmann::json &prefabJson) |
| float | FuzzyMatch (const std::string &str1, const std::string &str2) const |
| void | ScanDirectoryRecursive_Unix (const std::string &path, std::vector< std::string > &outFiles) |
| std::string | DetectComponentType (const std::string &typeName) |
| void | ExtractResources (const nlohmann::json &componentsJson, ResourceRefs &outResources) |
| std::string | GetFilename (const std::string &filepath) |
| std::string | RemoveExtension (const std::string &filename) |
| std::string | ToUpper (const std::string &str) const |
Private Attributes | |
| std::map< std::string, std::string > | m_synonymToCanonical |
| std::map< std::string, SynonymInfo > | m_canonicalTypes |
| std::map< std::string, std::vector< std::string > > | m_categoryToTypes |
| bool | m_caseSensitive = false |
| bool | m_enableFuzzyMatching = true |
| float | m_fuzzyThreshold = 0.8f |
| bool | m_logUnmatchedTypes = true |
Definition at line 86 of file PrefabScanner.h.
| PrefabScanner::PrefabScanner | ( | ) |
Definition at line 81 of file PrefabScanner.cpp.
| PrefabScanner::~PrefabScanner | ( | ) |
Definition at line 85 of file PrefabScanner.cpp.
| bool PrefabScanner::AreTypesEquivalent | ( | const std::string & | type1, |
| const std::string & | type2 | ||
| ) | const |
Check if two types are equivalent.
Definition at line 781 of file PrefabScanner.cpp.
References GetComponentTypeID_Static(), and NormalizeType().
Here is the call graph for this function:| std::string PrefabScanner::DetectComponentType | ( | const std::string & | typeName | ) |
Definition at line 371 of file PrefabScanner.cpp.
References GetComponentTypeID_Static().
Here is the call graph for this function:| std::string PrefabScanner::ExtractPrefabType | ( | const nlohmann::json & | prefabJson | ) |
Definition at line 671 of file PrefabScanner.cpp.
References GetComponentTypeID_Static().
Referenced by ParsePrefab().
Here is the call graph for this function:
Here is the caller graph for this function:| void PrefabScanner::ExtractResources | ( | const nlohmann::json & | componentsJson, |
| ResourceRefs & | outResources | ||
| ) |
Definition at line 391 of file PrefabScanner.cpp.
References GetComponentTypeID_Static().
Referenced by ParsePrefab().
Here is the call graph for this function:
Here is the caller graph for this function:Definition at line 527 of file PrefabScanner.cpp.
References GetComponentTypeID_Static(), and LevenshteinDistance().
Referenced by NormalizeType().
Here is the call graph for this function:
Here is the caller graph for this function:| bool PrefabScanner::GetCanonicalInfo | ( | const std::string & | type, |
| std::string & | outCanonical, | ||
| std::string & | outPrefabFile | ||
| ) | const |
Get canonical type info (for debugging)
Definition at line 797 of file PrefabScanner.cpp.
References GetComponentTypeID_Static(), m_canonicalTypes, and NormalizeType().
Here is the call graph for this function:| std::string PrefabScanner::GetFilename | ( | const std::string & | filepath | ) |
Definition at line 474 of file PrefabScanner.cpp.
References GetComponentTypeID_Static().
Referenced by ParsePrefab().
Here is the call graph for this function:
Here is the caller graph for this function:| PrefabRegistry PrefabScanner::Initialize | ( | const std::string & | prefabDirectory = "Gamedata/EntityPrefab" | ) |
Initialize the prefab system (call once at startup)
Definition at line 818 of file PrefabScanner.cpp.
References GetComponentTypeID_Static(), ParameterSchemaRegistry::GetInstance(), ParameterSchemaRegistry::GetSchemaCount(), LoadSynonymRegistry(), m_canonicalTypes, m_categoryToTypes, m_synonymToCanonical, NormalizeType(), ParsePrefab(), ScanDirectoryRecursive_Unix(), and SYSTEM_LOG.
Here is the call graph for this function:Check if a type is registered.
Definition at line 791 of file PrefabScanner.cpp.
References m_synonymToCanonical, and ToUpper().
Here is the call graph for this function:Definition at line 540 of file PrefabScanner.cpp.
References SynonymInfo::canonicalType, GetComponentTypeID_Static(), m_canonicalTypes, m_caseSensitive, m_categoryToTypes, m_enableFuzzyMatching, m_fuzzyThreshold, m_logUnmatchedTypes, m_synonymToCanonical, SYSTEM_LOG, and ToUpper().
Referenced by Initialize().
Here is the call graph for this function:
Here is the caller graph for this function:| std::string PrefabScanner::NormalizeType | ( | const std::string & | type | ) | const |
Normalize a type string to canonical form.
Definition at line 713 of file PrefabScanner.cpp.
References FuzzyMatch(), GetComponentTypeID_Static(), m_canonicalTypes, m_caseSensitive, m_enableFuzzyMatching, m_fuzzyThreshold, m_logUnmatchedTypes, m_synonymToCanonical, SYSTEM_LOG, and ToUpper().
Referenced by AreTypesEquivalent(), GetCanonicalInfo(), and Initialize().
Here is the call graph for this function:
Here is the caller graph for this function:| PrefabBlueprint PrefabScanner::ParsePrefab | ( | const std::string & | filepath | ) |
Definition at line 257 of file PrefabScanner.cpp.
References ParameterSchemaRegistry::DiscoverSchemasFromPrefab(), ExtractPrefabType(), ExtractResources(), PrefabBlueprint::filePath, ComponentDefinition::FromJSON(), GetComponentTypeID_Static(), GetFilename(), ParameterSchemaRegistry::GetInstance(), and RemoveExtension().
Referenced by Initialize(), and ScanDirectory().
Here is the call graph for this function:
Here is the caller graph for this function:| std::string PrefabScanner::RemoveExtension | ( | const std::string & | filename | ) |
Definition at line 484 of file PrefabScanner.cpp.
References GetComponentTypeID_Static().
Referenced by ParsePrefab().
Here is the call graph for this function:
Here is the caller graph for this function:| std::vector< PrefabBlueprint > PrefabScanner::ScanDirectory | ( | const std::string & | rootPath | ) |
Definition at line 96 of file PrefabScanner.cpp.
References GetComponentTypeID_Static(), ParsePrefab(), ScanDirectoryRecursive_Unix(), and SYSTEM_LOG.
Here is the call graph for this function:| void PrefabScanner::ScanDirectoryRecursive_Unix | ( | const std::string & | path, |
| std::vector< std::string > & | outFiles | ||
| ) |
Definition at line 213 of file PrefabScanner.cpp.
References GetComponentTypeID_Static(), and ScanDirectoryRecursive_Unix().
Referenced by Initialize(), ScanDirectory(), and ScanDirectoryRecursive_Unix().
Here is the call graph for this function:
Here is the caller graph for this function:| std::string PrefabScanner::ToUpper | ( | const std::string & | str | ) | const |
Definition at line 89 of file PrefabScanner.cpp.
References GetComponentTypeID_Static().
Referenced by IsTypeRegistered(), LoadSynonymRegistry(), and NormalizeType().
Here is the call graph for this function:
Here is the caller graph for this function:
|
private |
Definition at line 145 of file PrefabScanner.h.
Referenced by GetCanonicalInfo(), Initialize(), LoadSynonymRegistry(), and NormalizeType().
Definition at line 147 of file PrefabScanner.h.
Referenced by LoadSynonymRegistry(), and NormalizeType().
|
private |
Definition at line 146 of file PrefabScanner.h.
Referenced by Initialize(), and LoadSynonymRegistry().
Definition at line 148 of file PrefabScanner.h.
Referenced by LoadSynonymRegistry(), and NormalizeType().
Definition at line 149 of file PrefabScanner.h.
Referenced by LoadSynonymRegistry(), and NormalizeType().
Definition at line 150 of file PrefabScanner.h.
Referenced by LoadSynonymRegistry(), and NormalizeType().
|
private |
Definition at line 144 of file PrefabScanner.h.
Referenced by Initialize(), IsTypeRegistered(), LoadSynonymRegistry(), and NormalizeType().