-fixed crash on getComponent when component doesn't exist

-fixed Components ids sorting
-added deferred object removing
-new EntityManager functions: begin(), end().
This commit is contained in:
Mergul 2018-09-16 14:16:18 +02:00
parent a066a97f01
commit 8fdb56e840
3 changed files with 43 additions and 18 deletions

View file

@ -21,6 +21,7 @@ struct Entity
{
EntityManager.EntitiesBlock* block = gEM.getMetaData(&this);
EntityManager.EntityInfo* info = block.type_data;
if(T.component_id >= info.deltas.length || info.deltas[T.component_id] == 0)return null;
return cast(T*)(cast(void*)&this + info.deltas[T.component_id]);
}
}