This commit is contained in:
Booklordofthedings 2024-11-19 21:11:12 +01:00
parent bc8926725a
commit 40d50bbda9
2 changed files with 3 additions and 2 deletions

View file

@ -24,7 +24,8 @@ class EntityManager
if(_entities.Count + 1 > Entity.IndexMask) if(_entities.Count + 1 > Entity.IndexMask)
return .Null; //It would be beneficial if we could avoid this check return .Null; //It would be beneficial if we could avoid this check
#endif #endif
return .((.)_entities..Add(.((.)_entities.Count, 0)).Count, 0); _entities.Add(Entity((.)_entities.Count,0));
return _entities.Back;
} }
else else
{ {

View file

@ -45,7 +45,7 @@ abstract class System
//We now have the list of entities to loop through //We now have the list of entities to loop through
Span<Entity> entities = ecs.Components.Components[comp].GetAll(); Span<Entity> entities = ecs.Components.Components[comp].GetAll();
UList main = ecs.Components.Components[comp].[Friend]_packedEntities; UList main = ecs.Components.Components[comp].[Friend]_packedEntities;
var cun = entities.Length - 1; var cun = entities.Length;
#region DumbStatement #region DumbStatement
switch (_Components.Count) switch (_Components.Count)