Fix and enable SA1133, SA1134 style rules.

This commit is contained in:
Paul Chote
2019-05-23 18:43:21 +00:00
committed by abcdefg30
parent fbf9461890
commit 78a70be0d4
214 changed files with 1012 additions and 432 deletions

View File

@@ -16,7 +16,9 @@ namespace OpenRA.Mods.Common
{
public class FacingInit : IActorInit<int>
{
[FieldFromYamlKey] readonly int value = 128;
[FieldFromYamlKey]
readonly int value = 128;
public FacingInit() { }
public FacingInit(int init) { value = init; }
public int Value(World world) { return value; }
@@ -25,13 +27,16 @@ namespace OpenRA.Mods.Common
public class DynamicFacingInit : IActorInit<Func<int>>
{
readonly Func<int> func;
public DynamicFacingInit(Func<int> func) { this.func = func; }
public Func<int> Value(World world) { return func; }
}
public class SubCellInit : IActorInit<SubCell>
{
[FieldFromYamlKey] readonly byte value = (byte)SubCell.FullCell;
[FieldFromYamlKey]
readonly byte value = (byte)SubCell.FullCell;
public SubCellInit() { }
public SubCellInit(byte init) { value = init; }
public SubCellInit(SubCell init) { value = (byte)init; }
@@ -40,7 +45,9 @@ namespace OpenRA.Mods.Common
public class CenterPositionInit : IActorInit<WPos>
{
[FieldFromYamlKey] readonly WPos value = WPos.Zero;
[FieldFromYamlKey]
readonly WPos value = WPos.Zero;
public CenterPositionInit() { }
public CenterPositionInit(WPos init) { value = init; }
public WPos Value(World world) { return value; }
@@ -49,7 +56,8 @@ namespace OpenRA.Mods.Common
// Allows maps / transformations to specify the faction variant of an actor.
public class FactionInit : IActorInit<string>
{
[FieldFromYamlKey] public readonly string Faction;
[FieldFromYamlKey]
public readonly string Faction;
public FactionInit() { }
public FactionInit(string faction) { Faction = faction; }
@@ -58,7 +66,8 @@ namespace OpenRA.Mods.Common
public class EffectiveOwnerInit : IActorInit<Player>
{
[FieldFromYamlKey] readonly Player value = null;
[FieldFromYamlKey]
readonly Player value = null;
public EffectiveOwnerInit() { }
public EffectiveOwnerInit(Player owner) { value = owner; }