| 80 | }; |
| 81 | |
| 82 | class UnknownCollider : public Exception |
| 83 | { |
| 84 | public: |
| 85 | UnknownCollider(std::string_view sceneFile, std::string_view colliderId, |
| 86 | const std::vector<std::string>& allCollidersIds, DebugInfo info) |
| 87 | : Exception("UnknownCollider", info) |
| 88 | { |
| 89 | this->error("Collider with id '{}' does not exists inside Scene '{}'", |
| 90 | colliderId, sceneFile); |
| 91 | std::vector<std::string> suggestions |
| 92 | = Utils::String::sortByDistance(colliderId.data(), allCollidersIds, 5); |
| 93 | std::transform(suggestions.begin(), suggestions.end(), suggestions.begin(), |
| 94 | Utils::String::quote); |
| 95 | this->hint( |
| 96 | "Try one of the Colliders with id ({}...)", fmt::join(suggestions, ", ")); |
| 97 | } |
| 98 | }; |
| 99 | |
| 100 | class SceneScriptLoadingError : public Exception |
| 101 | { |