| 65 | { |
| 66 | public: |
| 67 | UnknownSprite(std::string_view sceneFile, std::string_view spriteId, |
| 68 | const std::vector<std::string>& allSpritesIds, DebugInfo info) |
| 69 | : Exception("UnknownSprite", info) |
| 70 | { |
| 71 | this->error("Sprite with id '{}' does not exists inside Scene '{}'", spriteId, |
| 72 | sceneFile); |
| 73 | std::vector<std::string> suggestions |
| 74 | = Utils::String::sortByDistance(spriteId.data(), allSpritesIds, 5); |
| 75 | std::transform(suggestions.begin(), suggestions.end(), suggestions.begin(), |
| 76 | Utils::String::quote); |
| 77 | this->hint( |
| 78 | "Try one of the Sprites with id ({}...)", fmt::join(suggestions, ", ")); |
| 79 | } |
| 80 | }; |
| 81 | |
| 82 | class UnknownCollider : public Exception |