More HashSet trait fields & Lint support

This commit is contained in:
atlimit8
2015-09-05 15:54:00 -05:00
parent e74c0d6c13
commit 8250f223c4
57 changed files with 115 additions and 89 deletions

View File

@@ -27,7 +27,7 @@ namespace OpenRA.Mods.RA.Activities
readonly MinelayerInfo info;
readonly AmmoPool[] ammoPools;
readonly IMove movement;
readonly string[] rearmBuildings;
readonly HashSet<string> rearmBuildings;
public LayMines(Actor self)
{

View File

@@ -8,7 +8,7 @@
*/
#endregion
using System;
using System.Collections.Generic;
using OpenRA.Traits;
namespace OpenRA.Mods.RA.Traits
@@ -18,7 +18,7 @@ namespace OpenRA.Mods.RA.Traits
{
[FieldLoader.Require]
[Desc("This unit's cloneable type is:")]
public readonly string[] Types = { };
public readonly HashSet<string> Types = new HashSet<string>();
}
public class Cloneable { }

View File

@@ -49,7 +49,7 @@ namespace OpenRA.Mods.RA.Traits
self.Kill(crusher);
}
public bool CrushableBy(string[] crushClasses, Player owner)
public bool CrushableBy(HashSet<string> crushClasses, Player owner)
{
return info.CrushClasses.Overlaps(crushClasses);
}

View File

@@ -21,7 +21,7 @@ namespace OpenRA.Mods.RA.Traits
public class MinelayerInfo : ITraitInfo
{
[ActorReference] public readonly string Mine = "minv";
[ActorReference] public readonly string[] RearmBuildings = { "fix" };
[ActorReference] public readonly HashSet<string> RearmBuildings = new HashSet<string> { "fix" };
public readonly string AmmoPoolName = "primary";

View File

@@ -18,7 +18,7 @@ namespace OpenRA.Mods.RA.Traits
[Desc("Palette effect used for blinking \"animations\" on actors.")]
class LightPaletteRotatorInfo : ITraitInfo
{
public readonly string[] ExcludePalettes = { };
public readonly HashSet<string> ExcludePalettes = new HashSet<string>();
public object Create(ActorInitializer init) { return new LightPaletteRotator(this); }
}

View File

@@ -8,6 +8,7 @@
*/
#endregion
using System.Collections.Generic;
using System.Linq;
using OpenRA.Mods.Common.Traits;
using OpenRA.Traits;
@@ -16,7 +17,7 @@ namespace OpenRA.Mods.RA.Traits
{
public class WithLandingCraftAnimationInfo : ITraitInfo, Requires<IMoveInfo>, Requires<WithSpriteBodyInfo>, Requires<CargoInfo>
{
public readonly string[] OpenTerrainTypes = { "Clear" };
public readonly HashSet<string> OpenTerrainTypes = new HashSet<string> { "Clear" };
[SequenceReference] public readonly string OpenSequence = "open";
[SequenceReference] public readonly string CloseSequence = "close";
[SequenceReference] public readonly string UnloadSequence = "unload";