MCPcopy Create free account
hub / github.com/ObEngine/ObEngine / GetRequirementsForGameObject

Method GetRequirementsForGameObject

src/Core/Script/GameObject.cpp:33–51  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

31 vili::node GameObjectDatabase::allDefinitions = vili::object {};
32 vili::node GameObjectDatabase::allRequires = vili::object {};
33 vili::node GameObjectDatabase::GetRequirementsForGameObject(const std::string& type)
34 {
35 if (allRequires[type].is_null())
36 {
37 vili::node getGameObjectFile
38 = vili::parser::from_file(System::Path("Data/GameObjects/")
39 .add(type)
40 .add(type + ".obj.vili")
41 .find());
42 if (!getGameObjectFile["Requires"].is_null())
43 {
44 vili::node& requiresData = getGameObjectFile.at("Requires");
45 allRequires[type] = requiresData;
46 return requiresData;
47 }
48 return vili::node {};
49 }
50 return allRequires.at(type);
51 }
52
53 vili::node GameObjectDatabase::GetDefinitionForGameObject(const std::string& type)
54 {

Callers

nothing calls this directly

Calls 6

from_fileFunction · 0.85
PathClass · 0.85
is_nullMethod · 0.45
findMethod · 0.45
addMethod · 0.45
atMethod · 0.45

Tested by

no test coverage detected