mirror of
https://github.com/DCFApixels/DragonECS.git
synced 2025-11-13 09:05:54 +08:00
add namespace for runners core
This commit is contained in:
parent
54b88a3a98
commit
ed30d58614
@ -1,6 +1,7 @@
|
|||||||
namespace DCFApixels.DragonECS
|
using DCFApixels.DragonECS.RunnersCore;
|
||||||
{
|
|
||||||
|
|
||||||
|
namespace DCFApixels.DragonECS
|
||||||
|
{
|
||||||
public interface IEcsPreInitSystem : IEcsSystem
|
public interface IEcsPreInitSystem : IEcsSystem
|
||||||
{
|
{
|
||||||
public void PreInit(EcsPipeline pipeline);
|
public void PreInit(EcsPipeline pipeline);
|
||||||
|
|||||||
@ -1,4 +1,5 @@
|
|||||||
using DCFApixels.DragonECS.Internal;
|
using DCFApixels.DragonECS.Internal;
|
||||||
|
using DCFApixels.DragonECS.RunnersCore;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
|
|
||||||
namespace DCFApixels.DragonECS
|
namespace DCFApixels.DragonECS
|
||||||
|
|||||||
@ -1,4 +1,6 @@
|
|||||||
namespace DCFApixels.DragonECS
|
using DCFApixels.DragonECS.RunnersCore;
|
||||||
|
|
||||||
|
namespace DCFApixels.DragonECS
|
||||||
{
|
{
|
||||||
public interface IEcsComponentAdd : IEcsSystem
|
public interface IEcsComponentAdd : IEcsSystem
|
||||||
{
|
{
|
||||||
|
|||||||
@ -1,4 +1,5 @@
|
|||||||
using System;
|
using DCFApixels.DragonECS.RunnersCore;
|
||||||
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Collections.ObjectModel;
|
using System.Collections.ObjectModel;
|
||||||
using System.Runtime.CompilerServices;
|
using System.Runtime.CompilerServices;
|
||||||
|
|||||||
@ -1,4 +1,5 @@
|
|||||||
using System;
|
using DCFApixels.DragonECS.RunnersCore;
|
||||||
|
using System;
|
||||||
using System.Collections;
|
using System.Collections;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Collections.ObjectModel;
|
using System.Collections.ObjectModel;
|
||||||
@ -22,6 +23,9 @@ namespace DCFApixels.DragonECS
|
|||||||
}
|
}
|
||||||
|
|
||||||
public interface IEcsSystem { }
|
public interface IEcsSystem { }
|
||||||
|
|
||||||
|
namespace RunnersCore
|
||||||
|
{
|
||||||
public interface IEcsRunner
|
public interface IEcsRunner
|
||||||
{
|
{
|
||||||
public EcsPipeline Source { get; }
|
public EcsPipeline Source { get; }
|
||||||
@ -124,11 +128,6 @@ namespace DCFApixels.DragonECS
|
|||||||
EcsRunner<TInterface>.Register(runnerType);
|
EcsRunner<TInterface>.Register(runnerType);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public static class EcsRunner
|
|
||||||
{
|
|
||||||
public static void Destroy(object runner) => ((IEcsRunner)runner).Destroy();
|
|
||||||
}
|
|
||||||
public abstract class EcsRunner<TInterface> : IEcsSystem, IEcsRunner
|
public abstract class EcsRunner<TInterface> : IEcsSystem, IEcsRunner
|
||||||
where TInterface : IEcsSystem
|
where TInterface : IEcsSystem
|
||||||
{
|
{
|
||||||
@ -260,8 +259,12 @@ namespace DCFApixels.DragonECS
|
|||||||
protected virtual void OnSetup() { }
|
protected virtual void OnSetup() { }
|
||||||
protected virtual void OnDestroy() { }
|
protected virtual void OnDestroy() { }
|
||||||
}
|
}
|
||||||
|
}
|
||||||
#region Extensions
|
#region Extensions
|
||||||
|
public static class EcsRunner
|
||||||
|
{
|
||||||
|
public static void Destroy(IEcsSystem runner) => ((IEcsRunner)runner).Destroy();
|
||||||
|
}
|
||||||
public static class IEcsSystemExtensions
|
public static class IEcsSystemExtensions
|
||||||
{
|
{
|
||||||
public static bool IsRunner(this IEcsSystem self)
|
public static bool IsRunner(this IEcsSystem self)
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user