mirror of
https://gitlab.com/voidframe/voidframe-cpp.git
synced 2026-07-01 18:55:12 -04:00
Make the AddComponent function safe
This commit is contained in:
@@ -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