code cleanup

This commit is contained in:
DCFApixels 2025-04-19 10:53:52 +08:00
parent 3c053b2a5e
commit 8e4c6ce552
8 changed files with 11 additions and 11 deletions

View File

@ -185,7 +185,7 @@ namespace DCFApixels.DragonECS
public bool IsCollidingID(string id)
{
if(_collidingIDs== null)
if (_collidingIDs == null)
{
return false;
}

View File

@ -440,7 +440,7 @@ namespace DCFApixels.DragonECS
{
for (int i = _emptyEntitiesCount - 1; i >= 0; i--)
{
if(_emptyEntities[i] == entityID)
if (_emptyEntities[i] == entityID)
{
_emptyEntities[i] = _emptyEntities[--_emptyEntitiesCount];
return true;
@ -856,7 +856,7 @@ namespace DCFApixels.DragonECS
}
_emptyEntitiesCount = 0;
if(count < 0)
if (count < 0)
{
count = _delEntBufferCount;
}

View File

@ -314,7 +314,7 @@ namespace DCFApixels.DragonECS
slot.count++;
slot.version++;
var count = _entities[entityID].componentsCount++;
if(count == 0 && IsUsed(entityID))
if (count == 0 && IsUsed(entityID))
{
RemoveFromEmptyEntities(entityID);
}

View File

@ -45,7 +45,7 @@ namespace DCFApixels.DragonECS
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static bool TryGetWorld(short worldID, out EcsWorld world)
{// ts
if(worldID >= _worlds.Length)
if (worldID >= _worlds.Length)
{
world = null;
return false;

View File

@ -69,19 +69,19 @@ namespace DCFApixels.DragonECS.Internal
_version++;
_iterator.IterateTo(World.Entities, _filteredAllGroup);
#if DEBUG && DRAGONECS_DEEP_DEBUG
if(_filteredGroup == null)
if (_filteredGroup == null)
{
_filteredGroup = EcsGroup.New(World);
}
_filteredGroup.Clear();
foreach (var e in World.Entities)
{
if(World.IsMatchesMask(Mask, e))
if (World.IsMatchesMask(Mask, e))
{
_filteredGroup.Add(e);
}
}
if(_filteredAllGroup.SetEquals(_filteredGroup) == false)
if (_filteredAllGroup.SetEquals(_filteredGroup) == false)
{
throw new System.InvalidOperationException();
}

View File

@ -538,7 +538,7 @@ namespace DCFApixels.DragonECS.Internal
state ^= state >> 17;
state ^= state << 5;
return state;
};
}
}
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static long NextXorShiftState(long state)

View File

@ -447,7 +447,7 @@ namespace DCFApixels.DragonECS
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public void RemoveListener(IEcsPoolEventListener listener) { _pool.AddListener(listener); }
#endif
#endregion
#endregion
#region Convertors
public static implicit operator ReadonlyEcsPool<T>(EcsPool<T> a) { return new ReadonlyEcsPool<T>(a); }