mirror of
https://github.com/DCFApixels/DragonECS.git
synced 2025-09-17 17:34:36 +08:00
code cleanup
This commit is contained in:
parent
3c053b2a5e
commit
8e4c6ce552
@ -185,7 +185,7 @@ namespace DCFApixels.DragonECS
|
||||
|
||||
public bool IsCollidingID(string id)
|
||||
{
|
||||
if(_collidingIDs== null)
|
||||
if (_collidingIDs == null)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
@ -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;
|
||||
}
|
||||
|
@ -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);
|
||||
}
|
||||
|
@ -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;
|
||||
|
@ -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();
|
||||
}
|
||||
|
@ -125,7 +125,7 @@ namespace DCFApixels.DragonECS.Core
|
||||
_maskInc = mask._incs;
|
||||
_maskExc = mask._excs;
|
||||
_count = 1 + mask._incs.Length + mask._excs.Length;
|
||||
|
||||
|
||||
_versions = UnmanagedArrayUtility.NewAndInit<long>(_count);
|
||||
}
|
||||
public bool Check()
|
||||
|
@ -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)
|
||||
|
@ -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); }
|
||||
|
Loading…
Reference in New Issue
Block a user