Example #1
0
        static IEnumerable <string> ApplyChromeTransform(ModData modData, YamlFileSet files, UpdateRule.ChromeNodeTransform transform)
        {
            if (transform == null)
            {
                yield break;
            }

            foreach (var file in files)
            {
                foreach (var node in file.Item3)
                {
                    if (node.Key != null)
                    {
                        foreach (var manualStep in ApplyChromeTransformInner(modData, node, transform))
                        {
                            yield return(manualStep);
                        }
                    }
                }
            }
        }
Example #2
0
        static IEnumerable <string> ApplyChromeTransformInner(ModData modData, MiniYamlNode current, UpdateRule.ChromeNodeTransform transform)
        {
            foreach (var manualStep in transform(modData, current))
            {
                yield return(manualStep);
            }

            var childrenNode = current.Value.Nodes.FirstOrDefault(n => n.Key == "Children");

            if (childrenNode != null)
            {
                foreach (var node in childrenNode.Value.Nodes)
                {
                    if (node.Key != null)
                    {
                        foreach (var manualStep in ApplyChromeTransformInner(modData, node, transform))
                        {
                            yield return(manualStep);
                        }
                    }
                }
            }
        }