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

@@ -22,7 +22,7 @@ namespace OpenRA.Mods.Common.Traits
public readonly int Lifetime = 0;
[Desc("Allowed to land on.")]
public readonly string[] TerrainTypes = { };
public readonly HashSet<string> TerrainTypes = new HashSet<string>();
[Desc("Define actors that can collect crates by setting this into the Crushes field from the Mobile trait.")]
public readonly string CrushClass = "crate";
@@ -187,7 +187,7 @@ namespace OpenRA.Mods.Common.Traits
return GetAvailableSubCell(a, SubCell.Any, ignoreActor, checkTransientActors) != SubCell.Invalid;
}
public bool CrushableBy(string[] crushClasses, Player owner)
public bool CrushableBy(HashSet<string> crushClasses, Player owner)
{
// Crate can only be crushed if it is not in the air.
return self.IsAtGroundLevel() && crushClasses.Contains(info.CrushClass);