Fixing up the component api to be more useable

This commit is contained in:
Booklordofthedings 2024-11-19 14:14:19 +01:00
parent 499cea5b44
commit 34b929c4e7
4 changed files with 84 additions and 49 deletions

View file

@ -29,11 +29,11 @@ class PagedSparseSet
_sparse[e.Index/PageSize][e.Index % PageSize] = (.)_packed.Count-1;
}
public void Remove(Entity e)
public bool Remove(Entity e)
{
EnsurePage(e.Index/PageSize);
if(_sparse[e.Index/PageSize] == null)
return;
return false;
let toRm = _packed[_sparse[e.Index/PageSize][e.Index % PageSize].Index];
let b = _packed.Back;
@ -44,6 +44,7 @@ class PagedSparseSet
_sparse[e.Index/PageSize][e.Index % PageSize] = Entity.Null;
_packed.PopBack();
return true;
}
[Inline, Unchecked]