Make yaml node resolving optional

This commit is contained in:
Gustas
2023-05-15 09:32:23 +03:00
committed by Matthias Mailänder
parent d4e6815f64
commit 462a3ef3c0
7 changed files with 65 additions and 28 deletions

View File

@@ -14,7 +14,7 @@ using System.Linq;
namespace OpenRA.Mods.Common.UpdateRules.Rules
{
public class UnhardcodeBaseBuilderBotModule : UpdateRule
public class UnhardcodeBaseBuilderBotModule : UpdateRule, IBeforeUpdateActors
{
MiniYamlNode defences;
@@ -28,7 +28,7 @@ namespace OpenRA.Mods.Common.UpdateRules.Rules
public override string Description => "DefenseTypes were added.";
public override IEnumerable<string> BeforeUpdateActors(ModData modData, List<MiniYamlNode> resolvedActors)
public IEnumerable<string> BeforeUpdateActors(ModData modData, List<MiniYamlNode> resolvedActors)
{
var defences = new List<string>();

View File

@@ -14,7 +14,7 @@ using System.Linq;
namespace OpenRA.Mods.Common.UpdateRules.Rules
{
public class UnhardcodeSquadManager : UpdateRule
public class UnhardcodeSquadManager : UpdateRule, IBeforeUpdateActors
{
readonly List<MiniYamlNode> addNodes = new();
@@ -28,7 +28,7 @@ namespace OpenRA.Mods.Common.UpdateRules.Rules
public override string Description => "AirUnitsTypes and ProtectionTypes were added.";
public override IEnumerable<string> BeforeUpdateActors(ModData modData, List<MiniYamlNode> resolvedActors)
public IEnumerable<string> BeforeUpdateActors(ModData modData, List<MiniYamlNode> resolvedActors)
{
var aircraft = new List<string>();
var vips = new List<string>();

View File

@@ -15,7 +15,7 @@ using System.Reflection;
namespace OpenRA.Mods.Common.UpdateRules.Rules
{
public class ExplicitSequenceFilenames : UpdateRule
public class ExplicitSequenceFilenames : UpdateRule, IBeforeUpdateSequences
{
public override string Name => "Sequence filenames must be specified explicitly.";
@@ -33,7 +33,7 @@ namespace OpenRA.Mods.Common.UpdateRules.Rules
bool reportModYamlChanges;
bool disabled;
public override IEnumerable<string> BeforeUpdateSequences(ModData modData, List<MiniYamlNode> resolvedImagesNodes)
public IEnumerable<string> BeforeUpdateSequences(ModData modData, List<MiniYamlNode> resolvedImagesNodes)
{
// Keep a resolved copy of the sequences so we can account for values imported through inheritance or Defaults.
// This will be modified during processing, so take a deep copy to avoid side-effects on other update rules.

View File

@@ -15,7 +15,7 @@ using System.Linq;
namespace OpenRA.Mods.Common.UpdateRules.Rules
{
public class RemoveNegativeSequenceLength : UpdateRule
public class RemoveNegativeSequenceLength : UpdateRule, IBeforeUpdateSequences
{
public override string Name => "Negative sequence length is no longer allowed.";
@@ -23,7 +23,7 @@ namespace OpenRA.Mods.Common.UpdateRules.Rules
List<MiniYamlNode> resolvedImagesNodes;
public override IEnumerable<string> BeforeUpdateSequences(ModData modData, List<MiniYamlNode> resolvedImagesNodes)
public IEnumerable<string> BeforeUpdateSequences(ModData modData, List<MiniYamlNode> resolvedImagesNodes)
{
this.resolvedImagesNodes = resolvedImagesNodes;
yield break;