Fix IDE0090
This commit is contained in:
committed by
Pavel Penev
parent
164abfdae1
commit
8a285f9b19
@@ -21,7 +21,7 @@ namespace OpenRA.Mods.Cnc.Traits
|
||||
public class AttackLeapInfo : AttackFrontalInfo, Requires<MobileInfo>
|
||||
{
|
||||
[Desc("Leap speed (in WDist units/tick).")]
|
||||
public readonly WDist Speed = new WDist(426);
|
||||
public readonly WDist Speed = new(426);
|
||||
|
||||
[Desc("Conditions that last from start of the leap until the attack.")]
|
||||
[GrantedConditionReference]
|
||||
|
||||
@@ -51,7 +51,7 @@ namespace OpenRA.Mods.Cnc.Traits
|
||||
public readonly string OriginalActor = "mcv";
|
||||
|
||||
[Desc("Facing of the returned actor.")]
|
||||
public readonly WAngle Facing = new WAngle(384);
|
||||
public readonly WAngle Facing = new(384);
|
||||
|
||||
public readonly string ChronoshiftSound = "chrono2.aud";
|
||||
|
||||
|
||||
@@ -77,7 +77,7 @@ namespace OpenRA.Mods.Cnc.Traits
|
||||
public readonly PlayerRelationship ValidRelationships = PlayerRelationship.Ally | PlayerRelationship.Neutral | PlayerRelationship.Enemy;
|
||||
|
||||
[Desc("Target types of actors that this actor disguise as.")]
|
||||
public readonly BitSet<TargetableType> TargetTypes = new BitSet<TargetableType>("Disguise");
|
||||
public readonly BitSet<TargetableType> TargetTypes = new("Disguise");
|
||||
|
||||
[Desc("Triggers which cause the actor to drop it's disguise. Possible values: None, Attack, Damaged,",
|
||||
"Unload, Infiltrate, Demolish, Move.")]
|
||||
@@ -86,7 +86,7 @@ namespace OpenRA.Mods.Cnc.Traits
|
||||
[ActorReference(dictionaryReference: LintDictionaryReference.Keys)]
|
||||
[Desc("Conditions to grant when disguised as specified actor.",
|
||||
"A dictionary of [actor id]: [condition].")]
|
||||
public readonly Dictionary<string, string> DisguisedAsConditions = new Dictionary<string, string>();
|
||||
public readonly Dictionary<string, string> DisguisedAsConditions = new();
|
||||
|
||||
[CursorReference]
|
||||
[Desc("Cursor to display when hovering over a valid actor to disguise as.")]
|
||||
|
||||
@@ -42,8 +42,8 @@ namespace OpenRA.Mods.Cnc.Traits
|
||||
|
||||
readonly Player owner;
|
||||
|
||||
readonly List<Actor> actors = new List<Actor>();
|
||||
readonly HashSet<TraitPair<IOnGpsRefreshed>> notifyOnRefresh = new HashSet<TraitPair<IOnGpsRefreshed>>();
|
||||
readonly List<Actor> actors = new();
|
||||
readonly HashSet<TraitPair<IOnGpsRefreshed>> notifyOnRefresh = new();
|
||||
|
||||
public GpsWatcher(Player owner)
|
||||
{
|
||||
|
||||
@@ -29,7 +29,7 @@ namespace OpenRA.Mods.Cnc.Traits
|
||||
|
||||
class InfiltrateForDecoration : WithDecoration, INotifyInfiltrated
|
||||
{
|
||||
readonly HashSet<Player> infiltrators = new HashSet<Player>();
|
||||
readonly HashSet<Player> infiltrators = new();
|
||||
readonly InfiltrateForDecorationInfo info;
|
||||
|
||||
public InfiltrateForDecoration(Actor self, InfiltrateForDecorationInfo info)
|
||||
|
||||
@@ -28,7 +28,7 @@ namespace OpenRA.Mods.Cnc.Traits
|
||||
|
||||
public readonly string AmmoPoolName = "primary";
|
||||
|
||||
public readonly WDist MinefieldDepth = new WDist(1536);
|
||||
public readonly WDist MinefieldDepth = new(1536);
|
||||
|
||||
[VoiceReference]
|
||||
[Desc("Voice to use when ordered to lay a minefield.")]
|
||||
@@ -47,7 +47,7 @@ namespace OpenRA.Mods.Cnc.Traits
|
||||
public readonly string TileUnknownName = "build-unknown";
|
||||
|
||||
[Desc("Only allow laying mines on listed terrain types. Leave empty to allow all terrain types.")]
|
||||
public readonly HashSet<string> TerrainTypes = new HashSet<string>();
|
||||
public readonly HashSet<string> TerrainTypes = new();
|
||||
|
||||
[CursorReference]
|
||||
[Desc("Cursor to display when able to lay a mine.")]
|
||||
|
||||
@@ -20,7 +20,7 @@ namespace OpenRA.Mods.Cnc.Traits
|
||||
class LightPaletteRotatorInfo : TraitInfo
|
||||
{
|
||||
[Desc("Palettes this effect should not apply to.")]
|
||||
public readonly HashSet<string> ExcludePalettes = new HashSet<string>();
|
||||
public readonly HashSet<string> ExcludePalettes = new();
|
||||
|
||||
[Desc("'Speed' at which the effect cycles through palette indices.")]
|
||||
public readonly float TimeStep = .5f;
|
||||
|
||||
@@ -84,7 +84,7 @@ namespace OpenRA.Mods.Cnc.Traits
|
||||
readonly WithBuildingBibInfo info;
|
||||
readonly RenderSprites rs;
|
||||
readonly BuildingInfo bi;
|
||||
readonly List<AnimationWithOffset> anims = new List<AnimationWithOffset>();
|
||||
readonly List<AnimationWithOffset> anims = new();
|
||||
|
||||
public WithBuildingBib(Actor self, WithBuildingBibInfo info)
|
||||
{
|
||||
|
||||
@@ -27,7 +27,7 @@ namespace OpenRA.Mods.Cnc.Traits.Render
|
||||
public readonly WVec[] LocalOffset = { WVec.Zero };
|
||||
|
||||
[Desc("Passenger CargoType to display.")]
|
||||
public readonly HashSet<string> DisplayTypes = new HashSet<string>();
|
||||
public readonly HashSet<string> DisplayTypes = new();
|
||||
|
||||
public override object Create(ActorInitializer init) { return new WithCargo(init.Self, this); }
|
||||
}
|
||||
@@ -40,7 +40,7 @@ namespace OpenRA.Mods.Cnc.Traits.Render
|
||||
readonly IFacing facing;
|
||||
WAngle cachedFacing;
|
||||
|
||||
readonly Dictionary<Actor, IActorPreview[]> previews = new Dictionary<Actor, IActorPreview[]>();
|
||||
readonly Dictionary<Actor, IActorPreview[]> previews = new();
|
||||
|
||||
public WithCargo(Actor self, WithCargoInfo info)
|
||||
{
|
||||
|
||||
@@ -19,7 +19,7 @@ namespace OpenRA.Mods.Cnc.Traits.Render
|
||||
{
|
||||
public class WithLandingCraftAnimationInfo : TraitInfo, Requires<IMoveInfo>, Requires<WithSpriteBodyInfo>, Requires<CargoInfo>
|
||||
{
|
||||
public readonly HashSet<string> OpenTerrainTypes = new HashSet<string> { "Clear" };
|
||||
public readonly HashSet<string> OpenTerrainTypes = new() { "Clear" };
|
||||
|
||||
[SequenceReference]
|
||||
public readonly string OpenSequence = "open";
|
||||
|
||||
@@ -28,10 +28,10 @@ namespace OpenRA.Mods.Cnc.Traits
|
||||
public readonly string[] UnitTypes = null;
|
||||
|
||||
[Desc("Number of drop pods spawned.")]
|
||||
public readonly int2 Drops = new int2(5, 8);
|
||||
public readonly int2 Drops = new(5, 8);
|
||||
|
||||
[Desc("Sets the approach direction.")]
|
||||
public readonly WAngle PodFacing = new WAngle(128);
|
||||
public readonly WAngle PodFacing = new(128);
|
||||
|
||||
[Desc("Maximum offset from targetLocation")]
|
||||
public readonly int PodScatter = 3;
|
||||
|
||||
@@ -24,10 +24,10 @@ namespace OpenRA.Mods.Cnc.Traits
|
||||
public readonly int Speed = 28;
|
||||
|
||||
[Desc("Facing to use when actor spawns. Only 256 and 768 supported.")]
|
||||
public readonly WAngle InitialFacing = new WAngle(256);
|
||||
public readonly WAngle InitialFacing = new(256);
|
||||
|
||||
[Desc("Facing to use for actor previews (map editor, color picker, etc). Only 256 and 768 supported.")]
|
||||
public readonly WAngle PreviewFacing = new WAngle(256);
|
||||
public readonly WAngle PreviewFacing = new(256);
|
||||
|
||||
public override object Create(ActorInitializer init) { return new TDGunboat(init, this); }
|
||||
|
||||
@@ -58,8 +58,8 @@ namespace OpenRA.Mods.Cnc.Traits
|
||||
{
|
||||
public readonly TDGunboatInfo Info;
|
||||
readonly Actor self;
|
||||
static readonly WAngle Left = new WAngle(256);
|
||||
static readonly WAngle Right = new WAngle(768);
|
||||
static readonly WAngle Left = new(256);
|
||||
static readonly WAngle Right = new(768);
|
||||
|
||||
IEnumerable<int> speedModifiers;
|
||||
INotifyCenterPositionChanged[] notifyCenterPositionChanged;
|
||||
|
||||
@@ -22,7 +22,7 @@ namespace OpenRA.Mods.Cnc.Traits
|
||||
public readonly string TerrainType = "Jumpjet";
|
||||
|
||||
[Desc("Height offset relative to the smoothed terrain for movement.")]
|
||||
public readonly WDist HeightOffset = new WDist(3992);
|
||||
public readonly WDist HeightOffset = new(3992);
|
||||
|
||||
[Desc("Cell radius for smoothing adjacent cell heights.")]
|
||||
public readonly int SmoothingRadius = 2;
|
||||
|
||||
@@ -23,7 +23,7 @@ namespace OpenRA.Mods.Cnc.Traits
|
||||
public readonly short JumpjetTransitionCost = 0;
|
||||
|
||||
[Desc("The terrain types that this actor can transition on. Leave empty to allow any.")]
|
||||
public readonly HashSet<string> JumpjetTransitionTerrainTypes = new HashSet<string>();
|
||||
public readonly HashSet<string> JumpjetTransitionTerrainTypes = new();
|
||||
|
||||
[Desc("Can this actor transition on slopes?")]
|
||||
public readonly bool JumpjetTransitionOnRamps = true;
|
||||
|
||||
@@ -23,7 +23,7 @@ namespace OpenRA.Mods.Cnc.Traits
|
||||
|
||||
[ActorReference]
|
||||
[Desc("Actor types that should be treated as veins for adjacency.")]
|
||||
public readonly HashSet<string> VeinholeActors = new HashSet<string> { };
|
||||
public readonly HashSet<string> VeinholeActors = new() { };
|
||||
|
||||
public override object Create(ActorInitializer init) { return new TSEditorResourceLayer(init.Self, this); }
|
||||
}
|
||||
|
||||
@@ -25,7 +25,7 @@ namespace OpenRA.Mods.Cnc.Traits
|
||||
|
||||
[ActorReference]
|
||||
[Desc("Actor types that should be treated as veins for adjacency.")]
|
||||
public readonly HashSet<string> VeinholeActors = new HashSet<string> { };
|
||||
public readonly HashSet<string> VeinholeActors = new() { };
|
||||
|
||||
public override object Create(ActorInitializer init) { return new TSResourceLayer(init.Self, this); }
|
||||
}
|
||||
@@ -33,7 +33,7 @@ namespace OpenRA.Mods.Cnc.Traits
|
||||
class TSResourceLayer : ResourceLayer, INotifyActorDisposing
|
||||
{
|
||||
readonly TSResourceLayerInfo info;
|
||||
readonly HashSet<CPos> veinholeCells = new HashSet<CPos>();
|
||||
readonly HashSet<CPos> veinholeCells = new();
|
||||
|
||||
public TSResourceLayer(Actor self, TSResourceLayerInfo info)
|
||||
: base(self, info)
|
||||
|
||||
@@ -22,16 +22,16 @@ namespace OpenRA.Mods.Cnc.Traits
|
||||
public class TSTiberiumRendererInfo : ResourceRendererInfo
|
||||
{
|
||||
[Desc("Sequences to use for ramp type 1.", "Dictionary of [resource type]: [list of sequences].")]
|
||||
public readonly Dictionary<string, string[]> Ramp1Sequences = new Dictionary<string, string[]>();
|
||||
public readonly Dictionary<string, string[]> Ramp1Sequences = new();
|
||||
|
||||
[Desc("Sequences to use for ramp type 2.", "Dictionary of [resource type]: [list of sequences].")]
|
||||
public readonly Dictionary<string, string[]> Ramp2Sequences = new Dictionary<string, string[]>();
|
||||
public readonly Dictionary<string, string[]> Ramp2Sequences = new();
|
||||
|
||||
[Desc("Sequences to use for ramp type 3.", "Dictionary of [resource type]: [list of sequences].")]
|
||||
public readonly Dictionary<string, string[]> Ramp3Sequences = new Dictionary<string, string[]>();
|
||||
public readonly Dictionary<string, string[]> Ramp3Sequences = new();
|
||||
|
||||
[Desc("Sequences to use for ramp type 4.", "Dictionary of [resource type]: [list of sequences].")]
|
||||
public readonly Dictionary<string, string[]> Ramp4Sequences = new Dictionary<string, string[]>();
|
||||
public readonly Dictionary<string, string[]> Ramp4Sequences = new();
|
||||
|
||||
public override object Create(ActorInitializer init) { return new TSTiberiumRenderer(init.Self, this); }
|
||||
}
|
||||
@@ -40,10 +40,10 @@ namespace OpenRA.Mods.Cnc.Traits
|
||||
{
|
||||
readonly TSTiberiumRendererInfo info;
|
||||
readonly World world;
|
||||
readonly Dictionary<string, Dictionary<string, ISpriteSequence>> ramp1Variants = new Dictionary<string, Dictionary<string, ISpriteSequence>>();
|
||||
readonly Dictionary<string, Dictionary<string, ISpriteSequence>> ramp2Variants = new Dictionary<string, Dictionary<string, ISpriteSequence>>();
|
||||
readonly Dictionary<string, Dictionary<string, ISpriteSequence>> ramp3Variants = new Dictionary<string, Dictionary<string, ISpriteSequence>>();
|
||||
readonly Dictionary<string, Dictionary<string, ISpriteSequence>> ramp4Variants = new Dictionary<string, Dictionary<string, ISpriteSequence>>();
|
||||
readonly Dictionary<string, Dictionary<string, ISpriteSequence>> ramp1Variants = new();
|
||||
readonly Dictionary<string, Dictionary<string, ISpriteSequence>> ramp2Variants = new();
|
||||
readonly Dictionary<string, Dictionary<string, ISpriteSequence>> ramp3Variants = new();
|
||||
readonly Dictionary<string, Dictionary<string, ISpriteSequence>> ramp4Variants = new();
|
||||
|
||||
public TSTiberiumRenderer(Actor self, TSTiberiumRendererInfo info)
|
||||
: base(self, info)
|
||||
|
||||
@@ -44,7 +44,7 @@ namespace OpenRA.Mods.Cnc.Traits
|
||||
|
||||
[ActorReference]
|
||||
[Desc("Actor types that should be treated as veins for adjacency.")]
|
||||
public readonly HashSet<string> VeinholeActors = new HashSet<string> { };
|
||||
public readonly HashSet<string> VeinholeActors = new() { };
|
||||
|
||||
void IMapPreviewSignatureInfo.PopulateMapPreviewSignatureCells(Map map, ActorInfo ai, ActorReference s, List<(MPos, Color)> destinationBuffer)
|
||||
{
|
||||
@@ -120,7 +120,7 @@ namespace OpenRA.Mods.Cnc.Traits
|
||||
PlusY = 0x8,
|
||||
}
|
||||
|
||||
static readonly Dictionary<Adjacency, int[]> BorderIndices = new Dictionary<Adjacency, int[]>()
|
||||
static readonly Dictionary<Adjacency, int[]> BorderIndices = new()
|
||||
{
|
||||
{ Adjacency.MinusY, new[] { 3, 4, 5 } },
|
||||
{ Adjacency.PlusX, new[] { 6, 7, 8 } },
|
||||
@@ -151,9 +151,9 @@ namespace OpenRA.Mods.Cnc.Traits
|
||||
readonly IResourceLayer resourceLayer;
|
||||
readonly CellLayer<int[]> renderIndices;
|
||||
readonly CellLayer<Adjacency> borders;
|
||||
readonly HashSet<CPos> dirty = new HashSet<CPos>();
|
||||
readonly Queue<CPos> cleanDirty = new Queue<CPos>();
|
||||
readonly HashSet<CPos> veinholeCells = new HashSet<CPos>();
|
||||
readonly HashSet<CPos> dirty = new();
|
||||
readonly Queue<CPos> cleanDirty = new();
|
||||
readonly HashSet<CPos> veinholeCells = new();
|
||||
readonly int maxDensity;
|
||||
readonly Color veinRadarColor;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user