diff options
Diffstat (limited to 'mwe/ecs-homemade')
-rw-r--r-- | mwe/ecs-homemade/CMakeLists.txt | 17 | ||||
-rw-r--r-- | mwe/ecs-homemade/inc/Components.h | 33 | ||||
-rw-r--r-- | mwe/ecs-homemade/inc/GameObjectMax.h | 20 | ||||
-rw-r--r-- | mwe/ecs-homemade/src/Components.cpp | 11 | ||||
-rw-r--r-- | mwe/ecs-homemade/src/GameObjectMax.cpp | 7 |
5 files changed, 0 insertions, 88 deletions
diff --git a/mwe/ecs-homemade/CMakeLists.txt b/mwe/ecs-homemade/CMakeLists.txt deleted file mode 100644 index 6267c1a..0000000 --- a/mwe/ecs-homemade/CMakeLists.txt +++ /dev/null @@ -1,17 +0,0 @@ -cmake_minimum_required(VERSION 3.5) -project(ecs-homemade) - -# Set the C++ standard (optional, but good practice) -set(CMAKE_CXX_STANDARD 17) -set(CMAKE_CXX_STANDARD_REQUIRED True) - -# Use the debug mode (otherwise breakpoints are not compiled) -set(CMAKE_BUILD_TYPE Debug) - -add_executable(ecs-homemade - src/main.cpp - src/ComponentManager.cpp - src/Components.cpp - src/GameObjectMax.cpp -) -target_include_directories(ecs-homemade PRIVATE "${CMAKE_SOURCE_DIR}/inc") diff --git a/mwe/ecs-homemade/inc/Components.h b/mwe/ecs-homemade/inc/Components.h deleted file mode 100644 index 98c5fe7..0000000 --- a/mwe/ecs-homemade/inc/Components.h +++ /dev/null @@ -1,33 +0,0 @@ -#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 deleted file mode 100644 index 3029053..0000000 --- a/mwe/ecs-homemade/inc/GameObjectMax.h +++ /dev/null @@ -1,20 +0,0 @@ -#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" diff --git a/mwe/ecs-homemade/src/Components.cpp b/mwe/ecs-homemade/src/Components.cpp deleted file mode 100644 index c8347b3..0000000 --- a/mwe/ecs-homemade/src/Components.cpp +++ /dev/null @@ -1,11 +0,0 @@ -#include "Components.h" -#include <iostream> - -Component::Component() : mActive(true) {} - -Sprite::Sprite(std::string path) : mPath(path) {} - -Rigidbody::Rigidbody(int mass, int gravityScale, int bodyType) - : mMass(mass), mGravityScale(gravityScale), mBodyType(bodyType) {} - -Colider::Colider(int size) : mSize(size) {} diff --git a/mwe/ecs-homemade/src/GameObjectMax.cpp b/mwe/ecs-homemade/src/GameObjectMax.cpp deleted file mode 100644 index b0c5af7..0000000 --- a/mwe/ecs-homemade/src/GameObjectMax.cpp +++ /dev/null @@ -1,7 +0,0 @@ -#include "GameObjectMax.h" - -#include "ComponentManager.h" - -GameObject::GameObject(std::uint32_t id, std::string name, std::string tag, - int layer) - : mId(id), mName(name), mTag(tag), mActive(true), mLayer(layer) {} |