mirror of
https://github.com/DCFApixels/DragonECS.git
synced 2025-09-18 18:14:37 +08:00
rename IInjectionUnit.OnInitInjectionBranch(InjectionBranchIniter initer) to IInjectionUnit.InitInjectionNode(InjectionNodes nodes)
This commit is contained in:
parent
eb0f996372
commit
693a0615e0
@ -11,10 +11,7 @@ namespace DCFApixels.DragonECS
|
|||||||
{
|
{
|
||||||
public EcsDefaultWorld(EcsWorldConfig config, short worldID = -1) : base(config, worldID) { }
|
public EcsDefaultWorld(EcsWorldConfig config, short worldID = -1) : base(config, worldID) { }
|
||||||
public EcsDefaultWorld(IConfigContainer configs = null, short worldID = -1) : base(configs, worldID) { }
|
public EcsDefaultWorld(IConfigContainer configs = null, short worldID = -1) : base(configs, worldID) { }
|
||||||
void IInjectionUnit.OnInitInjectionBranch(InjectionBranchIniter initer)
|
void IInjectionUnit.InitInjectionNode(InjectionNodes nodes) { nodes.AddNode(this); }
|
||||||
{
|
|
||||||
initer.AddNode<EcsDefaultWorld>();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
/// <summary> EcsWrold for store event entities. </summary>
|
/// <summary> EcsWrold for store event entities. </summary>
|
||||||
[MetaColor(MetaColor.DragonRose)]
|
[MetaColor(MetaColor.DragonRose)]
|
||||||
@ -25,9 +22,6 @@ namespace DCFApixels.DragonECS
|
|||||||
{
|
{
|
||||||
public EcsEventWorld(EcsWorldConfig config, short worldID = -1) : base(config, worldID) { }
|
public EcsEventWorld(EcsWorldConfig config, short worldID = -1) : base(config, worldID) { }
|
||||||
public EcsEventWorld(IConfigContainer configs = null, short worldID = -1) : base(configs, worldID) { }
|
public EcsEventWorld(IConfigContainer configs = null, short worldID = -1) : base(configs, worldID) { }
|
||||||
void IInjectionUnit.OnInitInjectionBranch(InjectionBranchIniter initer)
|
void IInjectionUnit.InitInjectionNode(InjectionNodes nodes) { nodes.AddNode(this); }
|
||||||
{
|
|
||||||
initer.AddNode<EcsDefaultWorld>();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -234,7 +234,7 @@ namespace DCFApixels.DragonECS
|
|||||||
}
|
}
|
||||||
public abstract class EcsModule<T> : IInjectionUnit
|
public abstract class EcsModule<T> : IInjectionUnit
|
||||||
{
|
{
|
||||||
void IInjectionUnit.OnInitInjectionBranch(InjectionBranchIniter initer) { initer.AddNode<T>(); }
|
void IInjectionUnit.InitInjectionNode(InjectionNodes nodes) { nodes.AddNode<T>(); }
|
||||||
public EcsModule() { if (GetType() != typeof(T)) { Throw.UndefinedException(); } }
|
public EcsModule() { if (GetType() != typeof(T)) { Throw.UndefinedException(); } }
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -41,7 +41,7 @@ namespace DCFApixels.DragonECS
|
|||||||
bool hasNode = _nodes.ContainsKey(type);
|
bool hasNode = _nodes.ContainsKey(type);
|
||||||
if (hasNode == false && obj is IInjectionUnit unit)
|
if (hasNode == false && obj is IInjectionUnit unit)
|
||||||
{
|
{
|
||||||
unit.OnInitInjectionBranch(new InjectionBranchIniter(this));
|
unit.InitInjectionNode(new InjectionNodes(this));
|
||||||
hasNode = _nodes.ContainsKey(type);
|
hasNode = _nodes.ContainsKey(type);
|
||||||
}
|
}
|
||||||
if (hasNode)
|
if (hasNode)
|
||||||
|
@ -25,10 +25,10 @@
|
|||||||
{
|
{
|
||||||
void InjectTo(Injector inj);
|
void InjectTo(Injector inj);
|
||||||
}
|
}
|
||||||
public readonly struct InjectionBranchIniter
|
public readonly struct InjectionNodes
|
||||||
{
|
{
|
||||||
private readonly Injector _injector;
|
private readonly Injector _injector;
|
||||||
internal InjectionBranchIniter(Injector injector)
|
internal InjectionNodes(Injector injector)
|
||||||
{
|
{
|
||||||
_injector = injector;
|
_injector = injector;
|
||||||
}
|
}
|
||||||
@ -39,6 +39,6 @@
|
|||||||
}
|
}
|
||||||
public interface IInjectionUnit
|
public interface IInjectionUnit
|
||||||
{
|
{
|
||||||
void OnInitInjectionBranch(InjectionBranchIniter initer);
|
void InitInjectionNode(InjectionNodes nodes);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user