More HashSet trait fields & Lint support
This commit is contained in:
@@ -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);
|
||||
|
||||
@@ -35,7 +35,7 @@ namespace OpenRA.Mods.Common.Traits
|
||||
public readonly HashSet<string> ValidTargets = new HashSet<string> { "Ground", "Water" };
|
||||
|
||||
[Desc("Which factions this crate action can occur for.")]
|
||||
public readonly string[] ValidFactions = { };
|
||||
public readonly HashSet<string> ValidFactions = new HashSet<string>();
|
||||
|
||||
[Desc("Is the new duplicates given to a specific owner, regardless of whom collected it?")]
|
||||
public readonly string Owner = null;
|
||||
|
||||
@@ -23,7 +23,7 @@ namespace OpenRA.Mods.Common.Traits
|
||||
public readonly string[] Units = { };
|
||||
|
||||
[Desc("Factions that are allowed to trigger this action.")]
|
||||
public readonly string[] ValidFactions = { };
|
||||
public readonly HashSet<string> ValidFactions = new HashSet<string>();
|
||||
|
||||
[Desc("Override the owner of the newly spawned unit: e.g. Creeps or Neutral")]
|
||||
public readonly string Owner = null;
|
||||
|
||||
Reference in New Issue
Block a user