restore functionality

This commit is contained in:
Mikhail 2024-02-13 21:13:46 +08:00
parent d76a699091
commit d1374d72ca
2 changed files with 11 additions and 10 deletions

View File

@ -274,7 +274,6 @@ namespace DCFApixels.DragonECS
public void DeleteEmptyEntites() public void DeleteEmptyEntites()
{ {
throw new NotImplementedException();
foreach (var e in Entities) foreach (var e in Entities)
{ {
if (_componentCounts[e] <= 0) if (_componentCounts[e] <= 0)

View File

@ -142,15 +142,17 @@ namespace DCFApixels.DragonECS
[MethodImpl(MethodImplOptions.AggressiveInlining)] [MethodImpl(MethodImplOptions.AggressiveInlining)]
private void UnregisterEntityComponent(int entityID, int componentTypeID, EcsMaskChunck maskBit) private void UnregisterEntityComponent(int entityID, int componentTypeID, EcsMaskChunck maskBit)
{ {
// _poolComponentCounts[componentTypeID]--; _poolComponentCounts[componentTypeID]--;
// var count = --_componentCounts[entityID]; var count = --_componentCounts[entityID];
// _entitiesComponentMasks[entityID][maskBit.chankIndex] &= ~maskBit.mask; _entitiesComponentMasks[entityID][maskBit.chankIndex] &= ~maskBit.mask;
//
// if (count == 0 && _allEntites.Has(entityID)) if (count == 0 && IsUsed(entityID))
// DelEntity(entityID); {
//#if (DEBUG && !DISABLE_DEBUG) || ENABLE_DRAGONECS_ASSERT_CHEKS DelEntity(entityID);
// if (count < 0) Throw.World_InvalidIncrementComponentsBalance(); }
//#endif #if (DEBUG && !DISABLE_DEBUG) || ENABLE_DRAGONECS_ASSERT_CHEKS
if (count < 0) Throw.World_InvalidIncrementComponentsBalance();
#endif
} }
[MethodImpl(MethodImplOptions.AggressiveInlining)] [MethodImpl(MethodImplOptions.AggressiveInlining)]
private bool HasEntityComponent(int entityID, EcsMaskChunck maskBit) private bool HasEntityComponent(int entityID, EcsMaskChunck maskBit)