Line |
Branch |
Exec |
Source |
1 |
|
|
#pragma once |
2 |
|
|
|
3 |
|
|
#include "Types.hpp" |
4 |
|
|
#include <vector> |
5 |
|
|
#include <queue> |
6 |
|
|
|
7 |
|
|
namespace ECS { |
8 |
|
|
class EntityManager { |
9 |
|
|
private: |
10 |
|
|
std::vector<bool> m_aliveEntities; |
11 |
|
|
std::queue<EntityID> m_freeEntities; |
12 |
|
|
EntityID m_nextEntityID; |
13 |
|
|
|
14 |
|
|
public: |
15 |
|
|
EntityManager(); |
16 |
|
6 |
~EntityManager() = default; |
17 |
|
|
|
18 |
|
|
EntityID CreateEntity(); |
19 |
|
|
void DestroyEntity(EntityID entity); |
20 |
|
|
bool IsEntityAlive(EntityID entity) const; |
21 |
|
|
void Clear(); |
22 |
|
|
|
23 |
|
|
size_t GetAliveEntityCount() const; |
24 |
|
|
}; |
25 |
|
|
} |
26 |
|
|
|