diff options
author | rtk0c <[email protected]> | 2022-06-03 22:58:28 -0700 |
---|---|---|
committer | rtk0c <[email protected]> | 2022-06-03 22:58:28 -0700 |
commit | 8510a85f79f706b93982b4e398b187b5f77081dd (patch) | |
tree | 996c27f54f748d940f58454f7ef1e1570d1a31d5 /source/30-game/GameObject.hpp | |
parent | bd07ae3f4e1bcdedc3e373460671ca9713a03de5 (diff) |
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.
Diffstat (limited to 'source/30-game/GameObject.hpp')
-rw-r--r-- | source/30-game/GameObject.hpp | 30 |
1 files changed, 19 insertions, 11 deletions
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 <MacrosCodegen.hpp> +#include <PodVector.hpp> + #include <rapidjson/fwd.h> #include <glm/glm.hpp> #include <glm/gtc/quaternion.hpp> #include <span> #include <vector> +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<EditorAttachment> 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 <generated/GameObject.gh.inl> |