From 8510a85f79f706b93982b4e398b187b5f77081dd Mon Sep 17 00:00:00 2001 From: rtk0c Date: Fri, 3 Jun 2022 22:58:28 -0700 Subject: Changeset: 61 [BUGGED] Move object kind enums to use generated ToString and FromStrong The old mechanism rely on a specific prefix to Ires and GameObject string representations, but the generator currently leaves the enum value. Therefore all editor (e.g. drag & drop) and IO (e.g. ires loading) mechanisms are broken. --- source/30-game/GameObject.hpp | 30 +++++++++++++++++++----------- 1 file changed, 19 insertions(+), 11 deletions(-) (limited to 'source/30-game/GameObject.hpp') diff --git a/source/30-game/GameObject.hpp b/source/30-game/GameObject.hpp index 77488b9..f975803 100644 --- a/source/30-game/GameObject.hpp +++ b/source/30-game/GameObject.hpp @@ -2,27 +2,35 @@ #include "EditorAttachment.hpp" #include "Material.hpp" -#include "PodVector.hpp" #include "Renderer.hpp" #include "VertexIndex.hpp" +#include +#include + #include #include #include #include #include +namespace Tags { +enum class GameObjectKind { + KD_Generic, + KD_Player, + KD_SimpleGeometry, + KD_Building, + KD_LevelWrapper, + KD_COUNT, +}; +BRUSSEL_ENUM(GameObjectKind, ToString FromString ExcludeHeuristics); +} // namespace Tags + class GameWorld; class GameObject { public: - enum Kind { - KD_Generic, - KD_Player, - KD_SimpleGeometry, - KD_Building, - KD_LevelWrapper, - KD_COUNT, - }; + using Kind = Tags::GameObjectKind; + using enum Tags::GameObjectKind; private: std::unique_ptr mEditorAttachment; @@ -50,8 +58,6 @@ public: GameObject(GameObject&&) = default; GameObject& operator=(GameObject&&) = default; - static std::string_view ToString(Kind kind); - static Kind FromString(std::string_view name); Kind GetKind() const; GameWorld* GetWorld() const; @@ -92,3 +98,5 @@ public: protected: void SetParent(GameObject* parent); }; + +#include -- cgit v1.2.3-70-g09d2