From 4ac8f6d5f1938b965774c217c5208fec00434464 Mon Sep 17 00:00:00 2001 From: DCFApixels <99481254+DCFApixels@users.noreply.github.com> Date: Fri, 23 May 2025 17:18:01 +0800 Subject: [PATCH] fix entlong.DebuggerProxy --- src/Utils/Uncheked/EntitySlotInfo.cs | 20 +++++++++++--------- src/entlong.cs | 12 ++++++++++-- 2 files changed, 21 insertions(+), 11 deletions(-) diff --git a/src/Utils/Uncheked/EntitySlotInfo.cs b/src/Utils/Uncheked/EntitySlotInfo.cs index 942d666..65a8292 100644 --- a/src/Utils/Uncheked/EntitySlotInfo.cs +++ b/src/Utils/Uncheked/EntitySlotInfo.cs @@ -84,19 +84,17 @@ namespace DCFApixels.DragonECS.Core.Unchecked #endregion } - - internal class EntityDebuggerProxy { private List _componentsList = new List(); private EntitySlotInfo _info; - public long full { get { return _info.full; } } - public int id { get { return _info.id; } } - public short gen { get { return _info.gen; } } - public short worldID { get { return _info.worldID; } } - public EntitySlotInfo.StateFlag State { get { return _info.State; } } - public EcsWorld World { get { return _info.World; } } - public IEnumerable Components + public virtual long full { get { return _info.full; } } + public virtual int id { get { return _info.id; } } + public virtual short gen { get { return _info.gen; } } + public virtual short worldID { get { return _info.worldID; } } + public virtual EntitySlotInfo.StateFlag State { get { return _info.State; } } + public virtual EcsWorld World { get { return _info.World; } } + public virtual IEnumerable Components { get { @@ -129,6 +127,10 @@ namespace DCFApixels.DragonECS.Core.Unchecked { _info = info; } + public EntityDebuggerProxy(entlong info) + { + _info = (EntitySlotInfo)info; + } public EntityDebuggerProxy(int entityID, short gen, short worldID) { _info = new EntitySlotInfo(entityID, gen, worldID); diff --git a/src/entlong.cs b/src/entlong.cs index e657a42..d8f38b2 100644 --- a/src/entlong.cs +++ b/src/entlong.cs @@ -6,6 +6,7 @@ using DCFApixels.DragonECS.Core.Internal; using DCFApixels.DragonECS.Core.Unchecked; using System; +using System.Collections.Generic; using System.Diagnostics; using System.Runtime.CompilerServices; using System.Runtime.InteropServices; @@ -47,7 +48,7 @@ namespace DCFApixels.DragonECS public bool IsAlive { [MethodImpl(MethodImplOptions.AggressiveInlining)] - get + get { return EcsWorld.TryGetWorld(_world, out EcsWorld world) && world.IsAlive(_id, _gen); } @@ -391,7 +392,14 @@ namespace DCFApixels.DragonECS internal class DebuggerProxy : EntityDebuggerProxy { - public DebuggerProxy(entlong entity) : base(entity._id, entity._gen, entity._world) { } + public override long full => base.full; + public override int id => base.id; + public override short gen => base.gen; + public override short worldID => base.worldID; + public override EntitySlotInfo.StateFlag State => base.State; + public override EcsWorld World => base.World; + public override IEnumerable Components { get => base.Components; set => base.Components = value; } + public DebuggerProxy(entlong entity) : base(entity) { } } #endregion }