-added more documentation
-remove update() function from entity -currently max supported components count is 64 per type
This commit is contained in:
parent
546b73c567
commit
845f468d59
10 changed files with 199 additions and 64 deletions
|
|
@ -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;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue