mirror of
https://github.com/DCFApixels/DragonECS.git
synced 2025-09-18 01:44:35 +08:00
add Deconstruct to entlong
This commit is contained in:
parent
36d5c15817
commit
9ae92c7cdf
@ -155,9 +155,27 @@ namespace DCFApixels.DragonECS
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
public static explicit operator entlong(long a) => new entlong(a);
|
||||
|
||||
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
public static explicit operator int(entlong a) => a.ID;
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
public void Deconstruct(out int id, out int gen, out int world)
|
||||
{
|
||||
#if (DEBUG && !DISABLE_DEBUG) || ENABLE_DRAGONECS_ASSERT_CHEKS
|
||||
if (!IsAlive) Throw.Ent_ThrowIsNotAlive(this);
|
||||
#endif
|
||||
id = this.id;
|
||||
gen = this.gen;
|
||||
world = this.world;
|
||||
}
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
public void Deconstruct(out int id, out int world)
|
||||
{
|
||||
#if (DEBUG && !DISABLE_DEBUG) || ENABLE_DRAGONECS_ASSERT_CHEKS
|
||||
if (!IsAlive) Throw.Ent_ThrowIsNotAlive(this);
|
||||
#endif
|
||||
id = this.id;
|
||||
world = this.world;
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region Other
|
||||
|
Loading…
Reference in New Issue
Block a user