mirror of
https://github.com/DCFApixels/DragonECS.git
synced 2025-09-19 02:24:37 +08:00
update TypeMeta
This commit is contained in:
parent
b331f4fda1
commit
b14adb01ca
@ -28,6 +28,7 @@ namespace DCFApixels.DragonECS
|
|||||||
{
|
{
|
||||||
get { return string.IsNullOrEmpty(Author) == false; }
|
get { return string.IsNullOrEmpty(Author) == false; }
|
||||||
}
|
}
|
||||||
|
public MetaDescription(string text) : this(null, text) { }
|
||||||
public MetaDescription(string author, string text)
|
public MetaDescription(string author, string text)
|
||||||
{
|
{
|
||||||
if (author == null) { author = string.Empty; }
|
if (author == null) { author = string.Empty; }
|
||||||
|
@ -65,6 +65,9 @@ namespace DCFApixels.DragonECS
|
|||||||
private string _metaID;
|
private string _metaID;
|
||||||
private EcsTypeCode _typeCode;
|
private EcsTypeCode _typeCode;
|
||||||
|
|
||||||
|
private bool _isProcess;
|
||||||
|
private bool _isComponent;
|
||||||
|
|
||||||
private InitFlag _initFlags = InitFlag.None;
|
private InitFlag _initFlags = InitFlag.None;
|
||||||
|
|
||||||
#region Constructors
|
#region Constructors
|
||||||
@ -287,6 +290,33 @@ namespace DCFApixels.DragonECS
|
|||||||
}
|
}
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
|
#region ReflectionInfo
|
||||||
|
public bool IsComponent
|
||||||
|
{
|
||||||
|
get
|
||||||
|
{
|
||||||
|
if (_initFlags.HasFlag(InitFlag.ReflectionInfo) == false)
|
||||||
|
{
|
||||||
|
MetaGenerator.GetReflectionInfo(this);
|
||||||
|
_initFlags |= InitFlag.ReflectionInfo;
|
||||||
|
}
|
||||||
|
return _isComponent;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
public bool IsProcess
|
||||||
|
{
|
||||||
|
get
|
||||||
|
{
|
||||||
|
if (_initFlags.HasFlag(InitFlag.ReflectionInfo) == false)
|
||||||
|
{
|
||||||
|
MetaGenerator.GetReflectionInfo(this);
|
||||||
|
_initFlags |= InitFlag.ReflectionInfo;
|
||||||
|
}
|
||||||
|
return _isProcess;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
#endregion
|
||||||
|
|
||||||
#region InitializeAll
|
#region InitializeAll
|
||||||
public TypeMeta InitializeAll()
|
public TypeMeta InitializeAll()
|
||||||
{
|
{
|
||||||
@ -316,9 +346,10 @@ namespace DCFApixels.DragonECS
|
|||||||
Tags = 1 << 4,
|
Tags = 1 << 4,
|
||||||
MetaID = 1 << 5,
|
MetaID = 1 << 5,
|
||||||
TypeCode = 1 << 6,
|
TypeCode = 1 << 6,
|
||||||
//MemberType = 1 << 7,
|
ReflectionInfo = 1 << 7,
|
||||||
|
//MemberType = 1 << 8,
|
||||||
|
|
||||||
All = Name | Group | Color | Description | Tags | TypeCode | MetaID //| MemberType
|
All = Name | Group | Color | Description | Tags | TypeCode | MetaID | ReflectionInfo //| MemberType
|
||||||
}
|
}
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
@ -548,6 +579,15 @@ namespace DCFApixels.DragonECS
|
|||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
|
#region GetReflectionInfo
|
||||||
|
public static void GetReflectionInfo(TypeMeta meta)
|
||||||
|
{
|
||||||
|
var interfaces = meta.Type.GetInterfaces();
|
||||||
|
meta._isComponent = Array.IndexOf(interfaces, typeof(IEcsComponentMember)) >= 0;
|
||||||
|
meta._isProcess = Array.IndexOf(interfaces, typeof(IEcsProcess)) >= 0;
|
||||||
|
}
|
||||||
|
#endregion
|
||||||
}
|
}
|
||||||
#endregion
|
#endregion
|
||||||
}
|
}
|
||||||
|
@ -14,6 +14,7 @@ using static DCFApixels.DragonECS.EcsConsts;
|
|||||||
namespace DCFApixels.DragonECS
|
namespace DCFApixels.DragonECS
|
||||||
{
|
{
|
||||||
public interface IEcsMember { }
|
public interface IEcsMember { }
|
||||||
|
public interface IEcsComponentMember : IEcsMember { }
|
||||||
public interface INamedMember
|
public interface INamedMember
|
||||||
{
|
{
|
||||||
string Name { get; }
|
string Name { get; }
|
||||||
|
Loading…
Reference in New Issue
Block a user