Add a ReplaceValue method to UpdateUtils

This commit is contained in:
abcdefg30
2018-03-30 17:45:12 +02:00
committed by reaperrr
parent 399692341d
commit ae9371f627

View File

@@ -249,6 +249,11 @@ namespace OpenRA.Mods.Common.UpdateRules
return FieldLoader.GetValue<T>(node.Key, node.Value.Value);
}
public static void ReplaceValue(this MiniYamlNode node, string value)
{
node.Value.Value = value;
}
public static void AddNode(this MiniYamlNode node, string key, object value)
{
node.Value.Nodes.Add(new MiniYamlNode(key, FieldSaver.FormatValue(value)));