Last active
June 27, 2018 21:03
-
-
Save MustaphaTR/f307532d07d3b32be94b130a2a2252c9 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| public override IEnumerable<string> UpdateActorNode(ModData modData, MiniYamlNode actorNode) | |
| { | |
| var queues = new List<MiniYamlNode>(); | |
| foreach (var q in actorNode.ChildrenMatching("ProductionQueue")) | |
| queues.Add(q); | |
| foreach (var q in actorNode.ChildrenMatching("ClassicProductionQueue")) | |
| queues.Add(q); | |
| foreach (var queue in queues) | |
| { | |
| var lowPower = queue.LastChildMatching("LowPowerSlowdown"); | |
| if (lowPower != null) | |
| { | |
| if (lowPower.NodeValue<int>() == 1) | |
| queue.RemoveNodes("LowPowerSlowdown"); | |
| else | |
| { | |
| lowPower.RenameKey("LowPowerModifier"); | |
| lowPower.ReplaceValue((lowPower.NodeValue<int>() * 100).ToString()); | |
| } | |
| } | |
| else | |
| queue.AddNode("LowPowerModifier", "300"); | |
| } | |
| yield break; | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment