From e0a3d54979bb73c67812f50f3307b721c8be3ee7 Mon Sep 17 00:00:00 2001 From: Mikhail <99481254+DCFApixels@users.noreply.github.com> Date: Wed, 6 Mar 2024 23:29:37 +0800 Subject: [PATCH] rename MetaGroup --- src/Debug/EcsDebugUtility.cs | 22 +++++++++---------- .../MetaAttributes/MetaGroupAttribute.cs | 22 +++++++++---------- 2 files changed, 22 insertions(+), 22 deletions(-) diff --git a/src/Debug/EcsDebugUtility.cs b/src/Debug/EcsDebugUtility.cs index 239b269..82a36f3 100644 --- a/src/Debug/EcsDebugUtility.cs +++ b/src/Debug/EcsDebugUtility.cs @@ -193,32 +193,32 @@ namespace DCFApixels.DragonECS #endregion #region GetGroup - public static ReadonlyMetaGroup GetGroup(object obj) + public static MetaGroup GetGroup(object obj) { return GetTypeMeta(obj).Group; } - public static ReadonlyMetaGroup GetGroup() + public static MetaGroup GetGroup() { return GetTypeMeta().Group; } - public static ReadonlyMetaGroup GetGroup(Type type) + public static MetaGroup GetGroup(Type type) { return GetTypeMeta(type).Group; } - public static bool TryGetGroup(object obj, out ReadonlyMetaGroup group) + public static bool TryGetGroup(object obj, out MetaGroup group) { TypeMeta meta = GetTypeMeta(obj); group = meta.Group; return group.IsNull; } - public static bool TryGetGroup(out ReadonlyMetaGroup group) + public static bool TryGetGroup(out MetaGroup group) { TypeMeta meta = GetTypeMeta(); group = meta.Group; return group.IsNull; } - public static bool TryGetGroup(Type type, out ReadonlyMetaGroup group) + public static bool TryGetGroup(Type type, out MetaGroup group) { TypeMeta meta = GetTypeMeta(type); group = meta.Group; @@ -313,7 +313,7 @@ namespace DCFApixels.DragonECS public string Name { get; } public MetaColor Color { get; } public string Description { get; } - public ReadonlyMetaGroup Group { get; } + public MetaGroup Group { get; } public IReadOnlyCollection Tags { get; } } public sealed class TypeMeta : ITypeMeta @@ -327,7 +327,7 @@ namespace DCFApixels.DragonECS private string _name; private MetaColor _color; private string _description; - private ReadonlyMetaGroup _group; + private MetaGroup _group; private IReadOnlyCollection _tags; private int _typeCode; @@ -417,7 +417,7 @@ namespace DCFApixels.DragonECS #endregion #region Group - public ReadonlyMetaGroup Group + public MetaGroup Group { get { @@ -547,9 +547,9 @@ namespace DCFApixels.DragonECS.Internal #endregion #region GetGroup - public static ReadonlyMetaGroup GetGroup(Type type) + public static MetaGroup GetGroup(Type type) { - return type.TryGetCustomAttribute(out MetaGroupAttribute atr) ? atr.Data : ReadonlyMetaGroup.Empty; + return type.TryGetCustomAttribute(out MetaGroupAttribute atr) ? atr.Data : MetaGroup.Empty; } #endregion diff --git a/src/Debug/MetaAttributes/MetaGroupAttribute.cs b/src/Debug/MetaAttributes/MetaGroupAttribute.cs index 694781b..0e693d1 100644 --- a/src/Debug/MetaAttributes/MetaGroupAttribute.cs +++ b/src/Debug/MetaAttributes/MetaGroupAttribute.cs @@ -6,15 +6,15 @@ namespace DCFApixels.DragonECS [AttributeUsage(AttributeTargets.Struct | AttributeTargets.Class | AttributeTargets.Interface, Inherited = false, AllowMultiple = false)] public sealed class MetaGroupAttribute : EcsMetaAttribute { - public readonly MetaGroup Data; + public readonly MetaGroupRef Data; public MetaGroupAttribute(string name) { - Data = new MetaGroup(name); + Data = new MetaGroupRef(name); } } - public class MetaGroup + public class MetaGroupRef { - public static readonly MetaGroup Empty = new MetaGroup(""); + public static readonly MetaGroupRef Empty = new MetaGroupRef(""); public readonly string Name; private string[] path = null; @@ -29,7 +29,7 @@ namespace DCFApixels.DragonECS return path; } } - public MetaGroup(string name) + public MetaGroupRef(string name) { if (string.IsNullOrEmpty(name)) { @@ -45,10 +45,10 @@ namespace DCFApixels.DragonECS } } - public readonly struct ReadonlyMetaGroup + public readonly struct MetaGroup { - public static readonly ReadonlyMetaGroup Empty = new ReadonlyMetaGroup(MetaGroup.Empty); - private readonly MetaGroup _source; + public static readonly MetaGroup Empty = new MetaGroup(MetaGroupRef.Empty); + private readonly MetaGroupRef _source; public string Name { get { return _source.Name; } @@ -61,14 +61,14 @@ namespace DCFApixels.DragonECS { get { return _source == null; } } - public ReadonlyMetaGroup(MetaGroup source) + public MetaGroup(MetaGroupRef source) { _source = source; } - public static implicit operator ReadonlyMetaGroup(MetaGroup group) + public static implicit operator MetaGroup(MetaGroupRef group) { - return new ReadonlyMetaGroup(group); + return new MetaGroup(group); } } }