add BaseMeta to TypeMeta

This commit is contained in:
Mikhail 2024-09-14 10:01:48 +08:00
parent bdf31769bf
commit 4a44995b48

View File

@ -17,8 +17,18 @@ namespace DCFApixels.DragonECS
MetaDescription Description { get; } MetaDescription Description { get; }
MetaGroup Group { get; } MetaGroup Group { get; }
IReadOnlyList<string> Tags { get; } IReadOnlyList<string> Tags { get; }
}
ITypeMeta BaseMeta { get; }
}
public static class ITypeMetaExstensions
{
public static TypeMeta FindRootTypeMeta(this ITypeMeta meta)
{
ITypeMeta result = null;
while ((result = meta.BaseMeta) != null) { }
return (TypeMeta)result;
}
}
/// <summary> Expanding meta information over Type. </summary> /// <summary> Expanding meta information over Type. </summary>
[MetaColor(MetaColor.DragonRose)] [MetaColor(MetaColor.DragonRose)]
[MetaGroup(EcsConsts.PACK_GROUP, EcsConsts.DEBUG_GROUP)] [MetaGroup(EcsConsts.PACK_GROUP, EcsConsts.DEBUG_GROUP)]
@ -49,6 +59,11 @@ namespace DCFApixels.DragonECS
//private EcsMemberType _memberType; //private EcsMemberType _memberType;
public ITypeMeta BaseMeta
{
get { return null; }
}
#region Constructors #region Constructors
public static TypeMeta Get(Type type) public static TypeMeta Get(Type type)
{ {
@ -263,6 +278,11 @@ namespace DCFApixels.DragonECS
private class DebuggerProxy : ITypeMeta private class DebuggerProxy : ITypeMeta
{ {
private readonly TypeMeta _meta; private readonly TypeMeta _meta;
public ITypeMeta BaseMeta
{
get { return _meta.BaseMeta; }
}
public Type Type public Type Type
{ {
get { return _meta.Type; } get { return _meta.Type; }