mirror of
https://github.com/DCFApixels/DragonECS.git
synced 2025-11-12 16:45:55 +08:00
rename InjectionNodes to InjectionGraph
This commit is contained in:
parent
5591a3f5b1
commit
e6058d1016
@ -11,7 +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.InitInjectionNode(InjectionNodes nodes) { nodes.AddNode(this); }
|
void IInjectionUnit.InitInjectionNode(InjectionGraph nodes) { nodes.AddNode(this); }
|
||||||
}
|
}
|
||||||
/// <summary> EcsWrold for store event entities. </summary>
|
/// <summary> EcsWrold for store event entities. </summary>
|
||||||
[MetaColor(MetaColor.DragonRose)]
|
[MetaColor(MetaColor.DragonRose)]
|
||||||
@ -22,6 +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.InitInjectionNode(InjectionNodes nodes) { nodes.AddNode(this); }
|
void IInjectionUnit.InitInjectionNode(InjectionGraph nodes) { nodes.AddNode(this); }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -235,7 +235,7 @@ namespace DCFApixels.DragonECS
|
|||||||
}
|
}
|
||||||
public abstract class EcsModule<T> : IInjectionUnit
|
public abstract class EcsModule<T> : IInjectionUnit
|
||||||
{
|
{
|
||||||
void IInjectionUnit.InitInjectionNode(InjectionNodes nodes) { nodes.AddNode<T>(); }
|
void IInjectionUnit.InitInjectionNode(InjectionGraph nodes) { nodes.AddNode<T>(); }
|
||||||
public EcsModule() { if (GetType() != typeof(T)) { Throw.UndefinedException(); } }
|
public EcsModule() { if (GetType() != typeof(T)) { Throw.UndefinedException(); } }
|
||||||
}
|
}
|
||||||
#endregion
|
#endregion
|
||||||
|
|||||||
@ -40,7 +40,7 @@ namespace DCFApixels.DragonECS
|
|||||||
bool hasNode = _nodes.ContainsKey(objType);
|
bool hasNode = _nodes.ContainsKey(objType);
|
||||||
if (hasNode == false && obj is IInjectionUnit unit)
|
if (hasNode == false && obj is IInjectionUnit unit)
|
||||||
{
|
{
|
||||||
unit.InitInjectionNode(new InjectionNodes(this));
|
unit.InitInjectionNode(new InjectionGraph(this));
|
||||||
hasNode = _nodes.ContainsKey(objType);
|
hasNode = _nodes.ContainsKey(objType);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -25,10 +25,10 @@
|
|||||||
{
|
{
|
||||||
void InjectTo(Injector inj);
|
void InjectTo(Injector inj);
|
||||||
}
|
}
|
||||||
public readonly struct InjectionNodes
|
public readonly struct InjectionGraph
|
||||||
{
|
{
|
||||||
private readonly Injector _injector;
|
private readonly Injector _injector;
|
||||||
internal InjectionNodes(Injector injector)
|
internal InjectionGraph(Injector injector)
|
||||||
{
|
{
|
||||||
_injector = injector;
|
_injector = injector;
|
||||||
}
|
}
|
||||||
@ -39,6 +39,6 @@
|
|||||||
}
|
}
|
||||||
public interface IInjectionUnit
|
public interface IInjectionUnit
|
||||||
{
|
{
|
||||||
void InitInjectionNode(InjectionNodes graph);
|
void InitInjectionNode(InjectionGraph graph);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user