Implemented ComponentPool and initial tests for it

This commit is contained in:
sippeangelo
2015-12-02 15:07:48 +01:00
parent 8aa72735e7
commit b3e68c6c34
8 changed files with 212 additions and 21 deletions
+23 -1
View File
@@ -1,3 +1,9 @@
#ifndef World_h__
#define World_h__
#include "../Common.h"
#include "Entity.h"
#include "ComponentPool.h"
class World
{
@@ -7,5 +13,21 @@ public:
}
~World()
{
// foreach (m_ComponentPools...
}
void AllocateComponentPool(ComponentInfo& ci)
{
auto pool = new ComponentPool(ci);
m_ComponentPools[ci.Name] = pool;
}
void AddComponent(EntityID entity, std::string componentType);
private:
};
std::unordered_map<std::string, ComponentPool*> m_ComponentPools;
};
#endif