Fix IDE0090
This commit is contained in:
committed by
Pavel Penev
parent
164abfdae1
commit
8a285f9b19
@@ -47,11 +47,11 @@ namespace OpenRA.Mods.Common.Traits
|
||||
readonly BridgeLayer bridgeLayer;
|
||||
|
||||
// Fixed at map load
|
||||
readonly List<CPos[]> segmentLocations = new List<CPos[]>();
|
||||
readonly List<CPos[]> segmentLocations = new();
|
||||
|
||||
// Changes as segments are killed and repaired
|
||||
readonly Dictionary<CPos, IBridgeSegment> segments = new Dictionary<CPos, IBridgeSegment>();
|
||||
readonly HashSet<CPos> dirtyLocations = new HashSet<CPos>();
|
||||
readonly Dictionary<CPos, IBridgeSegment> segments = new();
|
||||
readonly HashSet<CPos> dirtyLocations = new();
|
||||
|
||||
// Enabled during a repair action
|
||||
int repairStep;
|
||||
|
||||
@@ -29,14 +29,14 @@ namespace OpenRA.Mods.Common.Traits
|
||||
public class BuildingInfo : TraitInfo, IOccupySpaceInfo, IPlaceBuildingDecorationInfo
|
||||
{
|
||||
[Desc("Where you are allowed to place the building (Water, Clear, ...)")]
|
||||
public readonly HashSet<string> TerrainTypes = new HashSet<string>();
|
||||
public readonly HashSet<string> TerrainTypes = new();
|
||||
|
||||
[Desc("x means cell is blocked, capital X means blocked but not counting as targetable, ",
|
||||
"= means part of the footprint but passable, _ means completely empty.")]
|
||||
[FieldLoader.LoadUsing(nameof(LoadFootprint))]
|
||||
public readonly Dictionary<CVec, FootprintCellType> Footprint;
|
||||
|
||||
public readonly CVec Dimensions = new CVec(1, 1);
|
||||
public readonly CVec Dimensions = new(1, 1);
|
||||
|
||||
[Desc("Shift center of the actor by this offset.")]
|
||||
public readonly WVec LocalCenterOffset = WVec.Zero;
|
||||
|
||||
@@ -27,7 +27,7 @@ namespace OpenRA.Mods.Common.Traits
|
||||
public readonly WAngle? Facing = null;
|
||||
|
||||
[Desc("Type tags on this exit.")]
|
||||
public readonly HashSet<string> ProductionTypes = new HashSet<string>();
|
||||
public readonly HashSet<string> ProductionTypes = new();
|
||||
|
||||
[Desc("Number of ticks to wait before moving into the world.")]
|
||||
public readonly int ExitDelay = 0;
|
||||
|
||||
@@ -28,7 +28,7 @@ namespace OpenRA.Mods.Common.Traits
|
||||
public readonly int TransitionDelay = 33;
|
||||
|
||||
[Desc("Blocks bullets scaled to open value.")]
|
||||
public readonly WDist BlocksProjectilesHeight = new WDist(640);
|
||||
public readonly WDist BlocksProjectilesHeight = new(640);
|
||||
|
||||
[Desc("Determines what projectiles to block based on their allegiance to the gate owner.")]
|
||||
public readonly PlayerRelationship BlocksProjectilesValidRelationships = PlayerRelationship.Ally | PlayerRelationship.Neutral | PlayerRelationship.Enemy;
|
||||
@@ -139,7 +139,7 @@ namespace OpenRA.Mods.Common.Traits
|
||||
return blockedPositions.Any(loc => self.World.ActorMap.GetActorsAt(loc).Any(a => a != self));
|
||||
}
|
||||
|
||||
WDist IBlocksProjectiles.BlockingHeight => new WDist(Info.BlocksProjectilesHeight.Length * (OpenPosition - Position) / OpenPosition);
|
||||
WDist IBlocksProjectiles.BlockingHeight => new(Info.BlocksProjectilesHeight.Length * (OpenPosition - Position) / OpenPosition);
|
||||
|
||||
PlayerRelationship IBlocksProjectiles.ValidRelationships => Info.BlocksProjectilesValidRelationships;
|
||||
}
|
||||
|
||||
@@ -18,7 +18,7 @@ namespace OpenRA.Mods.Common.Traits
|
||||
{
|
||||
[FieldLoader.Require]
|
||||
[Desc("Types of buildable area this actor gives.")]
|
||||
public readonly HashSet<string> AreaTypes = new HashSet<string>();
|
||||
public readonly HashSet<string> AreaTypes = new();
|
||||
|
||||
public override object Create(ActorInitializer init) { return new GivesBuildableArea(this); }
|
||||
}
|
||||
@@ -28,7 +28,7 @@ namespace OpenRA.Mods.Common.Traits
|
||||
public GivesBuildableArea(GivesBuildableAreaInfo info)
|
||||
: base(info) { }
|
||||
|
||||
readonly HashSet<string> noAreaTypes = new HashSet<string>();
|
||||
readonly HashSet<string> noAreaTypes = new();
|
||||
|
||||
public HashSet<string> AreaTypes => !IsTraitDisabled ? Info.AreaTypes : noAreaTypes;
|
||||
}
|
||||
|
||||
@@ -56,7 +56,7 @@ namespace OpenRA.Mods.Common.Traits
|
||||
public readonly int Range = 5;
|
||||
|
||||
[Desc("LineBuildNode 'Types' to attach to.")]
|
||||
public readonly HashSet<string> NodeTypes = new HashSet<string> { "wall" };
|
||||
public readonly HashSet<string> NodeTypes = new() { "wall" };
|
||||
|
||||
[ActorReference(typeof(LineBuildInfo))]
|
||||
[Desc("Actor type for line-built segments (defaults to same actor).")]
|
||||
|
||||
@@ -18,7 +18,7 @@ namespace OpenRA.Mods.Common.Traits
|
||||
public class LineBuildNodeInfo : TraitInfo<LineBuildNode>
|
||||
{
|
||||
[Desc("This actor is of LineBuild 'NodeType'...")]
|
||||
public readonly HashSet<string> Types = new HashSet<string> { "wall" };
|
||||
public readonly HashSet<string> Types = new() { "wall" };
|
||||
|
||||
[Desc("Cells (outside the footprint) that contain cells that can connect to this actor.")]
|
||||
public readonly CVec[] Connections = new[] { new CVec(1, 0), new CVec(0, 1), new CVec(-1, 0), new CVec(0, -1) };
|
||||
|
||||
@@ -36,7 +36,7 @@ namespace OpenRA.Mods.Common.Traits
|
||||
public readonly bool BaselineSpawn = false;
|
||||
|
||||
[Desc("Direction the aircraft should face to land.")]
|
||||
public readonly WAngle Facing = new WAngle(256);
|
||||
public readonly WAngle Facing = new(256);
|
||||
|
||||
public override object Create(ActorInitializer init) { return new ProductionAirdrop(init, this); }
|
||||
}
|
||||
|
||||
@@ -67,10 +67,10 @@ namespace OpenRA.Mods.Common.Traits
|
||||
{
|
||||
readonly IHealth health;
|
||||
readonly Predicate<Player> isNotActiveAlly;
|
||||
readonly Stack<int> repairTokens = new Stack<int>();
|
||||
readonly Stack<int> repairTokens = new();
|
||||
int remainingTicks;
|
||||
|
||||
public readonly List<Player> Repairers = new List<Player>();
|
||||
public readonly List<Player> Repairers = new();
|
||||
public bool RepairActive { get; private set; }
|
||||
|
||||
public RepairableBuilding(Actor self, RepairableBuildingInfo info)
|
||||
|
||||
@@ -19,7 +19,7 @@ namespace OpenRA.Mods.Common.Traits
|
||||
{
|
||||
[FieldLoader.Require]
|
||||
[Desc("Types of buildable are this actor requires.")]
|
||||
public readonly HashSet<string> AreaTypes = new HashSet<string>();
|
||||
public readonly HashSet<string> AreaTypes = new();
|
||||
|
||||
[Desc("Maximum range from the actor with 'GivesBuildableArea' this can be placed at.")]
|
||||
public readonly int Adjacent = 2;
|
||||
|
||||
@@ -26,7 +26,7 @@ namespace OpenRA.Mods.Common.Traits
|
||||
|
||||
[ActorReference]
|
||||
[FieldLoader.Require]
|
||||
public readonly HashSet<string> DockActors = new HashSet<string> { };
|
||||
public readonly HashSet<string> DockActors = new() { };
|
||||
|
||||
[VoiceReference]
|
||||
public readonly string Voice = "Action";
|
||||
|
||||
@@ -33,7 +33,7 @@ namespace OpenRA.Mods.Common.Traits
|
||||
[CursorReference(dictionaryReference: LintDictionaryReference.Values)]
|
||||
[Desc("Cursor overrides to display for specific terrain types.",
|
||||
"A dictionary of [terrain type]: [cursor name].")]
|
||||
public readonly Dictionary<string, string> TerrainCursors = new Dictionary<string, string>();
|
||||
public readonly Dictionary<string, string> TerrainCursors = new();
|
||||
|
||||
[CursorReference]
|
||||
[Desc("Cursor to display when a move order cannot be issued at target location.")]
|
||||
|
||||
@@ -23,7 +23,7 @@ namespace OpenRA.Mods.Common.Traits
|
||||
{
|
||||
[ActorReference]
|
||||
[FieldLoader.Require]
|
||||
public readonly HashSet<string> RepairActors = new HashSet<string> { };
|
||||
public readonly HashSet<string> RepairActors = new() { };
|
||||
|
||||
[VoiceReference]
|
||||
public readonly string Voice = "Action";
|
||||
|
||||
Reference in New Issue
Block a user