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

@@ -21,8 +21,9 @@ namespace OpenRA.Mods.Common.Traits
[Desc("Delay for the end game notification in milliseconds.")]
public readonly int NotificationDelay = 1500;
[Translate]
[Desc("Description of the objective.")]
[Translate] public readonly string Objective = "Destroy all opposition!";
public readonly string Objective = "Destroy all opposition!";
[Desc("Disable the win/loss messages and audio notifications?")]
public readonly bool SuppressNotifications = false;

View File

@@ -76,13 +76,26 @@ namespace OpenRA.Mods.Common.Traits
readonly DeveloperModeInfo info;
public bool Enabled { get; private set; }
[Sync] bool fastCharge;
[Sync] bool allTech;
[Sync] bool fastBuild;
[Sync] bool disableShroud;
[Sync] bool pathDebug;
[Sync] bool unlimitedPower;
[Sync] bool buildAnywhere;
[Sync]
bool fastCharge;
[Sync]
bool allTech;
[Sync]
bool fastBuild;
[Sync]
bool disableShroud;
[Sync]
bool pathDebug;
[Sync]
bool unlimitedPower;
[Sync]
bool buildAnywhere;
public bool FastCharge { get { return Enabled && fastCharge; } }
public bool AllTech { get { return Enabled && allTech; } }

View File

@@ -25,12 +25,20 @@ namespace OpenRA.Mods.Common.Traits
public readonly string Notification = "Beacon";
public readonly bool IsPlayerPalette = true;
[PaletteReference("IsPlayerPalette")] public readonly string Palette = "player";
[PaletteReference("IsPlayerPalette")]
public readonly string Palette = "player";
public readonly string BeaconImage = "beacon";
[SequenceReference("BeaconImage")] public readonly string BeaconSequence = null;
[SequenceReference("BeaconImage")] public readonly string ArrowSequence = "arrow";
[SequenceReference("BeaconImage")] public readonly string CircleSequence = "circles";
[SequenceReference("BeaconImage")]
public readonly string BeaconSequence = null;
[SequenceReference("BeaconImage")]
public readonly string ArrowSequence = "arrow";
[SequenceReference("BeaconImage")]
public readonly string CircleSequence = "circles";
public object Create(ActorInitializer init) { return new PlaceBeacon(init.Self, this); }
}

View File

@@ -21,11 +21,13 @@ namespace OpenRA.Mods.Common.Traits
[Desc("Allows the player to execute build orders.", " Attach this to the player actor.")]
public class PlaceBuildingInfo : ITraitInfo
{
[PaletteReference]
[Desc("Palette to use for rendering the placement sprite.")]
[PaletteReference] public readonly string Palette = TileSet.TerrainPaletteInternalName;
public readonly string Palette = TileSet.TerrainPaletteInternalName;
[PaletteReference]
[Desc("Palette to use for rendering the placement sprite for line build segments.")]
[PaletteReference] public readonly string LineBuildSegmentPalette = TileSet.TerrainPaletteInternalName;
public readonly string LineBuildSegmentPalette = TileSet.TerrainPaletteInternalName;
[Desc("Play NewOptionsNotification this many ticks after building placement.")]
public readonly int NewOptionsNotificationDelay = 10;

View File

@@ -23,7 +23,8 @@ namespace OpenRA.Mods.Common.Traits
public class PlayerExperience : ISync
{
[Sync] public int Experience { get; private set; }
[Sync]
public int Experience { get; private set; }
public void GiveExperience(int num)
{

View File

@@ -83,10 +83,14 @@ namespace OpenRA.Mods.Common.Traits
Cash = info.DefaultCash;
}
[Sync] public int Cash;
[Sync]
public int Cash;
[Sync] public int Resources;
[Sync] public int ResourceCapacity;
[Sync]
public int Resources;
[Sync]
public int ResourceCapacity;
public int Earned;
public int Spent;

View File

@@ -115,10 +115,13 @@ namespace OpenRA.Mods.Common.Traits
public Actor Actor { get { return self; } }
[Sync] public bool Enabled { get; protected set; }
[Sync]
public bool Enabled { get; protected set; }
public string Faction { get; private set; }
[Sync] public bool IsValidFaction { get; private set; }
[Sync]
public bool IsValidFaction { get; private set; }
public ProductionQueue(ActorInitializer init, Actor playerActor, ProductionQueueInfo info)
{

View File

@@ -36,8 +36,9 @@ namespace OpenRA.Mods.Common.Traits
[Desc("Delay for the end game notification in milliseconds.")]
public readonly int NotificationDelay = 1500;
[Translate]
[Desc("Description of the objective")]
[Translate] public readonly string Objective = "Hold all the strategic positions!";
public readonly string Objective = "Hold all the strategic positions!";
[Desc("Disable the win/loss messages and audio notifications?")]
public readonly bool SuppressNotifications = false;
@@ -49,7 +50,9 @@ namespace OpenRA.Mods.Common.Traits
{
readonly StrategicVictoryConditionsInfo info;
[Sync] public int TicksLeft;
[Sync]
public int TicksLeft;
readonly Player player;
readonly MissionObjectives mo;
readonly bool shortGame;