mirror of
https://github.com/DCFApixels/DragonECS.git
synced 2025-09-17 17:34:36 +08:00
update docs
This commit is contained in:
parent
29e9d9edbb
commit
818dc4b926
@ -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>, 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>, 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>, 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>, IEcsDestroy
|
||||
{
|
||||
#if DEBUG && !DISABLE_DEBUG
|
||||
|
@ -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
|
||||
{
|
||||
|
@ -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 =
|
||||
|
@ -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; }
|
||||
|
@ -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<string> 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))]
|
||||
/// <summary> Expanding meta information over Type. </summary>
|
||||
public sealed class TypeMeta : ITypeMeta
|
||||
{
|
||||
private static readonly Dictionary<Type, TypeMeta> _metaCache = new Dictionary<Type, TypeMeta>();
|
||||
@ -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<Type> _;
|
||||
|
||||
#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,
|
||||
}
|
||||
}
|
@ -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;
|
||||
|
@ -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)]
|
||||
|
@ -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<T> : 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();
|
||||
|
@ -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.")]
|
||||
/// <summary>Pool for IEcsComponent components</summary>
|
||||
public sealed class EcsPool<T> : IEcsPoolImplementation<T>, IEcsStructPool<T>, IEnumerable<T> //IEnumerable<T> - IntelliSense hack
|
||||
where T : struct, IEcsComponent
|
||||
|
@ -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.")]
|
||||
/// <summary>Pool for IEcsTagComponent components</summary>
|
||||
public sealed class EcsTagPool<T> : IEcsPoolImplementation<T>, IEcsStructPool<T>, IEnumerable<T> //IEnumerable<T> - IntelliSense hack
|
||||
where T : struct, IEcsTagComponent
|
||||
|
Loading…
Reference in New Issue
Block a user