add Deconstruct to entlong

This commit is contained in:
Mikhail 2024-01-26 18:58:54 +08:00
parent 36d5c15817
commit 9ae92c7cdf

View File

@ -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