mirror of
https://github.com/DCFApixels/DragonECS.git
synced 2025-09-18 18:14:37 +08:00
Merge branch 'dev'
This commit is contained in:
commit
cbfe7930b3
@ -731,6 +731,14 @@ namespace DCFApixels.DragonECS
|
|||||||
#endregion
|
#endregion
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static class EcsWorldExtenssions
|
||||||
|
{
|
||||||
|
public static bool IsNullOrDetroyed(this EcsWorld self)
|
||||||
|
{
|
||||||
|
return self == null || self.IsDestroyed;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
#region Callbacks Interface
|
#region Callbacks Interface
|
||||||
public interface IEcsWorldEventListener
|
public interface IEcsWorldEventListener
|
||||||
{
|
{
|
||||||
|
@ -105,49 +105,72 @@ namespace DCFApixels.DragonECS
|
|||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
#region TryGetters
|
#region TryGetters
|
||||||
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||||
public bool TryGetID(out int id)
|
public bool TryGetID(out int id)
|
||||||
{
|
{
|
||||||
id = this.id;
|
id = this.id;
|
||||||
return IsAlive;
|
return IsAlive;
|
||||||
}
|
}
|
||||||
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||||
public bool TryGetWorld(out EcsWorld world)
|
public bool TryGetWorld(out EcsWorld world)
|
||||||
{
|
{
|
||||||
world = EcsWorld.GetWorld(this.world);
|
world = EcsWorld.GetWorld(this.world);
|
||||||
return IsAlive;
|
return IsAlive;
|
||||||
}
|
}
|
||||||
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||||
public bool TryGetWorldID(out short worldID)
|
public bool TryGetWorldID(out short worldID)
|
||||||
{
|
{
|
||||||
worldID = world;
|
worldID = world;
|
||||||
return IsAlive;
|
return IsAlive;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||||
public void Unpack(out int id, out EcsWorld world)
|
public void Unpack(out int id, out EcsWorld world)
|
||||||
{
|
{
|
||||||
|
#if (DEBUG && !DISABLE_DEBUG) || ENABLE_DRAGONECS_ASSERT_CHEKS
|
||||||
|
if (!IsAlive) { Throw.Ent_ThrowIsNotAlive(this); }
|
||||||
|
#endif
|
||||||
world = EcsWorld.GetWorld(this.world);
|
world = EcsWorld.GetWorld(this.world);
|
||||||
id = this.id;
|
id = this.id;
|
||||||
}
|
}
|
||||||
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||||
public void Unpack(out int id, out short gen, out EcsWorld world)
|
public void Unpack(out int id, out short gen, out EcsWorld world)
|
||||||
{
|
{
|
||||||
|
#if (DEBUG && !DISABLE_DEBUG) || ENABLE_DRAGONECS_ASSERT_CHEKS
|
||||||
|
if (!IsAlive) { Throw.Ent_ThrowIsNotAlive(this); }
|
||||||
|
#endif
|
||||||
world = EcsWorld.GetWorld(this.world);
|
world = EcsWorld.GetWorld(this.world);
|
||||||
gen = this.gen;
|
gen = this.gen;
|
||||||
id = this.id;
|
id = this.id;
|
||||||
}
|
}
|
||||||
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||||
public void Unpack(out int id, out short worldID)
|
public void Unpack(out int id, out short worldID)
|
||||||
{
|
{
|
||||||
|
#if (DEBUG && !DISABLE_DEBUG) || ENABLE_DRAGONECS_ASSERT_CHEKS
|
||||||
|
if (!IsAlive) { Throw.Ent_ThrowIsNotAlive(this); }
|
||||||
|
#endif
|
||||||
worldID = world;
|
worldID = world;
|
||||||
id = this.id;
|
id = this.id;
|
||||||
}
|
}
|
||||||
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||||
public void Unpack(out int id, out short gen, out short worldID)
|
public void Unpack(out int id, out short gen, out short worldID)
|
||||||
{
|
{
|
||||||
|
#if (DEBUG && !DISABLE_DEBUG) || ENABLE_DRAGONECS_ASSERT_CHEKS
|
||||||
|
if (!IsAlive) { Throw.Ent_ThrowIsNotAlive(this); }
|
||||||
|
#endif
|
||||||
worldID = world;
|
worldID = world;
|
||||||
gen = this.gen;
|
gen = this.gen;
|
||||||
id = this.id;
|
id = this.id;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||||
public bool TryUnpack(out int id, out EcsWorld world)
|
public bool TryUnpack(out int id, out EcsWorld world)
|
||||||
{
|
{
|
||||||
world = EcsWorld.GetWorld(this.world);
|
world = EcsWorld.GetWorld(this.world);
|
||||||
id = this.id;
|
id = this.id;
|
||||||
return IsAlive;
|
return IsAlive;
|
||||||
}
|
}
|
||||||
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||||
public bool TryUnpack(out int id, out short gen, out EcsWorld world)
|
public bool TryUnpack(out int id, out short gen, out EcsWorld world)
|
||||||
{
|
{
|
||||||
world = EcsWorld.GetWorld(this.world);
|
world = EcsWorld.GetWorld(this.world);
|
||||||
@ -155,12 +178,14 @@ namespace DCFApixels.DragonECS
|
|||||||
id = this.id;
|
id = this.id;
|
||||||
return IsAlive;
|
return IsAlive;
|
||||||
}
|
}
|
||||||
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||||
public bool TryUnpack(out int id, out short worldID)
|
public bool TryUnpack(out int id, out short worldID)
|
||||||
{
|
{
|
||||||
worldID = world;
|
worldID = world;
|
||||||
id = this.id;
|
id = this.id;
|
||||||
return IsAlive;
|
return IsAlive;
|
||||||
}
|
}
|
||||||
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||||
public bool TryUnpack(out int id, out short gen, out short worldID)
|
public bool TryUnpack(out int id, out short gen, out short worldID)
|
||||||
{
|
{
|
||||||
worldID = world;
|
worldID = world;
|
||||||
@ -168,6 +193,49 @@ namespace DCFApixels.DragonECS
|
|||||||
id = this.id;
|
id = this.id;
|
||||||
return IsAlive;
|
return IsAlive;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||||
|
public int GetIDUnchecked()
|
||||||
|
{
|
||||||
|
return id;
|
||||||
|
}
|
||||||
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||||
|
public EcsWorld GetWorldUnchecked()
|
||||||
|
{
|
||||||
|
return EcsWorld.GetWorld(world);
|
||||||
|
}
|
||||||
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||||
|
public short GetWorldIDUnchecked()
|
||||||
|
{
|
||||||
|
return world;
|
||||||
|
}
|
||||||
|
|
||||||
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||||
|
public void UnpackUnchecked(out int id, out EcsWorld world)
|
||||||
|
{
|
||||||
|
world = EcsWorld.GetWorld(this.world);
|
||||||
|
id = this.id;
|
||||||
|
}
|
||||||
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||||
|
public void UnpackUnchecked(out int id, out short gen, out EcsWorld world)
|
||||||
|
{
|
||||||
|
world = EcsWorld.GetWorld(this.world);
|
||||||
|
gen = this.gen;
|
||||||
|
id = this.id;
|
||||||
|
}
|
||||||
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||||
|
public void UnpackUnchecked(out int id, out short worldID)
|
||||||
|
{
|
||||||
|
worldID = world;
|
||||||
|
id = this.id;
|
||||||
|
}
|
||||||
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||||
|
public void UnpackUnchecked(out int id, out short gen, out short worldID)
|
||||||
|
{
|
||||||
|
worldID = world;
|
||||||
|
gen = this.gen;
|
||||||
|
id = this.id;
|
||||||
|
}
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
#region Operators
|
#region Operators
|
||||||
|
Loading…
Reference in New Issue
Block a user