Make the AddComponent function safe

This commit is contained in:
Maple Redleaf
2025-11-10 11:48:33 -06:00
parent f99daa2f9d
commit 03c3a75232
2 changed files with 7 additions and 2 deletions

View File

@@ -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"