mirror of
https://github.com/DCFApixels/DragonECS-Graphs.git
synced 2025-09-18 03:34:35 +08:00
update
This commit is contained in:
parent
2165342fb0
commit
6123f26765
@ -7,7 +7,7 @@ using System.Runtime.CompilerServices;
|
||||
namespace DCFApixels.DragonECS
|
||||
{
|
||||
public sealed class EcsJoinToSubGraphExecutor<TAspect> : EcsJoinToSubGraphExecutor
|
||||
where TAspect : EcsAspect
|
||||
where TAspect : EcsAspect, new()
|
||||
{
|
||||
private TAspect _aspect;
|
||||
|
||||
@ -362,18 +362,18 @@ namespace DCFApixels.DragonECS
|
||||
|
||||
#region JoinToGraph
|
||||
public static EcsSubGraph JoinToSubGraph<TCollection, TAspect>(this TCollection entities, out TAspect aspect, EcsSubGraphMode mode = EcsSubGraphMode.StartToEnd)
|
||||
where TAspect : EcsAspect
|
||||
where TAspect : EcsAspect, new()
|
||||
where TCollection : IEntityStorage
|
||||
{
|
||||
return entities.ToSpan().JoinToSubGraph(out aspect, mode);
|
||||
}
|
||||
public static EcsSubGraph JoinToSubGraph<TAspect>(this EcsReadonlyGroup group, out TAspect aspect, EcsSubGraphMode mode = EcsSubGraphMode.StartToEnd)
|
||||
where TAspect : EcsAspect
|
||||
where TAspect : EcsAspect, new()
|
||||
{
|
||||
return group.ToSpan().JoinToSubGraph(out aspect, mode);
|
||||
}
|
||||
public static EcsSubGraph JoinToSubGraph<TAspect>(this EcsSpan span, out TAspect aspect, EcsSubGraphMode mode = EcsSubGraphMode.StartToEnd)
|
||||
where TAspect : EcsAspect
|
||||
where TAspect : EcsAspect, new()
|
||||
{
|
||||
EcsWorld world = span.World;
|
||||
if (world.IsEnableReleaseDelEntBuffer)
|
||||
|
@ -346,15 +346,19 @@ namespace DCFApixels.DragonECS.Graphs.Internal
|
||||
x ^= x >> 17;
|
||||
return x;
|
||||
}
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
internal static bool EqualsInFind(Key a, Key b) { return a.x == b.x; }
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
public static bool operator ==(Key a, Key b) { return a.x == b.x && a.yHash == b.yHash; }
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
public static bool operator !=(Key a, Key b) { return a.x != b.x || a.yHash != b.yHash; }
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
public override int GetHashCode() { return yHash; }
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
public bool Equals(Key other) { return this == other; }
|
||||
public override bool Equals(object obj) { return obj is Key && Equals((Key)obj); }
|
||||
public override string ToString()
|
||||
{
|
||||
return $"({x}, {yHash})";
|
||||
}
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
public override string ToString() { return $"({x}, {yHash})"; }
|
||||
}
|
||||
#endregion
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user