Bari.Core.Model.Loader.YamlModelLoaderBase.LoadGoal C# (CSharp) Метод

LoadGoal() приватный Метод

private LoadGoal ( string name, YamlNode value, Goal>.IDictionary loadedGoals ) : Goal
name string
value YamlDotNet.RepresentationModel.YamlNode
loadedGoals Goal>.IDictionary
Результат Goal
        private Goal LoadGoal(string name, YamlNode value, IDictionary<string, Goal> loadedGoals)
        {
            var mappingNode = value as YamlMappingNode;
            if (mappingNode != null)
            {
                var incorporates = new List<Goal>();
                foreach (var pair in parser.EnumerateNamedNodesOf(value, "incorporates"))
                {
                    string childName = pair.Key;

                    Goal g;
                    if (!loadedGoals.TryGetValue(childName, out g))
                    {
                        g = new Goal(childName);
                    }

                    incorporates.Add(g);
                }

                return new Goal(name, incorporates);
            }
            else
            {
                return new Goal(name);
            }
        }