-added more documentation

-remove update() function from entity
-currently max supported components count is 64 per type
This commit is contained in:
Mergul 2020-03-21 13:27:14 +01:00
parent 546b73c567
commit 845f468d59
10 changed files with 199 additions and 64 deletions

View file

@ -19,7 +19,7 @@ struct IDManager
{
//uint current = m_next_id;
//uint next;// = m_ids_array[m_next_id].next_id;
begin:
//begin:
//if (current == uint.max)//> m_last_id)
int current = m_stack_top.atomicOp!"-="(1) + 1;
if(current < 0)
@ -142,6 +142,9 @@ begin:
return data.counter == id.counter;
}
/************************************************************************************************************************
*Initialize manager.
*/
void initialize() nothrow @nogc
{
m_ids_array = Mallocator.makeArray!Data(65536);
@ -158,6 +161,9 @@ begin:
optimize();
}
/************************************************************************************************************************
*Free manager memory.
*/
void deinitialize() @trusted @nogc nothrow
{
if(m_ids_array)Mallocator.dispose(m_ids_array);
@ -178,6 +184,9 @@ begin:
}
}
/************************************************************************************************************************
*Optimize memory. Must be called if any ID was added and some ID will be removed.
*/
void optimize() nothrow @nogc
{
if(m_stack_top < -1)m_stack_top = -1;