Fix CA1852

This commit is contained in:
RoosterDragon
2023-03-13 18:49:21 +00:00
committed by Pavel Penev
parent 277699cbd5
commit f4af5c1764
310 changed files with 510 additions and 507 deletions

View File

@@ -17,7 +17,7 @@ using OpenRA.Traits;
namespace OpenRA.Mods.Common.Traits.Render
{
[Desc("Display the time remaining until the next cash is given by actor's CashTrickler trait.")]
class CashTricklerBarInfo : TraitInfo, Requires<CashTricklerInfo>
sealed class CashTricklerBarInfo : TraitInfo, Requires<CashTricklerInfo>
{
[Desc("Defines to which players the bar is to be shown.")]
public readonly PlayerRelationship DisplayRelationships = PlayerRelationship.Ally;
@@ -27,7 +27,7 @@ namespace OpenRA.Mods.Common.Traits.Render
public override object Create(ActorInitializer init) { return new CashTricklerBar(init.Self, this); }
}
class CashTricklerBar : ISelectionBar
sealed class CashTricklerBar : ISelectionBar
{
readonly Actor self;
readonly CashTricklerBarInfo info;

View File

@@ -19,14 +19,14 @@ namespace OpenRA.Mods.Common.Traits
{
[TraitLocation(SystemActors.World)]
[Desc("Displays custom terrain types.")]
class CustomTerrainDebugOverlayInfo : TraitInfo
sealed class CustomTerrainDebugOverlayInfo : TraitInfo
{
public readonly string Font = "TinyBold";
public override object Create(ActorInitializer init) { return new CustomTerrainDebugOverlay(this); }
}
class CustomTerrainDebugOverlay : IWorldLoaded, IChatCommand, IRenderAnnotations
sealed class CustomTerrainDebugOverlay : IWorldLoaded, IChatCommand, IRenderAnnotations
{
const string CommandName = "custom-terrain";

View File

@@ -16,7 +16,7 @@ using OpenRA.Traits;
namespace OpenRA.Mods.Common.Traits.Render
{
[Desc("Visualizes the remaining build time of actor produced here.")]
class ProductionBarInfo : ConditionalTraitInfo, Requires<ProductionInfo>, IRulesetLoaded
sealed class ProductionBarInfo : ConditionalTraitInfo, Requires<ProductionInfo>, IRulesetLoaded
{
[FieldLoader.Require]
[Desc("Production queue type, for actors with multiple queues.")]
@@ -41,7 +41,7 @@ namespace OpenRA.Mods.Common.Traits.Render
public override object Create(ActorInitializer init) { return new ProductionBar(init.Self, this); }
}
class ProductionBar : ConditionalTrait<ProductionBarInfo>, ISelectionBar, ITick, INotifyOwnerChanged
sealed class ProductionBar : ConditionalTrait<ProductionBarInfo>, ISelectionBar, ITick, INotifyOwnerChanged
{
readonly Actor self;
ProductionQueue queue;

View File

@@ -17,7 +17,7 @@ using OpenRA.Traits;
namespace OpenRA.Mods.Common.Traits.Render
{
[Desc("Visualizes the minimum remaining time for reloading the armaments.")]
class ReloadArmamentsBarInfo : TraitInfo
sealed class ReloadArmamentsBarInfo : TraitInfo
{
[Desc("Armament names")]
public readonly string[] Armaments = { "primary", "secondary" };
@@ -27,7 +27,7 @@ namespace OpenRA.Mods.Common.Traits.Render
public override object Create(ActorInitializer init) { return new ReloadArmamentsBar(init.Self, this); }
}
class ReloadArmamentsBar : ISelectionBar, INotifyCreated
sealed class ReloadArmamentsBar : ISelectionBar, INotifyCreated
{
readonly ReloadArmamentsBarInfo info;
readonly Actor self;

View File

@@ -19,14 +19,14 @@ using OpenRA.Traits;
namespace OpenRA.Mods.Common.Traits.Render
{
[Desc("Displays the actor's type and ID above the actor.")]
class RenderDebugStateInfo : TraitInfo
sealed class RenderDebugStateInfo : TraitInfo
{
public readonly string Font = "TinyBold";
public override object Create(ActorInitializer init) { return new RenderDebugState(init.Self, this); }
}
class RenderDebugState : INotifyAddedToWorld, INotifyOwnerChanged, INotifyCreated, IRenderAnnotationsWhenSelected
sealed class RenderDebugState : INotifyAddedToWorld, INotifyOwnerChanged, INotifyCreated, IRenderAnnotationsWhenSelected
{
readonly DebugVisualizations debugVis;
readonly SpriteFont font;

View File

@@ -18,7 +18,7 @@ using OpenRA.Traits;
namespace OpenRA.Mods.Common.Traits
{
// TODO: remove all the Render*Circle duplication
class RenderJammerCircleInfo : ConditionalTraitInfo, IPlaceBuildingDecorationInfo
sealed class RenderJammerCircleInfo : ConditionalTraitInfo, IPlaceBuildingDecorationInfo
{
[Desc("Range circle color.")]
public readonly Color Color = Color.FromArgb(128, Color.Red);
@@ -59,7 +59,7 @@ namespace OpenRA.Mods.Common.Traits
public override object Create(ActorInitializer init) { return new RenderJammerCircle(this); }
}
class RenderJammerCircle : ConditionalTrait<RenderJammerCircleInfo>, IRenderAnnotationsWhenSelected
sealed class RenderJammerCircle : ConditionalTrait<RenderJammerCircleInfo>, IRenderAnnotationsWhenSelected
{
readonly RenderJammerCircleInfo info;

View File

@@ -22,7 +22,7 @@ namespace OpenRA.Mods.Common.Traits.Render
public enum RangeCircleMode { Maximum, Minimum }
[Desc("Draw a circle indicating my weapon's range.")]
class RenderRangeCircleInfo : TraitInfo, IPlaceBuildingDecorationInfo, IRulesetLoaded, Requires<AttackBaseInfo>
sealed class RenderRangeCircleInfo : TraitInfo, IPlaceBuildingDecorationInfo, IRulesetLoaded, Requires<AttackBaseInfo>
{
public readonly string RangeCircleType = null;
@@ -85,7 +85,7 @@ namespace OpenRA.Mods.Common.Traits.Render
}
}
class RenderRangeCircle : IRenderAnnotationsWhenSelected
sealed class RenderRangeCircle : IRenderAnnotationsWhenSelected
{
public readonly RenderRangeCircleInfo Info;
readonly Actor self;

View File

@@ -18,7 +18,7 @@ using OpenRA.Traits;
namespace OpenRA.Mods.Common.Traits
{
class RenderShroudCircleInfo : ConditionalTraitInfo, IPlaceBuildingDecorationInfo
sealed class RenderShroudCircleInfo : ConditionalTraitInfo, IPlaceBuildingDecorationInfo
{
[Desc("Color of the circle.")]
public readonly Color Color = Color.FromArgb(128, Color.Cyan);
@@ -61,7 +61,7 @@ namespace OpenRA.Mods.Common.Traits
public override object Create(ActorInitializer init) { return new RenderShroudCircle(this); }
}
class RenderShroudCircle : ConditionalTrait<RenderShroudCircleInfo>, INotifyCreated, IRenderAnnotationsWhenSelected
sealed class RenderShroudCircle : ConditionalTrait<RenderShroudCircleInfo>, INotifyCreated, IRenderAnnotationsWhenSelected
{
readonly RenderShroudCircleInfo info;
WDist range;

View File

@@ -88,7 +88,7 @@ namespace OpenRA.Mods.Common.Traits.Render
(DamageState.Light, "scuffed-")
};
class AnimationWrapper
sealed class AnimationWrapper
{
public readonly AnimationWithOffset Animation;
public readonly string Palette;

View File

@@ -15,12 +15,12 @@ using OpenRA.Graphics;
namespace OpenRA.Mods.Common.Traits.Render
{
[Desc("Invisible during games.")]
class RenderSpritesEditorOnlyInfo : RenderSpritesInfo
sealed class RenderSpritesEditorOnlyInfo : RenderSpritesInfo
{
public override object Create(ActorInitializer init) { return new RenderSpritesEditorOnly(init, this); }
}
class RenderSpritesEditorOnly : RenderSprites
sealed class RenderSpritesEditorOnly : RenderSprites
{
public RenderSpritesEditorOnly(ActorInitializer init, RenderSpritesEditorOnlyInfo info)
: base(init, info) { }

View File

@@ -78,7 +78,7 @@ namespace OpenRA.Mods.Common.Traits.Render
public class RenderVoxels : IRender, ITick, INotifyOwnerChanged
{
class AnimationWrapper
sealed class AnimationWrapper
{
readonly ModelAnimation model;
bool cachedVisible;

View File

@@ -16,7 +16,7 @@ using OpenRA.Traits;
namespace OpenRA.Mods.Common.Traits.Render
{
[Desc("Display the time remaining until the super weapon attached to the actor is ready.")]
class SupportPowerChargeBarInfo : ConditionalTraitInfo
sealed class SupportPowerChargeBarInfo : ConditionalTraitInfo
{
[Desc("Defines to which players the bar is to be shown.")]
public readonly PlayerRelationship DisplayRelationships = PlayerRelationship.Ally;
@@ -26,7 +26,7 @@ namespace OpenRA.Mods.Common.Traits.Render
public override object Create(ActorInitializer init) { return new SupportPowerChargeBar(init.Self, this); }
}
class SupportPowerChargeBar : ConditionalTrait<SupportPowerChargeBarInfo>, ISelectionBar, INotifyOwnerChanged
sealed class SupportPowerChargeBar : ConditionalTrait<SupportPowerChargeBarInfo>, ISelectionBar, INotifyOwnerChanged
{
readonly Actor self;
SupportPowerManager spm;

View File

@@ -15,7 +15,7 @@ using OpenRA.Traits;
namespace OpenRA.Mods.Common.Traits.Render
{
[Desc("Visualizes the remaining time for a condition.")]
class TimedConditionBarInfo : TraitInfo
sealed class TimedConditionBarInfo : TraitInfo
{
[FieldLoader.Require]
[Desc("Condition that this bar corresponds to")]
@@ -26,7 +26,7 @@ namespace OpenRA.Mods.Common.Traits.Render
public override object Create(ActorInitializer init) { return new TimedConditionBar(init.Self, this); }
}
class TimedConditionBar : ISelectionBar, IConditionTimerWatcher
sealed class TimedConditionBar : ISelectionBar, IConditionTimerWatcher
{
readonly TimedConditionBarInfo info;
readonly Actor self;

View File

@@ -17,7 +17,7 @@ using OpenRA.Traits;
namespace OpenRA.Mods.Common.Traits.Render
{
class WithBridgeSpriteBodyInfo : WithSpriteBodyInfo
sealed class WithBridgeSpriteBodyInfo : WithSpriteBodyInfo
{
public readonly string Type = "GroundLevelBridge";
@@ -54,7 +54,7 @@ namespace OpenRA.Mods.Common.Traits.Render
}
}
class WithBridgeSpriteBody : WithSpriteBody, INotifyRemovedFromWorld
sealed class WithBridgeSpriteBody : WithSpriteBody, INotifyRemovedFromWorld
{
readonly WithBridgeSpriteBodyInfo bridgeInfo;
readonly BridgeLayer bridgeLayer;

View File

@@ -15,7 +15,7 @@ using OpenRA.Traits;
namespace OpenRA.Mods.Common.Traits.Render
{
[Desc("Render overlay that varies the animation frame based on the AttackCharges trait's charge level.")]
class WithChargeOverlayInfo : PausableConditionalTraitInfo, Requires<WithSpriteBodyInfo>, Requires<RenderSpritesInfo>
sealed class WithChargeOverlayInfo : PausableConditionalTraitInfo, Requires<WithSpriteBodyInfo>, Requires<RenderSpritesInfo>
{
[SequenceReference]
[Desc("Sequence to use for the charge levels.")]
@@ -31,7 +31,7 @@ namespace OpenRA.Mods.Common.Traits.Render
public override object Create(ActorInitializer init) { return new WithChargeOverlay(init.Self, this); }
}
class WithChargeOverlay : PausableConditionalTrait<WithChargeOverlayInfo>, INotifyDamageStateChanged
sealed class WithChargeOverlay : PausableConditionalTrait<WithChargeOverlayInfo>, INotifyDamageStateChanged
{
readonly Animation overlay;

View File

@@ -18,7 +18,7 @@ using OpenRA.Traits;
namespace OpenRA.Mods.Common.Traits.Render
{
[Desc("Renders crates with both water and land variants.")]
class WithCrateBodyInfo : TraitInfo, Requires<RenderSpritesInfo>, IRenderActorPreviewSpritesInfo
sealed class WithCrateBodyInfo : TraitInfo, Requires<RenderSpritesInfo>, IRenderActorPreviewSpritesInfo
{
[Desc("Easteregg sequences to use in December.")]
public readonly string[] XmasImages = Array.Empty<string>();
@@ -45,7 +45,7 @@ namespace OpenRA.Mods.Common.Traits.Render
}
}
class WithCrateBody : INotifyParachute, INotifyAddedToWorld
sealed class WithCrateBody : INotifyParachute, INotifyAddedToWorld
{
readonly Actor self;
readonly Animation anim;

View File

@@ -18,7 +18,7 @@ using OpenRA.Traits;
namespace OpenRA.Mods.Common.Traits.Render
{
class WithDeadBridgeSpriteBodyInfo : WithSpriteBodyInfo
sealed class WithDeadBridgeSpriteBodyInfo : WithSpriteBodyInfo
{
[ActorReference]
public readonly string[] RampActors = Array.Empty<string>();
@@ -61,7 +61,7 @@ namespace OpenRA.Mods.Common.Traits.Render
}
}
class WithDeadBridgeSpriteBody : WithSpriteBody
sealed class WithDeadBridgeSpriteBody : WithSpriteBody
{
readonly WithDeadBridgeSpriteBodyInfo bridgeInfo;
readonly BridgeLayer bridgeLayer;

View File

@@ -19,7 +19,7 @@ using OpenRA.Traits;
namespace OpenRA.Mods.Common.Traits.Render
{
[Desc("This actor visually connects to walls and changes appearance when actors walk through it.")]
class WithGateSpriteBodyInfo : WithSpriteBodyInfo, IWallConnectorInfo, Requires<GateInfo>
sealed class WithGateSpriteBodyInfo : WithSpriteBodyInfo, IWallConnectorInfo, Requires<GateInfo>
{
[Desc("Cells (outside the gate footprint) that contain wall cells that can connect to the gate")]
public readonly CVec[] WallConnections = Array.Empty<CVec>();
@@ -50,7 +50,7 @@ namespace OpenRA.Mods.Common.Traits.Render
}
}
class WithGateSpriteBody : WithSpriteBody, INotifyRemovedFromWorld, IWallConnector, ITick
sealed class WithGateSpriteBody : WithSpriteBody, INotifyRemovedFromWorld, IWallConnector, ITick
{
readonly WithGateSpriteBodyInfo gateBodyInfo;
readonly Gate gate;

View File

@@ -15,7 +15,7 @@ using OpenRA.Traits;
namespace OpenRA.Mods.Common.Traits.Render
{
[Desc("Displays an overlay whenever resources are harvested by the actor.")]
class WithHarvestOverlayInfo : TraitInfo, Requires<RenderSpritesInfo>, Requires<BodyOrientationInfo>
sealed class WithHarvestOverlayInfo : TraitInfo, Requires<RenderSpritesInfo>, Requires<BodyOrientationInfo>
{
[SequenceReference]
[Desc("Sequence name to use")]
@@ -30,7 +30,7 @@ namespace OpenRA.Mods.Common.Traits.Render
public override object Create(ActorInitializer init) { return new WithHarvestOverlay(init.Self, this); }
}
class WithHarvestOverlay : INotifyHarvesterAction
sealed class WithHarvestOverlay : INotifyHarvesterAction
{
readonly WithHarvestOverlayInfo info;
readonly Animation anim;

View File

@@ -19,7 +19,7 @@ using OpenRA.Traits;
namespace OpenRA.Mods.Common.Traits.Render
{
[Desc("Renders the MuzzleSequence from the Armament trait.")]
class WithMuzzleOverlayInfo : ConditionalTraitInfo, Requires<RenderSpritesInfo>, Requires<AttackBaseInfo>, Requires<ArmamentInfo>
sealed class WithMuzzleOverlayInfo : ConditionalTraitInfo, Requires<RenderSpritesInfo>, Requires<AttackBaseInfo>, Requires<ArmamentInfo>
{
[Desc("Ignore the weapon position, and always draw relative to the center of the actor")]
public readonly bool IgnoreOffset = false;
@@ -27,7 +27,7 @@ namespace OpenRA.Mods.Common.Traits.Render
public override object Create(ActorInitializer init) { return new WithMuzzleOverlay(init.Self, this); }
}
class WithMuzzleOverlay : ConditionalTrait<WithMuzzleOverlayInfo>, INotifyAttack, IRender, ITick
sealed class WithMuzzleOverlay : ConditionalTrait<WithMuzzleOverlayInfo>, INotifyAttack, IRender, ITick
{
readonly Dictionary<Barrel, bool> visible = new();
readonly Dictionary<Barrel, AnimationWithOffset> anims = new();

View File

@@ -17,7 +17,7 @@ using OpenRA.Traits;
namespace OpenRA.Mods.Common.Traits.Render
{
[Desc("Play an animation when a unit exits or blocks the exit after production finished.")]
class WithProductionDoorOverlayInfo : ConditionalTraitInfo, IRenderActorPreviewSpritesInfo, Requires<RenderSpritesInfo>, Requires<BodyOrientationInfo>, Requires<BuildingInfo>
sealed class WithProductionDoorOverlayInfo : ConditionalTraitInfo, IRenderActorPreviewSpritesInfo, Requires<RenderSpritesInfo>, Requires<BodyOrientationInfo>, Requires<BuildingInfo>
{
[SequenceReference]
public readonly string Sequence = "build-door";
@@ -35,7 +35,7 @@ namespace OpenRA.Mods.Common.Traits.Render
public override object Create(ActorInitializer init) { return new WithProductionDoorOverlay(init.Self, this); }
}
class WithProductionDoorOverlay : ConditionalTrait<WithProductionDoorOverlayInfo>, ITick, INotifyProduction, INotifyDamageStateChanged
sealed class WithProductionDoorOverlay : ConditionalTrait<WithProductionDoorOverlayInfo>, ITick, INotifyProduction, INotifyDamageStateChanged
{
readonly Animation door;
int desiredFrame;

View File

@@ -20,7 +20,7 @@ namespace OpenRA.Mods.Common.Traits.Render
public enum RangeCircleVisibility { Always, WhenSelected }
[Desc("Renders an arbitrary circle when selected or placing a structure")]
class WithRangeCircleInfo : ConditionalTraitInfo, IPlaceBuildingDecorationInfo
sealed class WithRangeCircleInfo : ConditionalTraitInfo, IPlaceBuildingDecorationInfo
{
[Desc("Type of range circle. used to decide which circles to draw on other structures during building placement.")]
public readonly string Type = null;
@@ -73,7 +73,7 @@ namespace OpenRA.Mods.Common.Traits.Render
public override object Create(ActorInitializer init) { return new WithRangeCircle(init.Self, this); }
}
class WithRangeCircle : ConditionalTrait<WithRangeCircleInfo>, IRenderAnnotationsWhenSelected, IRenderAnnotations
sealed class WithRangeCircle : ConditionalTrait<WithRangeCircleInfo>, IRenderAnnotationsWhenSelected, IRenderAnnotations
{
readonly Actor self;

View File

@@ -15,7 +15,7 @@ using OpenRA.Traits;
namespace OpenRA.Mods.Common.Traits.Render
{
[Desc("Displays the fill status of PlayerResources with an extra sprite overlay on the actor.")]
class WithResourceLevelOverlayInfo : ConditionalTraitInfo, Requires<WithSpriteBodyInfo>, Requires<RenderSpritesInfo>
sealed class WithResourceLevelOverlayInfo : ConditionalTraitInfo, Requires<WithSpriteBodyInfo>, Requires<RenderSpritesInfo>
{
[SequenceReference]
[Desc("Sequence name to use")]
@@ -31,7 +31,7 @@ namespace OpenRA.Mods.Common.Traits.Render
public override object Create(ActorInitializer init) { return new WithResourceLevelOverlay(init.Self, this); }
}
class WithResourceLevelOverlay : ConditionalTrait<WithResourceLevelOverlayInfo>, INotifyOwnerChanged, INotifyDamageStateChanged
sealed class WithResourceLevelOverlay : ConditionalTrait<WithResourceLevelOverlayInfo>, INotifyOwnerChanged, INotifyDamageStateChanged
{
readonly AnimationWithOffset anim;
readonly RenderSprites rs;

View File

@@ -25,7 +25,7 @@ namespace OpenRA.Mods.Common.Traits.Render
}
[Desc("Render trait for actors that change sprites if neighbors with the same trait are present.")]
class WithWallSpriteBodyInfo : WithSpriteBodyInfo, IWallConnectorInfo, Requires<BuildingInfo>
sealed class WithWallSpriteBodyInfo : WithSpriteBodyInfo, IWallConnectorInfo, Requires<BuildingInfo>
{
public readonly string Type = "wall";
@@ -82,7 +82,7 @@ namespace OpenRA.Mods.Common.Traits.Render
}
}
class WithWallSpriteBody : WithSpriteBody, INotifyRemovedFromWorld, IWallConnector, ITick
sealed class WithWallSpriteBody : WithSpriteBody, INotifyRemovedFromWorld, IWallConnector, ITick
{
readonly WithWallSpriteBodyInfo wallInfo;
int adjacent = 0;