More HashSet trait fields & Lint support
This commit is contained in:
@@ -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)
|
||||
{
|
||||
|
||||
@@ -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 { }
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
@@ -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";
|
||||
|
||||
|
||||
@@ -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); }
|
||||
}
|
||||
|
||||
@@ -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";
|
||||
|
||||
Reference in New Issue
Block a user