Nebula
Loading...
Searching...
No Matches
entitypool.h
Go to the documentation of this file.
1#pragma once
2//------------------------------------------------------------------------------
9//------------------------------------------------------------------------------
10#include "api.h"
11#include "category.h"
12#include "util/queue.h"
13
14namespace Game
15{
16
17//------------------------------------------------------------------------------
22{
23public:
24 // default constructor
25 EntityPool();
26
28 bool Allocate(Entity& e);
30 void Deallocate(Entity e);
32 bool IsValid(Entity e) const;
33
38};
39
40} // namespace Game
The main programming interface for the Game Subsystem.
Generation pool.
Definition entitypool.h:22
EntityPool()
Definition entitypool.cc:16
Util::Queue< uint32_t > freeIds
stores freed indices
Definition entitypool.h:37
bool Allocate(Entity &e)
allocate a new id, returns false if the entity id was reused
Definition entitypool.cc:26
bool IsValid(Entity e) const
check if valid
Definition entitypool.cc:67
Util::Array< uint16_t > generations
array containing generation value for every index
Definition entitypool.h:35
void Deallocate(Entity e)
remove an id
Definition entitypool.cc:51
Nebula's dynamic array class.
Definition array.h:60
Nebula's queue class (a FIFO container).
Definition queue.h:28
Definition orientation.h:7
An entity is essentially just an Id with some utility functions attached.
Definition entity.h:31