| 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 | { |