-fixed EntityTemplate.getComponent()
-fxied issue with components string in systems HashMap
This commit is contained in:
parent
c915b1a8c7
commit
c0ac19b6f9
2 changed files with 22 additions and 5 deletions
|
|
@ -45,8 +45,16 @@ export struct EntityTemplate
|
|||
|
||||
T* getComponent(T)()
|
||||
{
|
||||
if(T.component_id >= info.tmpl_deltas.length)return null;
|
||||
version(LinearLayout)return cast(T*)(entity_data.ptr + info.tmpl_deltas[T.component_id]);
|
||||
else return cast(T*)(entity_data.ptr + info.deltas[T.component_id]);
|
||||
|
||||
version(LinearLayout)
|
||||
{
|
||||
if(T.component_id >= info.tmpl_deltas.length)return null;
|
||||
return cast(T*)(entity_data.ptr + info.tmpl_deltas[T.component_id]);
|
||||
}
|
||||
else
|
||||
{
|
||||
if(T.component_id >= info.deltas.length)return null;
|
||||
return cast(T*)(entity_data.ptr + info.deltas[T.component_id]);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue