2022-03-05 02:01:44 +00:00
|
|
|
|
namespace MoonTools.ECS;
|
|
|
|
|
|
|
|
|
|
internal class EntityStorage
|
|
|
|
|
{
|
|
|
|
|
public IDStorage idStorage = new IDStorage();
|
|
|
|
|
|
|
|
|
|
public Entity Create()
|
|
|
|
|
{
|
|
|
|
|
return new Entity(idStorage.NextID());
|
|
|
|
|
}
|
|
|
|
|
|
2022-03-31 23:15:30 +00:00
|
|
|
|
public bool Exists(in Entity entity)
|
|
|
|
|
{
|
|
|
|
|
return idStorage.Taken(entity.ID);
|
|
|
|
|
}
|
|
|
|
|
|
2022-03-05 02:01:44 +00:00
|
|
|
|
public void Destroy(in Entity entity)
|
|
|
|
|
{
|
|
|
|
|
idStorage.Release(entity.ID);
|
|
|
|
|
}
|
|
|
|
|
}
|