浏览代码

Change Terminology

/refactor-manager-dependencies
Thomas ICHÉ 3 年前
当前提交
3b04f20b
共有 1 个文件被更改,包括 17 次插入6 次删除
  1. 23
      Runtime/Managers/Manager.cs

23
Runtime/Managers/Manager.cs


{
foreach (var type in exclusionList)
{
if(dg.TryRemove(type, exclusionList))
if(dg.TryExclude(type, exclusionList))
{
if (GameplayIngredientsSettings.currentSettings.verboseCalls)
Debug.LogWarning($"Manager : Excluded {type} from manager creation");

}
}
// Try remove a type by its name, if it's not a dependency of another node
public bool TryRemove(string type, string[] exclusionList)
// Try exclude a type by its name, if it's not a dependency of another node
public bool TryExclude(string type, string[] exclusionList)
// If type is not excluded and our type is a dependency, then we can't remove the node
if (!exclusionList.Contains(node.target.Name) && IsDependentOn(node.target, n.target))
if (node == n)
continue;
// If type our type is a dependency or is already excluded, then we don't remove the node
if (IsDependentOn(node.target, n.target) || exclusionList.Contains(node.target.Name))
nodes.Remove(n);
n.excluded = true;
return true;
}

foreach(var node in nodes)
{
if (node.excluded)
continue;
if (!d.ContainsKey(node.target))
d.Add(node.target, 0);
else

{
if (dep.excluded)
continue;
if (!d.ContainsKey(dep.target))
d.Add(dep.target, 0);
else

{
public List<DependencyNode> dependencies;
public readonly Type target;
public bool excluded;
this.excluded = false;
}
public override string ToString()

正在加载...
取消
保存