mirror of
https://github.com/DCFApixels/DragonECS.git
synced 2025-09-18 01:44:35 +08:00
move EcsAspectIterator to EcsAspect.Iterator
This commit is contained in:
parent
88bc3355b7
commit
316735cf9a
@ -1,5 +1,4 @@
|
||||
using DCFApixels.DragonECS.Internal;
|
||||
using DCFApixels.DragonECS.Utils;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Reflection;
|
||||
@ -13,10 +12,10 @@ namespace DCFApixels.DragonECS
|
||||
internal EcsMask _mask;
|
||||
private bool _isInit;
|
||||
|
||||
internal UnsafeArray<int> _sortIncBuffer;
|
||||
internal UnsafeArray<int> _sortExcBuffer;
|
||||
internal UnsafeArray<EcsMaskChunck> _sortIncChunckBuffer;
|
||||
internal UnsafeArray<EcsMaskChunck> _sortExcChunckBuffer;
|
||||
private UnsafeArray<int> _sortIncBuffer;
|
||||
private UnsafeArray<int> _sortExcBuffer;
|
||||
private UnsafeArray<EcsMaskChunck> _sortIncChunckBuffer;
|
||||
private UnsafeArray<EcsMaskChunck> _sortExcChunckBuffer;
|
||||
|
||||
#region Properties
|
||||
public EcsMask Mask => _mask;
|
||||
@ -150,13 +149,13 @@ namespace DCFApixels.DragonECS
|
||||
#endregion
|
||||
|
||||
#region Iterator
|
||||
public EcsAspectIterator GetIterator()
|
||||
public Iterator GetIterator()
|
||||
{
|
||||
return new EcsAspectIterator(this, _source.Entities);
|
||||
return new Iterator(this, _source.Entities);
|
||||
}
|
||||
public EcsAspectIterator GetIteratorFor(EcsSpan span)
|
||||
public Iterator GetIteratorFor(EcsSpan span)
|
||||
{
|
||||
return new EcsAspectIterator(this, span);
|
||||
return new Iterator(this, span);
|
||||
}
|
||||
#endregion
|
||||
|
||||
@ -172,25 +171,15 @@ namespace DCFApixels.DragonECS
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
}
|
||||
|
||||
#region BuilderBase
|
||||
public abstract class EcsAspectBuilderBase
|
||||
{
|
||||
public abstract TPool Include<TPool>() where TPool : IEcsPoolImplementation, new();
|
||||
public abstract TPool Exclude<TPool>() where TPool : IEcsPoolImplementation, new();
|
||||
public abstract TPool Optional<TPool>() where TPool : IEcsPoolImplementation, new();
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region Iterator
|
||||
public ref struct EcsAspectIterator
|
||||
public ref struct Iterator
|
||||
{
|
||||
public readonly int worldID;
|
||||
public readonly EcsAspect aspect;
|
||||
private EcsSpan _span;
|
||||
|
||||
public EcsAspectIterator(EcsAspect aspect, EcsSpan span)
|
||||
public Iterator(EcsAspect aspect, EcsSpan span)
|
||||
{
|
||||
worldID = aspect.World.id;
|
||||
_span = span;
|
||||
@ -401,3 +390,13 @@ namespace DCFApixels.DragonECS
|
||||
}
|
||||
#endregion
|
||||
}
|
||||
|
||||
#region BuilderBase
|
||||
public abstract class EcsAspectBuilderBase
|
||||
{
|
||||
public abstract TPool Include<TPool>() where TPool : IEcsPoolImplementation, new();
|
||||
public abstract TPool Exclude<TPool>() where TPool : IEcsPoolImplementation, new();
|
||||
public abstract TPool Optional<TPool>() where TPool : IEcsPoolImplementation, new();
|
||||
}
|
||||
#endregion
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user