mirror of
https://gitlab.com/voidframe/voidframe-cpp.git
synced 2026-06-28 16:55:22 -04:00
Begin implementation of Entities
This commit is contained in:
0
.gitignore
vendored
Normal file
0
.gitignore
vendored
Normal file
@@ -4,10 +4,10 @@ project(VoidEngine VERSION 1.0.0 LANGUAGES CXX)
|
|||||||
set(CMAKE_CXX_STANDARD 17)
|
set(CMAKE_CXX_STANDARD 17)
|
||||||
set(CMAKE_CXX_STANDARD_REQUIRED ON)
|
set(CMAKE_CXX_STANDARD_REQUIRED ON)
|
||||||
|
|
||||||
|
file(GLOB_RECURSE SOURCE_FILES "src/*.cpp" "include/*.h")
|
||||||
|
|
||||||
add_library(${PROJECT_NAME}
|
add_library(${PROJECT_NAME}
|
||||||
STATIC
|
STATIC ${SOURCE_FILES}
|
||||||
src/*.cpp
|
|
||||||
include/*.hpp
|
|
||||||
)
|
)
|
||||||
|
|
||||||
target_include_directories(${PROJECT_NAME}
|
target_include_directories(${PROJECT_NAME}
|
||||||
|
|||||||
@@ -1,3 +1,4 @@
|
|||||||
|
#pragma once
|
||||||
class Entity;
|
class Entity;
|
||||||
|
|
||||||
class Component {
|
class Component {
|
||||||
|
|||||||
22
include/entity.h
Normal file
22
include/entity.h
Normal file
@@ -0,0 +1,22 @@
|
|||||||
|
#ifndef VOID_ENTITY_H
|
||||||
|
#define VOID_ENTITY_H
|
||||||
|
#include "component.h"
|
||||||
|
#include <vector>
|
||||||
|
|
||||||
|
class Entity {
|
||||||
|
public:
|
||||||
|
template <typename CompT, typename... Args>
|
||||||
|
CompT *AddComponent(Args &&...args);
|
||||||
|
|
||||||
|
void Init();
|
||||||
|
void Draw();
|
||||||
|
void Update();
|
||||||
|
void FixedUpdate();
|
||||||
|
void Destroy();
|
||||||
|
|
||||||
|
private:
|
||||||
|
std::vector<Component> components;
|
||||||
|
};
|
||||||
|
|
||||||
|
#include "../src/entity_i.cpp"
|
||||||
|
#endif // VOID_ENTITY_H
|
||||||
1
src/entity.cpp
Normal file
1
src/entity.cpp
Normal file
@@ -0,0 +1 @@
|
|||||||
|
#include "../include/entity.h"
|
||||||
3
src/entity_i.cpp
Normal file
3
src/entity_i.cpp
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
#ifndef VOID_ENTITY_H
|
||||||
|
#include "../include/entity.h"
|
||||||
|
#endif
|
||||||
Reference in New Issue
Block a user