remove EcsGroup.CapacitySparce , rename EcsSpan.Count

This commit is contained in:
Mikhail 2024-03-02 04:22:29 +08:00
parent d2356c1588
commit 089eff6674
3 changed files with 5 additions and 15 deletions

View File

@ -44,11 +44,6 @@ namespace DCFApixels.DragonECS
[MethodImpl(MethodImplOptions.AggressiveInlining)] [MethodImpl(MethodImplOptions.AggressiveInlining)]
get { return _source.CapacityDense; } get { return _source.CapacityDense; }
} }
public int CapacitySparce //TODO remove
{
[MethodImpl(MethodImplOptions.AggressiveInlining)]
get { return _source.CapacitySparce; }
}
public bool IsReleazed public bool IsReleazed
{ {
[MethodImpl(MethodImplOptions.AggressiveInlining)] [MethodImpl(MethodImplOptions.AggressiveInlining)]
@ -174,11 +169,6 @@ namespace DCFApixels.DragonECS
[MethodImpl(MethodImplOptions.AggressiveInlining)] [MethodImpl(MethodImplOptions.AggressiveInlining)]
get => _dense.Length; get => _dense.Length;
} }
public int CapacitySparce //TODO remove
{
[MethodImpl(MethodImplOptions.AggressiveInlining)]
get => _sparse.Length;
}
public EcsReadonlyGroup Readonly public EcsReadonlyGroup Readonly
{ {
[MethodImpl(MethodImplOptions.AggressiveInlining)] [MethodImpl(MethodImplOptions.AggressiveInlining)]
@ -336,7 +326,7 @@ namespace DCFApixels.DragonECS
{ {
Clear(); Clear();
} }
for (int i = 0; i < span.Length; i++) for (int i = 0; i < span.Count; i++)
{ {
Add_Internal(span[i]); Add_Internal(span[i]);
} }
@ -539,7 +529,7 @@ namespace DCFApixels.DragonECS
#if (DEBUG && !DISABLE_DEBUG) || ENABLE_DRAGONECS_ASSERT_CHEKS #if (DEBUG && !DISABLE_DEBUG) || ENABLE_DRAGONECS_ASSERT_CHEKS
if (_source.id != span.WorldID) Throw.Group_ArgumentDifferentWorldsException(); if (_source.id != span.WorldID) Throw.Group_ArgumentDifferentWorldsException();
#endif #endif
if (span.Length != Count) if (span.Count != Count)
return false; return false;
foreach (var item in span) foreach (var item in span)
if (!Has(item)) if (!Has(item))

View File

@ -28,7 +28,7 @@ namespace DCFApixels.DragonECS
{ {
get { return EcsWorld.GetWorld(_worldID); } get { return EcsWorld.GetWorld(_worldID); }
} }
public int Length //TODO rename to Count public int Count
{ {
[MethodImpl(MethodImplOptions.AggressiveInlining)] [MethodImpl(MethodImplOptions.AggressiveInlining)]
get { return _values.Length; } get { return _values.Length; }
@ -145,7 +145,7 @@ namespace DCFApixels.DragonECS
public int Count { get { return _values.Length; } } public int Count { get { return _values.Length; } }
public DebuggerProxy(EcsSpan span) public DebuggerProxy(EcsSpan span)
{ {
_values = new int[span.Length]; _values = new int[span.Count];
span._values.CopyTo(_values); span._values.CopyTo(_values);
_worldID = span._worldID; _worldID = span._worldID;
} }

View File

@ -54,7 +54,7 @@ namespace DCFApixels.DragonECS
if (_lastWorldVersion != World.Version) if (_lastWorldVersion != World.Version)
{ {
result = _aspect.GetIteratorFor(span).CopyToSpan(ref _filteredEntities); result = _aspect.GetIteratorFor(span).CopyToSpan(ref _filteredEntities);
_filteredEntitiesCount = result.Length; _filteredEntitiesCount = result.Count;
_lastWorldVersion = World.Version; _lastWorldVersion = World.Version;
} }
else else