| 33 | { |
| 34 | public: |
| 35 | UnknownGameObject(std::string_view sceneFile, std::string_view objectId, |
| 36 | const std::vector<std::string>& allObjectIds, DebugInfo info) |
| 37 | : Exception("UnknownGameObject", info) |
| 38 | { |
| 39 | this->error("GameObject with id '{}' does not exists inside Scene '{}'", |
| 40 | objectId, sceneFile); |
| 41 | std::vector<std::string> suggestions |
| 42 | = Utils::String::sortByDistance(objectId.data(), allObjectIds, 5); |
| 43 | std::transform(suggestions.begin(), suggestions.end(), suggestions.begin(), |
| 44 | Utils::String::quote); |
| 45 | this->hint("Try one of the GameObjects with id ({}...)", |
| 46 | fmt::join(suggestions, ", ")); |
| 47 | } |
| 48 | }; |
| 49 | |
| 50 | class GameObjectAlreadyExists : public Exception |