mirror of
https://gitlab.com/voidframe/voidframe-cpp.git
synced 2026-11-25 02:10:23 -05:00
Make the AddComponent function safe
This commit is contained in:
1 parent
f99daa2f9d
commit
03c3a75232
2 files changed
+7
-2
No files matched your search
+2
-1
@@ -1,6 +1,7 @@
|
||||
#ifndef VOID_ENTITY_H
|
||||
#define VOID_ENTITY_H
|
||||
#include "component.h"
|
||||
#include <memory>
|
||||
#include <vector>
|
||||
|
||||
class Entity {
|
||||
@@ -15,7 +16,7 @@ public:
|
||||
void Destroy();
|
||||
|
||||
private:
|
||||
std::vector<Component> components;
|
||||
std::vector<std::unique_ptr<Component>> components;
|
||||
};
|
||||
|
||||
#include "../src/entity_i.cpp"
|
||||
|
||||
Reference in new issue
Block a user