Nebula
Toggle main menu visibility
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
14
namespace
Game
15
{
16
17
//------------------------------------------------------------------------------
21
class
EntityPool
22
{
23
public
:
24
// default constructor
25
EntityPool
();
26
28
bool
Allocate
(
Entity
& e);
30
void
Deallocate
(
Entity
e);
32
bool
IsValid
(
Entity
e)
const
;
33
35
Util::Array<uint16_t>
generations
;
37
Util::Queue<uint32_t>
freeIds
;
38
};
39
40
}
// namespace Game
api.h
The main programming interface for the Game Subsystem.
category.h
Game::EntityPool::EntityPool
EntityPool()
Definition
entitypool.cc:16
Game::EntityPool::freeIds
Util::Queue< uint32_t > freeIds
stores freed indices
Definition
entitypool.h:37
Game::EntityPool::Allocate
bool Allocate(Entity &e)
allocate a new id, returns false if the entity id was reused
Definition
entitypool.cc:26
Game::EntityPool::IsValid
bool IsValid(Entity e) const
check if valid
Definition
entitypool.cc:68
Game::EntityPool::generations
Util::Array< uint16_t > generations
array containing generation value for every index
Definition
entitypool.h:35
Game::EntityPool::Deallocate
void Deallocate(Entity e)
remove an id
Definition
entitypool.cc:52
Util::Array
Nebula's dynamic array class.
Definition
array.h:61
Util::Queue
Nebula's queue class (a FIFO container).
Definition
queue.h:22
Game
Game::EditorState.
Definition
graphicsmanager.h:67
queue.h
Game::Entity
An entity is essentially just an Id with some utility functions attached.
Definition
entity.h:35
code
application
game
entitypool.h
Generated on
for Nebula. Dark theme by
Tilen Majerle
. All rights reserved.