Fix CA1851

This commit is contained in:
RoosterDragon
2023-07-13 20:08:36 +01:00
committed by abcdefg30
parent 88f830a9e5
commit 3275875ae5
63 changed files with 349 additions and 267 deletions

View File

@@ -114,7 +114,7 @@ namespace OpenRA.Mods.Common.UpdateRules
}),
};
public static IEnumerable<UpdateRule> FromSource(ObjectCreator objectCreator, string source, bool chain = true)
public static IReadOnlyCollection<UpdateRule> FromSource(ObjectCreator objectCreator, string source, bool chain = true)
{
// Use reflection to identify types
var namedType = objectCreator.FindType(source);
@@ -143,12 +143,12 @@ namespace OpenRA.Mods.Common.UpdateRules
this.chainToSource = chainToSource;
}
IEnumerable<UpdateRule> Rules(bool chain = true)
IReadOnlyCollection<UpdateRule> Rules(bool chain = true)
{
if (chainToSource != null && chain)
{
var child = Paths.First(p => p.source == chainToSource);
return rules.Concat(child.Rules(chain));
return rules.Concat(child.Rules(chain)).ToList();
}
return rules;