diff --git a/src/Debug/EcsDebugUtility.cs b/src/Debug/EcsDebugUtility.cs index 91f9841..38ac0ec 100644 --- a/src/Debug/EcsDebugUtility.cs +++ b/src/Debug/EcsDebugUtility.cs @@ -504,6 +504,13 @@ namespace DCFApixels.DragonECS All = Name | Group | Color | Description | Tags | TypeCode } #endregion + + #region Other + public override string ToString() + { + return Name; + } + #endregion } public static class TypeMetaDataCachedExtensions diff --git a/src/EcsPipeline.cs b/src/EcsPipeline.cs index 2d30c06..03b8fee 100644 --- a/src/EcsPipeline.cs +++ b/src/EcsPipeline.cs @@ -3,6 +3,7 @@ using DCFApixels.DragonECS.RunnersCore; using System; using System.Collections; using System.Collections.Generic; +using System.Diagnostics; using System.Linq; using System.Runtime.CompilerServices; @@ -489,9 +490,12 @@ namespace DCFApixels.DragonECS #endregion #region EcsProcess + [DebuggerTypeProxy(typeof(DebuggerProxy))] public readonly struct EcsProcessRaw : IEnumerable { private readonly Array _systems; + + #region Properties public int Length { [MethodImpl(MethodImplOptions.AggressiveInlining)] @@ -501,26 +505,62 @@ namespace DCFApixels.DragonECS { get { return (IEcsProcess)_systems.GetValue(index); } } + #endregion + + #region Constructors [MethodImpl(MethodImplOptions.AggressiveInlining)] internal EcsProcessRaw(Array systems) { _systems = systems; } + #endregion + + #region Enumerator public IEnumerator GetEnumerator() { return _systems.GetEnumerator(); } + #endregion + + #region Internal [MethodImpl(MethodImplOptions.AggressiveInlining)] internal T[] GetSystems_Internal() { return (T[])_systems; } + #endregion + + #region DebuggerProxy + internal class DebuggerProxy + { + private EcsProcessRaw _process; + public IEnumerable Systems + { + get + { + return _process._systems.Cast().Select(o => o.GetMeta()); + } + } + public int Count + { + get { return _process.Length; } + } + public DebuggerProxy(EcsProcessRaw process) + { + _process = process; + } + } + #endregion } + + [DebuggerTypeProxy(typeof(EcsProcess<>.DebuggerProxy))] public readonly struct EcsProcess : IReadOnlyCollection where TProcess : IEcsProcess { public readonly static EcsProcess Empty = new EcsProcess(Array.Empty()); private readonly TProcess[] _systems; + + #region Properties public bool IsNullOrEmpty { [MethodImpl(MethodImplOptions.AggressiveInlining)] @@ -541,11 +581,17 @@ namespace DCFApixels.DragonECS [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return _systems[index]; } } + #endregion + + #region Constructors [MethodImpl(MethodImplOptions.AggressiveInlining)] internal EcsProcess(TProcess[] systems) { _systems = systems; } + #endregion + + #region Converts public static explicit operator EcsProcess(EcsProcessRaw raw) { return new EcsProcess(raw.GetSystems_Internal()); @@ -554,6 +600,9 @@ namespace DCFApixels.DragonECS { return new EcsProcessRaw(process._systems); } + #endregion + + #region Enumerator [MethodImpl(MethodImplOptions.AggressiveInlining)] public Enumerator GetEnumerator() { return new Enumerator(_systems); } IEnumerator IEnumerable.GetEnumerator() { return GetEnumerator(); } @@ -581,6 +630,29 @@ namespace DCFApixels.DragonECS [MethodImpl(MethodImplOptions.AggressiveInlining)] public void Dispose() { } } + #endregion + + #region DebuggerProxy + internal class DebuggerProxy + { + private EcsProcess _process; + public IEnumerable Systems + { + get + { + return _process._systems.Select(o => o.GetMeta()); + } + } + public int Count + { + get { return _process.Length; } + } + public DebuggerProxy(EcsProcess process) + { + _process = process; + } + } + #endregion } #endregion } \ No newline at end of file