| 51 | } |
| 52 | |
| 53 | vili::node GameObjectDatabase::GetDefinitionForGameObject(const std::string& type) |
| 54 | { |
| 55 | if (allDefinitions[type].is_null()) |
| 56 | { |
| 57 | const std::string objectDefinitionPath = System::Path("Data/GameObjects/") |
| 58 | .add(type) |
| 59 | .add(type + ".obj.vili") |
| 60 | .find(); |
| 61 | if (objectDefinitionPath.empty()) |
| 62 | throw Exceptions::ObjectDefinitionNotFound(type, EXC_INFO); |
| 63 | vili::node getGameObjectFile = vili::parser::from_file( |
| 64 | objectDefinitionPath, Config::Templates::getGameObjectTemplates()); |
| 65 | if (!getGameObjectFile[type].is_null()) |
| 66 | { |
| 67 | vili::node& definitionData = getGameObjectFile.at(type); |
| 68 | allDefinitions[type] = definitionData; |
| 69 | return definitionData; |
| 70 | } |
| 71 | throw Exceptions::ObjectDefinitionBlockNotFound(type, EXC_INFO); |
| 72 | } |
| 73 | return allDefinitions.at(type); |
| 74 | } |
| 75 | |
| 76 | void GameObjectDatabase::ApplyRequirements( |
| 77 | sol::environment environment, vili::node& requires) |
nothing calls this directly
no test coverage detected