Fix IDE0090
This commit is contained in:
committed by
Pavel Penev
parent
164abfdae1
commit
8a285f9b19
@@ -34,7 +34,7 @@ namespace OpenRA.Mods.Common.Traits
|
||||
public readonly int TrailDelay = 0;
|
||||
|
||||
[Desc("Thickness of the emitted line.")]
|
||||
public readonly WDist TrailWidth = new WDist(64);
|
||||
public readonly WDist TrailWidth = new(64);
|
||||
|
||||
[Desc("RGB color at the contrail start.")]
|
||||
public readonly Color StartColor = Color.White;
|
||||
|
||||
@@ -41,7 +41,7 @@ namespace OpenRA.Mods.Common.Traits
|
||||
public class DrawLineToTarget : IRenderAboveShroud, IRenderAnnotationsWhenSelected, INotifySelected
|
||||
{
|
||||
readonly DrawLineToTargetInfo info;
|
||||
readonly List<IRenderable> renderableCache = new List<IRenderable>();
|
||||
readonly List<IRenderable> renderableCache = new();
|
||||
long lifetime;
|
||||
|
||||
public DrawLineToTarget(DrawLineToTargetInfo info)
|
||||
|
||||
@@ -22,7 +22,7 @@ namespace OpenRA.Mods.Common.Traits.Render
|
||||
public class HoversInfo : ConditionalTraitInfo, Requires<IMoveInfo>
|
||||
{
|
||||
[Desc("Maximum visual Z axis distance relative to actual position + InitialHeight.")]
|
||||
public readonly WDist BobDistance = new WDist(-43);
|
||||
public readonly WDist BobDistance = new(-43);
|
||||
|
||||
[Desc("Actual altitude of actor needs to be this or higher to enable hover effect.")]
|
||||
public readonly WDist MinHoveringAltitude = WDist.Zero;
|
||||
@@ -37,7 +37,7 @@ namespace OpenRA.Mods.Common.Traits.Render
|
||||
public readonly int RiseTicks = 20;
|
||||
|
||||
[Desc("Initial Z axis modifier relative to actual position.")]
|
||||
public readonly WDist InitialHeight = new WDist(43);
|
||||
public readonly WDist InitialHeight = new(43);
|
||||
|
||||
public override object Create(ActorInitializer init) { return new Hovers(this); }
|
||||
|
||||
|
||||
@@ -30,7 +30,7 @@ namespace OpenRA.Mods.Common.Traits.Render
|
||||
public readonly string Palette = "effect";
|
||||
|
||||
[Desc("Only leave trail on listed terrain types. Leave empty to leave trail on all terrain types.")]
|
||||
public readonly HashSet<string> TerrainTypes = new HashSet<string>();
|
||||
public readonly HashSet<string> TerrainTypes = new();
|
||||
|
||||
[Desc("Accepts values: Cell to draw the trail sprite in the center of the current cell,",
|
||||
"CenterPosition to draw the trail sprite at the current position.")]
|
||||
|
||||
@@ -57,7 +57,7 @@ namespace OpenRA.Mods.Common.Traits.Render
|
||||
// This makes sure that the keys are unique with respect to the registering ITechTreeElement.
|
||||
readonly string prefix;
|
||||
|
||||
readonly Dictionary<ActorInfo, bool> overlayActive = new Dictionary<ActorInfo, bool>();
|
||||
readonly Dictionary<ActorInfo, bool> overlayActive = new();
|
||||
|
||||
public ProductionIconOverlayManager(ActorInitializer init, ProductionIconOverlayManagerInfo info)
|
||||
{
|
||||
|
||||
@@ -23,7 +23,7 @@ namespace OpenRA.Mods.Common.Traits.Render
|
||||
public class RenderDetectionCircleInfo : TraitInfo, Requires<DetectCloakedInfo>
|
||||
{
|
||||
[Desc("WAngle the Radar update line advances per tick.")]
|
||||
public readonly WAngle UpdateLineTick = new WAngle(-1);
|
||||
public readonly WAngle UpdateLineTick = new(-1);
|
||||
|
||||
[Desc("Number of trailing Radar update lines.")]
|
||||
public readonly int TrailCount = 0;
|
||||
|
||||
@@ -141,7 +141,7 @@ namespace OpenRA.Mods.Common.Traits.Render
|
||||
|
||||
public readonly RenderSpritesInfo Info;
|
||||
readonly string faction;
|
||||
readonly List<AnimationWrapper> anims = new List<AnimationWrapper>();
|
||||
readonly List<AnimationWrapper> anims = new();
|
||||
string cachedImage;
|
||||
|
||||
public static Func<WAngle> MakeFacingFunc(Actor self)
|
||||
|
||||
@@ -105,8 +105,8 @@ namespace OpenRA.Mods.Common.Traits.Render
|
||||
|
||||
public readonly RenderVoxelsInfo Info;
|
||||
|
||||
readonly List<ModelAnimation> components = new List<ModelAnimation>();
|
||||
readonly Dictionary<ModelAnimation, AnimationWrapper> wrappers = new Dictionary<ModelAnimation, AnimationWrapper>();
|
||||
readonly List<ModelAnimation> components = new();
|
||||
readonly Dictionary<ModelAnimation, AnimationWrapper> wrappers = new();
|
||||
|
||||
readonly Actor self;
|
||||
readonly BodyOrientation body;
|
||||
|
||||
@@ -32,10 +32,10 @@ namespace OpenRA.Mods.Common.Traits.Render
|
||||
public readonly bool VisibleThroughFog = false;
|
||||
|
||||
[Desc("Height at which to play the animation when descending.")]
|
||||
public readonly WDist DistanceAboveTerrain = new WDist(756);
|
||||
public readonly WDist DistanceAboveTerrain = new(756);
|
||||
|
||||
[Desc("Only play on these terrain types.")]
|
||||
public readonly HashSet<string> TerrainTypes = new HashSet<string>();
|
||||
public readonly HashSet<string> TerrainTypes = new();
|
||||
|
||||
public override object Create(ActorInitializer init) { return new WithAircraftLandingEffect(this); }
|
||||
}
|
||||
|
||||
@@ -36,7 +36,7 @@ namespace OpenRA.Mods.Common.Traits.Render
|
||||
|
||||
[SequenceReference(nameof(Image), dictionaryReference: LintDictionaryReference.Values)]
|
||||
[Desc("Pip sequence to use for specific passenger actors.")]
|
||||
public readonly Dictionary<string, string> CustomPipSequences = new Dictionary<string, string>();
|
||||
public readonly Dictionary<string, string> CustomPipSequences = new();
|
||||
|
||||
[PaletteReference]
|
||||
public readonly string Palette = "chrome";
|
||||
|
||||
@@ -24,7 +24,7 @@ namespace OpenRA.Mods.Common.Traits.Render
|
||||
public readonly string[] XmasImages = Array.Empty<string>();
|
||||
|
||||
[Desc("Terrain types on which to display WaterSequence.")]
|
||||
public readonly HashSet<string> WaterTerrainTypes = new HashSet<string> { "Water" };
|
||||
public readonly HashSet<string> WaterTerrainTypes = new() { "Water" };
|
||||
|
||||
[SequenceReference]
|
||||
public readonly string IdleSequence = "idle";
|
||||
|
||||
@@ -47,7 +47,7 @@ namespace OpenRA.Mods.Common.Traits.Render
|
||||
|
||||
[Desc("Death animations to use for each damage type (defined on the warheads).",
|
||||
"Is only used if UseDeathTypeSuffix is `True`.")]
|
||||
public readonly Dictionary<string, string[]> DeathTypes = new Dictionary<string, string[]>();
|
||||
public readonly Dictionary<string, string[]> DeathTypes = new();
|
||||
|
||||
[SequenceReference]
|
||||
[Desc("Sequence to use when the actor is killed by some non-standard means (e.g. suicide).")]
|
||||
|
||||
@@ -36,7 +36,7 @@ namespace OpenRA.Mods.Common.Traits.Render
|
||||
|
||||
[Desc("Screen-space offsets to apply when defined conditions are enabled.",
|
||||
"A dictionary of [condition string]: [x, y offset].")]
|
||||
public readonly Dictionary<BooleanExpression, int2> Offsets = new Dictionary<BooleanExpression, int2>();
|
||||
public readonly Dictionary<BooleanExpression, int2> Offsets = new();
|
||||
|
||||
[Desc("The number of ticks that each step in the blink pattern in active.")]
|
||||
public readonly int BlinkInterval = 5;
|
||||
@@ -46,7 +46,7 @@ namespace OpenRA.Mods.Common.Traits.Render
|
||||
|
||||
[Desc("Override blink conditions to use when defined conditions are enabled.",
|
||||
"A dictionary of [condition string]: [pattern].")]
|
||||
public readonly Dictionary<BooleanExpression, BlinkState[]> BlinkPatterns = new Dictionary<BooleanExpression, BlinkState[]>();
|
||||
public readonly Dictionary<BooleanExpression, BlinkState[]> BlinkPatterns = new();
|
||||
|
||||
[ConsumedConditionReference]
|
||||
public IEnumerable<string> ConsumedConditions
|
||||
|
||||
@@ -37,7 +37,7 @@ namespace OpenRA.Mods.Common.Traits.Render
|
||||
|
||||
[SequenceReference(nameof(Image), dictionaryReference: LintDictionaryReference.Values)]
|
||||
[Desc("Pip sequence to use for specific resource types.")]
|
||||
public readonly Dictionary<string, string> ResourceSequences = new Dictionary<string, string>();
|
||||
public readonly Dictionary<string, string> ResourceSequences = new();
|
||||
|
||||
[PaletteReference]
|
||||
public readonly string Palette = "chrome";
|
||||
|
||||
@@ -33,7 +33,7 @@ namespace OpenRA.Mods.Common.Traits.Render
|
||||
[Desc("Attack sequence to use for each armament.",
|
||||
"A dictionary of [armament name]: [sequence name(s)].",
|
||||
"Multiple sequence names can be defined to specify per-burst animations.")]
|
||||
public readonly Dictionary<string, string[]> AttackSequences = new Dictionary<string, string[]>();
|
||||
public readonly Dictionary<string, string[]> AttackSequences = new();
|
||||
|
||||
[SequenceReference]
|
||||
public readonly string[] IdleSequences = Array.Empty<string>();
|
||||
|
||||
@@ -29,8 +29,8 @@ namespace OpenRA.Mods.Common.Traits.Render
|
||||
|
||||
class WithMuzzleOverlay : ConditionalTrait<WithMuzzleOverlayInfo>, INotifyAttack, IRender, ITick
|
||||
{
|
||||
readonly Dictionary<Barrel, bool> visible = new Dictionary<Barrel, bool>();
|
||||
readonly Dictionary<Barrel, AnimationWithOffset> anims = new Dictionary<Barrel, AnimationWithOffset>();
|
||||
readonly Dictionary<Barrel, bool> visible = new();
|
||||
readonly Dictionary<Barrel, AnimationWithOffset> anims = new();
|
||||
readonly Func<WAngle> getFacing;
|
||||
readonly Armament[] armaments;
|
||||
|
||||
|
||||
@@ -44,7 +44,7 @@ namespace OpenRA.Mods.Common.Traits.Render
|
||||
public readonly bool IsPlayerPalette = true;
|
||||
|
||||
[Desc("Parachute position relative to the paradropped unit.")]
|
||||
public readonly WVec Offset = new WVec(0, 0, 384);
|
||||
public readonly WVec Offset = new(0, 0, 384);
|
||||
|
||||
[Desc("The image that contains the shadow sequence for the paradropped unit.")]
|
||||
public readonly string ShadowImage = null;
|
||||
@@ -57,7 +57,7 @@ namespace OpenRA.Mods.Common.Traits.Render
|
||||
public readonly Color ShadowColor = Color.FromArgb(140, 0, 0, 0);
|
||||
|
||||
[Desc("Shadow position relative to the paradropped unit's intended landing position.")]
|
||||
public readonly WVec ShadowOffset = new WVec(0, 128, 0);
|
||||
public readonly WVec ShadowOffset = new(0, 128, 0);
|
||||
|
||||
[Desc("Z-offset to apply on the shadow sequence.")]
|
||||
public readonly int ShadowZOffset = 0;
|
||||
|
||||
@@ -21,7 +21,7 @@ namespace OpenRA.Mods.Common.Traits.Render
|
||||
public class WithProductionOverlayInfo : PausableConditionalTraitInfo, Requires<RenderSpritesInfo>, Requires<BodyOrientationInfo>, Requires<ProductionInfo>
|
||||
{
|
||||
[Desc("Queues that should be producing for this overlay to render.")]
|
||||
public readonly HashSet<string> Queues = new HashSet<string>();
|
||||
public readonly HashSet<string> Queues = new();
|
||||
|
||||
[SequenceReference]
|
||||
[Desc("Sequence name to use")]
|
||||
|
||||
Reference in New Issue
Block a user