diff options
Diffstat (limited to 'source/30-game/Ires.hpp')
-rw-r--r-- | source/30-game/Ires.hpp | 34 |
1 files changed, 21 insertions, 13 deletions
diff --git a/source/30-game/Ires.hpp b/source/30-game/Ires.hpp index 83ca175..b6420f3 100644 --- a/source/30-game/Ires.hpp +++ b/source/30-game/Ires.hpp @@ -2,9 +2,11 @@ #include "EditorAttachment.hpp" #include "EditorCore.hpp" -#include "RcPtr.hpp" -#include "Uid.hpp" -#include "Utils.hpp" + +#include <MacrosCodegen.hpp> +#include <RcPtr.hpp> +#include <Uid.hpp> +#include <Utils.hpp> #include <rapidjson/fwd.h> #include <robin_hood.h> @@ -17,18 +19,24 @@ class IresManager; class IresWritingContext; class IresLoadingContext; +namespace Tags { +enum class IresObjectKind { + KD_Texture, + KD_Shader, + KD_Material, + KD_SpriteFiles, + KD_Spritesheet, + KD_COUNT, +}; +BRUSSEL_ENUM(IresObjectKind, ToString FromString ExcludeHeuristics); +} // namespace Tags + class IresObject : public RefCounted { friend class IresManager; public: - enum Kind { - KD_Texture, - KD_Shader, - KD_Material, - KD_SpriteFiles, - KD_Spritesheet, - KD_COUNT, - }; + using Kind = Tags::IresObjectKind; + using enum Tags::IresObjectKind; private: std::string mName; // Serialized as filename @@ -41,8 +49,6 @@ public: IresObject(Kind kind); virtual ~IresObject() = default; - static std::string_view ToString(Kind kind); - static Kind FromString(std::string_view name); static std::unique_ptr<IresObject> Create(Kind kind); Kind GetKind() const { return mKind; } @@ -115,3 +121,5 @@ public: const auto& GetObjects() const { return mObjByUid; } virtual IresObject* FindIres(const Uid& uid) const override; }; + +#include <generated/Ires.gh.inl> |