diff options
Diffstat (limited to 'mwe/ecs-homemade/inc')
-rw-r--r-- | mwe/ecs-homemade/inc/Components.h | 33 | ||||
-rw-r--r-- | mwe/ecs-homemade/inc/GameObjectMax.h | 20 |
2 files changed, 53 insertions, 0 deletions
diff --git a/mwe/ecs-homemade/inc/Components.h b/mwe/ecs-homemade/inc/Components.h new file mode 100644 index 0000000..98c5fe7 --- /dev/null +++ b/mwe/ecs-homemade/inc/Components.h @@ -0,0 +1,33 @@ +#pragma once + +#include <string> + +class Component { +public: + Component(); + + bool mActive; +}; + +class Sprite : public Component { +public: + Sprite(std::string path); + + std::string mPath; +}; + +class Rigidbody : public Component { +public: + Rigidbody(int mass, int gravityScale, int bodyType); + + int mMass; + int mGravityScale; + int mBodyType; +}; + +class Colider : public Component { +public: + Colider(int size); + + int mSize; +}; diff --git a/mwe/ecs-homemade/inc/GameObjectMax.h b/mwe/ecs-homemade/inc/GameObjectMax.h new file mode 100644 index 0000000..3029053 --- /dev/null +++ b/mwe/ecs-homemade/inc/GameObjectMax.h @@ -0,0 +1,20 @@ +#pragma once + +#include <cstdint> +#include <string> + +class GameObject { +public: + GameObject(std::uint32_t id, std::string name, std::string tag, int layer); + + template <typename T, typename... Args> + void AddComponent(Args &&... args); + + std::uint32_t mId; + std::string mName; + std::string mTag; + bool mActive; + int mLayer; +}; + +#include "GameObjectMax.hpp" |