diff --git a/src/Builtin/BaseProcesses.cs b/src/Builtin/BaseProcesses.cs index b500448..9df4e6f 100644 --- a/src/Builtin/BaseProcesses.cs +++ b/src/Builtin/BaseProcesses.cs @@ -6,28 +6,32 @@ namespace DCFApixels.DragonECS { [MetaName(nameof(PreInit))] [MetaColor(MetaColor.DragonRose)] - [MetaGroup(EcsConsts.FRAMEWORK_NAME)] + [MetaGroup(EcsConsts.FRAMEWORK_GROUP)] + [MetaDescription(EcsConsts.AUTHOR, "...")] public interface IEcsPreInit : IEcsProcess { void PreInit(); } [MetaName(nameof(Init))] [MetaColor(MetaColor.DragonRose)] - [MetaGroup(EcsConsts.FRAMEWORK_NAME)] + [MetaGroup(EcsConsts.FRAMEWORK_GROUP)] + [MetaDescription(EcsConsts.AUTHOR, "...")] public interface IEcsInit : IEcsProcess { void Init(); } [MetaName(nameof(Run))] [MetaColor(MetaColor.DragonRose)] - [MetaGroup(EcsConsts.FRAMEWORK_NAME)] + [MetaGroup(EcsConsts.FRAMEWORK_GROUP)] + [MetaDescription(EcsConsts.AUTHOR, "...")] public interface IEcsRun : IEcsProcess { void Run(); } [MetaName(nameof(Destroy))] [MetaColor(MetaColor.DragonRose)] - [MetaGroup(EcsConsts.FRAMEWORK_NAME)] + [MetaGroup(EcsConsts.FRAMEWORK_GROUP)] + [MetaDescription(EcsConsts.AUTHOR, "...")] public interface IEcsDestroy : IEcsProcess { void Destroy(); @@ -42,7 +46,8 @@ namespace DCFApixels.DragonECS.Internal [Il2CppSetOption(Option.ArrayBoundsChecks, false)] #endif [MetaColor(MetaColor.DragonRose)] - [MetaGroup(EcsConsts.FRAMEWORK_NAME)] + [MetaGroup(EcsConsts.FRAMEWORK_GROUP)] + [MetaDescription(EcsConsts.AUTHOR, "...")] internal sealed class EcsPreInitRunner : EcsRunner, IEcsPreInit { #if DEBUG && !DISABLE_DEBUG @@ -98,7 +103,8 @@ namespace DCFApixels.DragonECS.Internal [Il2CppSetOption(Option.ArrayBoundsChecks, false)] #endif [MetaColor(MetaColor.DragonRose)] - [MetaGroup(EcsConsts.FRAMEWORK_NAME)] + [MetaGroup(EcsConsts.FRAMEWORK_GROUP)] + [MetaDescription(EcsConsts.AUTHOR, "...")] internal sealed class EcsInitRunner : EcsRunner, IEcsInit { #if DEBUG && !DISABLE_DEBUG @@ -151,7 +157,8 @@ namespace DCFApixels.DragonECS.Internal [Il2CppSetOption(Option.ArrayBoundsChecks, false)] #endif [MetaColor(MetaColor.DragonRose)] - [MetaGroup(EcsConsts.FRAMEWORK_NAME)] + [MetaGroup(EcsConsts.FRAMEWORK_GROUP)] + [MetaDescription(EcsConsts.AUTHOR, "...")] internal sealed class EcsRunRunner : EcsRunner, IEcsRun { #if DEBUG && !DISABLE_DEBUG @@ -204,7 +211,8 @@ namespace DCFApixels.DragonECS.Internal [Il2CppSetOption(Option.ArrayBoundsChecks, false)] #endif [MetaColor(MetaColor.DragonRose)] - [MetaGroup(EcsConsts.FRAMEWORK_NAME)] + [MetaGroup(EcsConsts.FRAMEWORK_GROUP)] + [MetaDescription(EcsConsts.AUTHOR, "...")] internal sealed class EcsDestroyRunner : EcsRunner, IEcsDestroy { #if DEBUG && !DISABLE_DEBUG diff --git a/src/Builtin/Worlds.cs b/src/Builtin/Worlds.cs index a511ccd..645aac8 100644 --- a/src/Builtin/Worlds.cs +++ b/src/Builtin/Worlds.cs @@ -3,7 +3,8 @@ namespace DCFApixels.DragonECS { [MetaColor(MetaColor.DragonRose)] - [MetaGroup(EcsConsts.FRAMEWORK_NAME)] + [MetaGroup(EcsConsts.FRAMEWORK_GROUP, "Worlds")] + [MetaDescription(EcsConsts.AUTHOR, "...")] [DebuggerTypeProxy(typeof(DebuggerProxy))] public sealed class EcsDefaultWorld : EcsWorld, IInjectionUnit { @@ -15,7 +16,8 @@ namespace DCFApixels.DragonECS } } [MetaColor(MetaColor.DragonRose)] - [MetaGroup(EcsConsts.FRAMEWORK_NAME)] + [MetaGroup(EcsConsts.FRAMEWORK_GROUP, "Worlds")] + [MetaDescription(EcsConsts.AUTHOR, "...")] [DebuggerTypeProxy(typeof(DebuggerProxy))] public sealed class EcsEventWorld : EcsWorld, IInjectionUnit { diff --git a/src/Consts.cs b/src/Consts.cs index 9880b9c..7ec94d3 100644 --- a/src/Consts.cs +++ b/src/Consts.cs @@ -21,6 +21,13 @@ public const int MAGIC_PRIME = 314159; + /// meta subgroups + + public const string WORLDS_GROUP = "Worlds"; + public const string DI_GROUP = "DI"; + public const string POOLS_GROUP = "Pools"; + public const string FRAMEWORK_GROUP = "_" + FRAMEWORK_NAME; + /// defs public const bool DISABLE_POOLS_EVENTS = diff --git a/src/Debug/MetaAttributes/MetaDescriptionAttribute.cs b/src/Debug/MetaAttributes/MetaDescriptionAttribute.cs index 2973aa4..2842882 100644 --- a/src/Debug/MetaAttributes/MetaDescriptionAttribute.cs +++ b/src/Debug/MetaAttributes/MetaDescriptionAttribute.cs @@ -20,6 +20,10 @@ namespace DCFApixels.DragonECS public static readonly MetaDescription Empty = new MetaDescription(null, null); public readonly string Author; public readonly string Text; + public bool IsHasAutor + { + get { return string.IsNullOrEmpty(Author) == false; } + } public MetaDescription(string author, string text) { if (author == null) { author = string.Empty; } diff --git a/src/Debug/TypeMeta.cs b/src/Debug/TypeMeta.cs index ac3c5c3..bf8ed33 100644 --- a/src/Debug/TypeMeta.cs +++ b/src/Debug/TypeMeta.cs @@ -1,4 +1,6 @@ using DCFApixels.DragonECS.Internal; +using DCFApixels.DragonECS.PoolsCore; +using DCFApixels.DragonECS.RunnersCore; using System; using System.Collections.Generic; using System.Diagnostics; @@ -17,10 +19,11 @@ namespace DCFApixels.DragonECS IReadOnlyList Tags { get; } } - [MetaGroup(EcsConsts.FRAMEWORK_NAME)] + [MetaGroup(EcsConsts.FRAMEWORK_GROUP)] [MetaColor(MetaColor.DragonRose)] - [MetaDescription(EcsConsts.AUTHOR, "Basic class of the framework, intended for extending meta information of types, for customization of type display in the editor.")] + [MetaDescription(EcsConsts.AUTHOR, "Intended for extending meta information of types, for customization of type display in the editor. You can get it by using the object.GetMeta() or Type.ToMeta() extension method.")] [DebuggerTypeProxy(typeof(DebuggerProxy))] + /// Expanding meta information over Type. public sealed class TypeMeta : ITypeMeta { private static readonly Dictionary _metaCache = new Dictionary(); @@ -40,6 +43,8 @@ namespace DCFApixels.DragonECS private InitFlag _initFlags = InitFlag.None; + private EcsMemberType _memberType; + #region Constructors public static TypeMeta Get(Type type) { @@ -53,6 +58,17 @@ namespace DCFApixels.DragonECS private TypeMeta(Type type) { _type = type; + + Type runnerType = typeof(EcsRunner<>); + Type processMember = typeof(IEcsProcess); + + if (type.IsInterface == false && processMember.IsAssignableFrom(type) && runnerType.IsAssignableFrom(type) == false) + { + _memberType = EcsMemberType.System; + return; + } + + _memberType = EcsMemberType.Other; } #endregion @@ -63,6 +79,13 @@ namespace DCFApixels.DragonECS } #endregion + #region EcsMemberType + public EcsMemberType EcsMemberType + { + get { return _memberType; } + } + #endregion + #region Name private void InitName() { @@ -217,8 +240,9 @@ namespace DCFApixels.DragonECS Description = 1 << 3, Tags = 1 << 4, TypeCode = 1 << 5, + MemberType = 1 << 6, - All = Name | Group | Color | Description | Tags | TypeCode + All = Name | Group | Color | Description | Tags | TypeCode | MemberType } #endregion @@ -270,6 +294,15 @@ namespace DCFApixels.DragonECS { private const int GENERIC_NAME_DEPTH = 3; + //private static HashSet _; + + #region GetMemberType + public static EcsMemberType GetMemberType(Type type) + { + throw new NotImplementedException(); + } + #endregion + #region GetMetaName public static (string, bool) GetMetaName(Type type) { @@ -330,4 +363,13 @@ namespace DCFApixels.DragonECS } #endregion } + + public enum EcsMemberType : byte + { + Undefined = 0, + + Component = 1, + System = 2, + Other = 3, + } } \ No newline at end of file diff --git a/src/EcsPipeline.cs b/src/EcsPipeline.cs index 91e0068..0e4a969 100644 --- a/src/EcsPipeline.cs +++ b/src/EcsPipeline.cs @@ -497,7 +497,8 @@ namespace DCFApixels.DragonECS #region SystemsLayerMarkerSystem [MetaTags(MetaTags.HIDDEN)] [MetaColor(MetaColor.Black)] - [MetaGroup(EcsConsts.FRAMEWORK_NAME)] + [MetaGroup(EcsConsts.FRAMEWORK_GROUP)] + [MetaDescription(EcsConsts.AUTHOR, "An auxiliary type of system for dividing a pipeline into layers. This system is automatically added to the EcsPipeline.")] public class SystemsLayerMarkerSystem : IEcsProcess { public readonly string name; diff --git a/src/EcsWorld.cs b/src/EcsWorld.cs index cbc3d27..89328dd 100644 --- a/src/EcsWorld.cs +++ b/src/EcsWorld.cs @@ -30,7 +30,8 @@ namespace DCFApixels.DragonECS } [MetaColor(MetaColor.DragonRose)] - [MetaGroup(EcsConsts.FRAMEWORK_NAME)] + [MetaGroup(EcsConsts.FRAMEWORK_GROUP, EcsConsts.WORLDS_GROUP)] + [MetaDescription(EcsConsts.AUTHOR, "It is a container for entities and components.")] #if ENABLE_IL2CPP [Il2CppSetOption(Option.NullChecks, false)] [Il2CppSetOption(Option.ArrayBoundsChecks, false)] diff --git a/src/Injections/Injector.cs b/src/Injections/Injector.cs index eb13fad..9aa05a6 100644 --- a/src/Injections/Injector.cs +++ b/src/Injections/Injector.cs @@ -5,15 +5,17 @@ using System.Collections.Generic; namespace DCFApixels.DragonECS { [MetaName(nameof(Inject))] - [MetaColor(MetaColor.Orange)] - [MetaGroup(EcsConsts.FRAMEWORK_NAME)] + [MetaColor(MetaColor.DragonRose)] + [MetaGroup(EcsConsts.FRAMEWORK_GROUP, EcsConsts.DI_GROUP)] + [MetaDescription(EcsConsts.AUTHOR, "...")] public interface IEcsInject : IEcsProcess { void Inject(T obj); } [MetaName(nameof(OnInitInjectionComplete))] - [MetaColor(MetaColor.Orange)] - [MetaGroup(EcsConsts.FRAMEWORK_NAME)] + [MetaColor(MetaColor.DragonRose)] + [MetaGroup(EcsConsts.FRAMEWORK_GROUP, EcsConsts.DI_GROUP)] + [MetaDescription(EcsConsts.AUTHOR, "...")] public interface IOnInitInjectionComplete : IEcsProcess { void OnInitInjectionComplete(); diff --git a/src/Pools/EcsPool.cs b/src/Pools/EcsPool.cs index 766cc24..3c4d470 100644 --- a/src/Pools/EcsPool.cs +++ b/src/Pools/EcsPool.cs @@ -17,7 +17,8 @@ namespace DCFApixels.DragonECS [Il2CppSetOption (Option.NullChecks, false)] #endif [MetaColor(MetaColor.DragonRose)] - [MetaGroup(EcsConsts.FRAMEWORK_NAME)] + [MetaGroup(EcsConsts.FRAMEWORK_GROUP, EcsConsts.POOLS_GROUP)] + [MetaDescription(EcsConsts.AUTHOR, "Pool for IEcsComponent components.")] /// Pool for IEcsComponent components public sealed class EcsPool : IEcsPoolImplementation, IEcsStructPool, IEnumerable //IEnumerable - IntelliSense hack where T : struct, IEcsComponent diff --git a/src/Pools/EcsTagPool.cs b/src/Pools/EcsTagPool.cs index 3ce5b5b..4c07489 100644 --- a/src/Pools/EcsTagPool.cs +++ b/src/Pools/EcsTagPool.cs @@ -17,7 +17,8 @@ namespace DCFApixels.DragonECS [Il2CppSetOption (Option.NullChecks, false)] #endif [MetaColor(MetaColor.DragonRose)] - [MetaGroup(EcsConsts.FRAMEWORK_NAME)] + [MetaGroup(EcsConsts.FRAMEWORK_GROUP, EcsConsts.POOLS_GROUP)] + [MetaDescription(EcsConsts.AUTHOR, "Pool for IEcsTagComponent components. EcsTagPool is optimized for storing tag components or components without data.")] /// Pool for IEcsTagComponent components public sealed class EcsTagPool : IEcsPoolImplementation, IEcsStructPool, IEnumerable //IEnumerable - IntelliSense hack where T : struct, IEcsTagComponent