rename EcsSystems to EcsPipeline

This commit is contained in:
Mikhail 2023-03-30 05:33:55 +08:00
parent 1757121e6d
commit 1ba431c0b4
2 changed files with 8 additions and 10 deletions

View File

@ -6,16 +6,14 @@ namespace DCFApixels.DragonECS
{
internal class AutoInjectionMap
{
private readonly EcsSystems _source;
private readonly EcsPipeline _source;
private Dictionary<Type, List<FiledRecord>> _systems;
public AutoInjectionMap(EcsSystems source)
public AutoInjectionMap(EcsPipeline source)
{
_source = source;
var allsystems = _source.AllSystems;
_systems = new Dictionary<Type, List<FiledRecord>>();
foreach (var system in allsystems)
{
@ -68,24 +66,24 @@ namespace DCFApixels.DragonECS
[DebugHide, DebugColor(DebugColor.Gray)]
public class AutoInjectSystem : IEcsPreInitSystem, IEcsPreInject
{
private EcsSystems _systems;
private EcsPipeline _pipeline;
private List<object> _injectQueue = new List<object>();
private AutoInjectionMap _autoInjectionMap;
public void PreInject(object obj)
{
if(_systems == null)
if(_pipeline == null)
{
_injectQueue.Add(obj);
return;
}
AutoInject(obj);
}
public void PreInit(EcsSystems systems)
public void PreInit(EcsPipeline pipeline)
{
_systems = systems;
_autoInjectionMap = new AutoInjectionMap(_systems);
_pipeline = pipeline;
_autoInjectionMap = new AutoInjectionMap(_pipeline);
foreach (var obj in _injectQueue)
{

View File

@ -2,7 +2,7 @@
{
public static class AutoInjectSystemExtensions
{
public static EcsSystems.Builder AutoInject(this EcsSystems.Builder self)
public static EcsPipeline.Builder AutoInject(this EcsPipeline.Builder self)
{
self.Add(new AutoInjectSystem());
return self;