update docs

This commit is contained in:
Mikhail 2024-06-11 02:30:00 +08:00
parent 29e9d9edbb
commit 818dc4b926
10 changed files with 90 additions and 21 deletions

View File

@ -6,28 +6,32 @@ namespace DCFApixels.DragonECS
{ {
[MetaName(nameof(PreInit))] [MetaName(nameof(PreInit))]
[MetaColor(MetaColor.DragonRose)] [MetaColor(MetaColor.DragonRose)]
[MetaGroup(EcsConsts.FRAMEWORK_NAME)] [MetaGroup(EcsConsts.FRAMEWORK_GROUP)]
[MetaDescription(EcsConsts.AUTHOR, "...")]
public interface IEcsPreInit : IEcsProcess public interface IEcsPreInit : IEcsProcess
{ {
void PreInit(); void PreInit();
} }
[MetaName(nameof(Init))] [MetaName(nameof(Init))]
[MetaColor(MetaColor.DragonRose)] [MetaColor(MetaColor.DragonRose)]
[MetaGroup(EcsConsts.FRAMEWORK_NAME)] [MetaGroup(EcsConsts.FRAMEWORK_GROUP)]
[MetaDescription(EcsConsts.AUTHOR, "...")]
public interface IEcsInit : IEcsProcess public interface IEcsInit : IEcsProcess
{ {
void Init(); void Init();
} }
[MetaName(nameof(Run))] [MetaName(nameof(Run))]
[MetaColor(MetaColor.DragonRose)] [MetaColor(MetaColor.DragonRose)]
[MetaGroup(EcsConsts.FRAMEWORK_NAME)] [MetaGroup(EcsConsts.FRAMEWORK_GROUP)]
[MetaDescription(EcsConsts.AUTHOR, "...")]
public interface IEcsRun : IEcsProcess public interface IEcsRun : IEcsProcess
{ {
void Run(); void Run();
} }
[MetaName(nameof(Destroy))] [MetaName(nameof(Destroy))]
[MetaColor(MetaColor.DragonRose)] [MetaColor(MetaColor.DragonRose)]
[MetaGroup(EcsConsts.FRAMEWORK_NAME)] [MetaGroup(EcsConsts.FRAMEWORK_GROUP)]
[MetaDescription(EcsConsts.AUTHOR, "...")]
public interface IEcsDestroy : IEcsProcess public interface IEcsDestroy : IEcsProcess
{ {
void Destroy(); void Destroy();
@ -42,7 +46,8 @@ namespace DCFApixels.DragonECS.Internal
[Il2CppSetOption(Option.ArrayBoundsChecks, false)] [Il2CppSetOption(Option.ArrayBoundsChecks, false)]
#endif #endif
[MetaColor(MetaColor.DragonRose)] [MetaColor(MetaColor.DragonRose)]
[MetaGroup(EcsConsts.FRAMEWORK_NAME)] [MetaGroup(EcsConsts.FRAMEWORK_GROUP)]
[MetaDescription(EcsConsts.AUTHOR, "...")]
internal sealed class EcsPreInitRunner : EcsRunner<IEcsPreInit>, IEcsPreInit internal sealed class EcsPreInitRunner : EcsRunner<IEcsPreInit>, IEcsPreInit
{ {
#if DEBUG && !DISABLE_DEBUG #if DEBUG && !DISABLE_DEBUG
@ -98,7 +103,8 @@ namespace DCFApixels.DragonECS.Internal
[Il2CppSetOption(Option.ArrayBoundsChecks, false)] [Il2CppSetOption(Option.ArrayBoundsChecks, false)]
#endif #endif
[MetaColor(MetaColor.DragonRose)] [MetaColor(MetaColor.DragonRose)]
[MetaGroup(EcsConsts.FRAMEWORK_NAME)] [MetaGroup(EcsConsts.FRAMEWORK_GROUP)]
[MetaDescription(EcsConsts.AUTHOR, "...")]
internal sealed class EcsInitRunner : EcsRunner<IEcsInit>, IEcsInit internal sealed class EcsInitRunner : EcsRunner<IEcsInit>, IEcsInit
{ {
#if DEBUG && !DISABLE_DEBUG #if DEBUG && !DISABLE_DEBUG
@ -151,7 +157,8 @@ namespace DCFApixels.DragonECS.Internal
[Il2CppSetOption(Option.ArrayBoundsChecks, false)] [Il2CppSetOption(Option.ArrayBoundsChecks, false)]
#endif #endif
[MetaColor(MetaColor.DragonRose)] [MetaColor(MetaColor.DragonRose)]
[MetaGroup(EcsConsts.FRAMEWORK_NAME)] [MetaGroup(EcsConsts.FRAMEWORK_GROUP)]
[MetaDescription(EcsConsts.AUTHOR, "...")]
internal sealed class EcsRunRunner : EcsRunner<IEcsRun>, IEcsRun internal sealed class EcsRunRunner : EcsRunner<IEcsRun>, IEcsRun
{ {
#if DEBUG && !DISABLE_DEBUG #if DEBUG && !DISABLE_DEBUG
@ -204,7 +211,8 @@ namespace DCFApixels.DragonECS.Internal
[Il2CppSetOption(Option.ArrayBoundsChecks, false)] [Il2CppSetOption(Option.ArrayBoundsChecks, false)]
#endif #endif
[MetaColor(MetaColor.DragonRose)] [MetaColor(MetaColor.DragonRose)]
[MetaGroup(EcsConsts.FRAMEWORK_NAME)] [MetaGroup(EcsConsts.FRAMEWORK_GROUP)]
[MetaDescription(EcsConsts.AUTHOR, "...")]
internal sealed class EcsDestroyRunner : EcsRunner<IEcsDestroy>, IEcsDestroy internal sealed class EcsDestroyRunner : EcsRunner<IEcsDestroy>, IEcsDestroy
{ {
#if DEBUG && !DISABLE_DEBUG #if DEBUG && !DISABLE_DEBUG

View File

@ -3,7 +3,8 @@
namespace DCFApixels.DragonECS namespace DCFApixels.DragonECS
{ {
[MetaColor(MetaColor.DragonRose)] [MetaColor(MetaColor.DragonRose)]
[MetaGroup(EcsConsts.FRAMEWORK_NAME)] [MetaGroup(EcsConsts.FRAMEWORK_GROUP, "Worlds")]
[MetaDescription(EcsConsts.AUTHOR, "...")]
[DebuggerTypeProxy(typeof(DebuggerProxy))] [DebuggerTypeProxy(typeof(DebuggerProxy))]
public sealed class EcsDefaultWorld : EcsWorld, IInjectionUnit public sealed class EcsDefaultWorld : EcsWorld, IInjectionUnit
{ {
@ -15,7 +16,8 @@ namespace DCFApixels.DragonECS
} }
} }
[MetaColor(MetaColor.DragonRose)] [MetaColor(MetaColor.DragonRose)]
[MetaGroup(EcsConsts.FRAMEWORK_NAME)] [MetaGroup(EcsConsts.FRAMEWORK_GROUP, "Worlds")]
[MetaDescription(EcsConsts.AUTHOR, "...")]
[DebuggerTypeProxy(typeof(DebuggerProxy))] [DebuggerTypeProxy(typeof(DebuggerProxy))]
public sealed class EcsEventWorld : EcsWorld, IInjectionUnit public sealed class EcsEventWorld : EcsWorld, IInjectionUnit
{ {

View File

@ -21,6 +21,13 @@
public const int MAGIC_PRIME = 314159; 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 /// defs
public const bool DISABLE_POOLS_EVENTS = public const bool DISABLE_POOLS_EVENTS =

View File

@ -20,6 +20,10 @@ namespace DCFApixels.DragonECS
public static readonly MetaDescription Empty = new MetaDescription(null, null); public static readonly MetaDescription Empty = new MetaDescription(null, null);
public readonly string Author; public readonly string Author;
public readonly string Text; public readonly string Text;
public bool IsHasAutor
{
get { return string.IsNullOrEmpty(Author) == false; }
}
public MetaDescription(string author, string text) public MetaDescription(string author, string text)
{ {
if (author == null) { author = string.Empty; } if (author == null) { author = string.Empty; }

View File

@ -1,4 +1,6 @@
using DCFApixels.DragonECS.Internal; using DCFApixels.DragonECS.Internal;
using DCFApixels.DragonECS.PoolsCore;
using DCFApixels.DragonECS.RunnersCore;
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Diagnostics; using System.Diagnostics;
@ -17,10 +19,11 @@ namespace DCFApixels.DragonECS
IReadOnlyList<string> Tags { get; } IReadOnlyList<string> Tags { get; }
} }
[MetaGroup(EcsConsts.FRAMEWORK_NAME)] [MetaGroup(EcsConsts.FRAMEWORK_GROUP)]
[MetaColor(MetaColor.DragonRose)] [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))] [DebuggerTypeProxy(typeof(DebuggerProxy))]
/// <summary> Expanding meta information over Type. </summary>
public sealed class TypeMeta : ITypeMeta public sealed class TypeMeta : ITypeMeta
{ {
private static readonly Dictionary<Type, TypeMeta> _metaCache = new Dictionary<Type, TypeMeta>(); private static readonly Dictionary<Type, TypeMeta> _metaCache = new Dictionary<Type, TypeMeta>();
@ -40,6 +43,8 @@ namespace DCFApixels.DragonECS
private InitFlag _initFlags = InitFlag.None; private InitFlag _initFlags = InitFlag.None;
private EcsMemberType _memberType;
#region Constructors #region Constructors
public static TypeMeta Get(Type type) public static TypeMeta Get(Type type)
{ {
@ -53,6 +58,17 @@ namespace DCFApixels.DragonECS
private TypeMeta(Type type) private TypeMeta(Type type)
{ {
_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 #endregion
@ -63,6 +79,13 @@ namespace DCFApixels.DragonECS
} }
#endregion #endregion
#region EcsMemberType
public EcsMemberType EcsMemberType
{
get { return _memberType; }
}
#endregion
#region Name #region Name
private void InitName() private void InitName()
{ {
@ -217,8 +240,9 @@ namespace DCFApixels.DragonECS
Description = 1 << 3, Description = 1 << 3,
Tags = 1 << 4, Tags = 1 << 4,
TypeCode = 1 << 5, TypeCode = 1 << 5,
MemberType = 1 << 6,
All = Name | Group | Color | Description | Tags | TypeCode All = Name | Group | Color | Description | Tags | TypeCode | MemberType
} }
#endregion #endregion
@ -270,6 +294,15 @@ namespace DCFApixels.DragonECS
{ {
private const int GENERIC_NAME_DEPTH = 3; private const int GENERIC_NAME_DEPTH = 3;
//private static HashSet<Type> _;
#region GetMemberType
public static EcsMemberType GetMemberType(Type type)
{
throw new NotImplementedException();
}
#endregion
#region GetMetaName #region GetMetaName
public static (string, bool) GetMetaName(Type type) public static (string, bool) GetMetaName(Type type)
{ {
@ -330,4 +363,13 @@ namespace DCFApixels.DragonECS
} }
#endregion #endregion
} }
public enum EcsMemberType : byte
{
Undefined = 0,
Component = 1,
System = 2,
Other = 3,
}
} }

View File

@ -497,7 +497,8 @@ namespace DCFApixels.DragonECS
#region SystemsLayerMarkerSystem #region SystemsLayerMarkerSystem
[MetaTags(MetaTags.HIDDEN)] [MetaTags(MetaTags.HIDDEN)]
[MetaColor(MetaColor.Black)] [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 class SystemsLayerMarkerSystem : IEcsProcess
{ {
public readonly string name; public readonly string name;

View File

@ -30,7 +30,8 @@ namespace DCFApixels.DragonECS
} }
[MetaColor(MetaColor.DragonRose)] [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 #if ENABLE_IL2CPP
[Il2CppSetOption(Option.NullChecks, false)] [Il2CppSetOption(Option.NullChecks, false)]
[Il2CppSetOption(Option.ArrayBoundsChecks, false)] [Il2CppSetOption(Option.ArrayBoundsChecks, false)]

View File

@ -5,15 +5,17 @@ using System.Collections.Generic;
namespace DCFApixels.DragonECS namespace DCFApixels.DragonECS
{ {
[MetaName(nameof(Inject))] [MetaName(nameof(Inject))]
[MetaColor(MetaColor.Orange)] [MetaColor(MetaColor.DragonRose)]
[MetaGroup(EcsConsts.FRAMEWORK_NAME)] [MetaGroup(EcsConsts.FRAMEWORK_GROUP, EcsConsts.DI_GROUP)]
[MetaDescription(EcsConsts.AUTHOR, "...")]
public interface IEcsInject<T> : IEcsProcess public interface IEcsInject<T> : IEcsProcess
{ {
void Inject(T obj); void Inject(T obj);
} }
[MetaName(nameof(OnInitInjectionComplete))] [MetaName(nameof(OnInitInjectionComplete))]
[MetaColor(MetaColor.Orange)] [MetaColor(MetaColor.DragonRose)]
[MetaGroup(EcsConsts.FRAMEWORK_NAME)] [MetaGroup(EcsConsts.FRAMEWORK_GROUP, EcsConsts.DI_GROUP)]
[MetaDescription(EcsConsts.AUTHOR, "...")]
public interface IOnInitInjectionComplete : IEcsProcess public interface IOnInitInjectionComplete : IEcsProcess
{ {
void OnInitInjectionComplete(); void OnInitInjectionComplete();

View File

@ -17,7 +17,8 @@ namespace DCFApixels.DragonECS
[Il2CppSetOption (Option.NullChecks, false)] [Il2CppSetOption (Option.NullChecks, false)]
#endif #endif
[MetaColor(MetaColor.DragonRose)] [MetaColor(MetaColor.DragonRose)]
[MetaGroup(EcsConsts.FRAMEWORK_NAME)] [MetaGroup(EcsConsts.FRAMEWORK_GROUP, EcsConsts.POOLS_GROUP)]
[MetaDescription(EcsConsts.AUTHOR, "Pool for IEcsComponent components.")]
/// <summary>Pool for IEcsComponent components</summary> /// <summary>Pool for IEcsComponent components</summary>
public sealed class EcsPool<T> : IEcsPoolImplementation<T>, IEcsStructPool<T>, IEnumerable<T> //IEnumerable<T> - IntelliSense hack public sealed class EcsPool<T> : IEcsPoolImplementation<T>, IEcsStructPool<T>, IEnumerable<T> //IEnumerable<T> - IntelliSense hack
where T : struct, IEcsComponent where T : struct, IEcsComponent

View File

@ -17,7 +17,8 @@ namespace DCFApixels.DragonECS
[Il2CppSetOption (Option.NullChecks, false)] [Il2CppSetOption (Option.NullChecks, false)]
#endif #endif
[MetaColor(MetaColor.DragonRose)] [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.")]
/// <summary>Pool for IEcsTagComponent components</summary> /// <summary>Pool for IEcsTagComponent components</summary>
public sealed class EcsTagPool<T> : IEcsPoolImplementation<T>, IEcsStructPool<T>, IEnumerable<T> //IEnumerable<T> - IntelliSense hack public sealed class EcsTagPool<T> : IEcsPoolImplementation<T>, IEcsStructPool<T>, IEnumerable<T> //IEnumerable<T> - IntelliSense hack
where T : struct, IEcsTagComponent where T : struct, IEcsTagComponent