mirror of
https://github.com/DCFApixels/DragonECS.git
synced 2025-09-18 18:14:37 +08:00
move EcsMaskBit to EcsAspect.cs
This commit is contained in:
parent
4c236a11f3
commit
b07256f020
@ -216,6 +216,26 @@ namespace DCFApixels.DragonECS
|
|||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
#region Mask
|
#region Mask
|
||||||
|
public readonly struct EcsMaskBit
|
||||||
|
{
|
||||||
|
public readonly int chankIndex;
|
||||||
|
public readonly int mask;
|
||||||
|
public EcsMaskBit(int chankIndex, int mask)
|
||||||
|
{
|
||||||
|
this.chankIndex = chankIndex;
|
||||||
|
this.mask = mask;
|
||||||
|
}
|
||||||
|
public static EcsMaskBit FromPoolID(int id)
|
||||||
|
{
|
||||||
|
return new EcsMaskBit(id / 32, 1 << (id % 32));
|
||||||
|
}
|
||||||
|
|
||||||
|
public override string ToString()
|
||||||
|
{
|
||||||
|
return $"bit({chankIndex}, {mask})";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
[DebuggerTypeProxy(typeof(DebuggerProxy))]
|
[DebuggerTypeProxy(typeof(DebuggerProxy))]
|
||||||
public sealed class EcsMask
|
public sealed class EcsMask
|
||||||
{
|
{
|
||||||
|
@ -1,22 +0,0 @@
|
|||||||
namespace DCFApixels.DragonECS
|
|
||||||
{
|
|
||||||
public readonly struct EcsMaskBit
|
|
||||||
{
|
|
||||||
public readonly int chankIndex;
|
|
||||||
public readonly int mask;
|
|
||||||
public EcsMaskBit(int chankIndex, int mask)
|
|
||||||
{
|
|
||||||
this.chankIndex = chankIndex;
|
|
||||||
this.mask = mask;
|
|
||||||
}
|
|
||||||
public static EcsMaskBit FromPoolID(int id)
|
|
||||||
{
|
|
||||||
return new EcsMaskBit(id / 32, 1 << (id % 32));
|
|
||||||
}
|
|
||||||
|
|
||||||
public override string ToString()
|
|
||||||
{
|
|
||||||
return $"bit({chankIndex}, {mask})";
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
Loading…
Reference in New Issue
Block a user