diff --git a/.editorconfig b/.editorconfig index 18c616fd83..d05ad1af27 100644 --- a/.editorconfig +++ b/.editorconfig @@ -772,6 +772,9 @@ dotnet_diagnostic.CA1849.severity = warning # Prefer static HashData method over ComputeHash. (Not available on mono) dotnet_diagnostic.CA1850.severity = none +# Seal internal types. +dotnet_diagnostic.CA1852.severity = warning + # Unnecessary call to 'Dictionary.ContainsKey(key)'. dotnet_diagnostic.CA1853.severity = warning diff --git a/OpenRA.Game/Actor.cs b/OpenRA.Game/Actor.cs index c43e698778..03b5139901 100644 --- a/OpenRA.Game/Actor.cs +++ b/OpenRA.Game/Actor.cs @@ -81,7 +81,7 @@ namespace OpenRA /// Value used to represent an invalid token. public static readonly int InvalidConditionToken = -1; - class ConditionState + sealed class ConditionState { /// Delegates that have registered to be notified when this condition changes. public readonly List Notifiers = new(); diff --git a/OpenRA.Game/FileSystem/ZipFile.cs b/OpenRA.Game/FileSystem/ZipFile.cs index cf6709f088..c335b083ae 100644 --- a/OpenRA.Game/FileSystem/ZipFile.cs +++ b/OpenRA.Game/FileSystem/ZipFile.cs @@ -190,7 +190,7 @@ namespace OpenRA.FileSystem public void Dispose() { /* nothing to do */ } } - class StaticStreamDataSource : IStaticDataSource + sealed class StaticStreamDataSource : IStaticDataSource { readonly Stream s; public StaticStreamDataSource(Stream s) diff --git a/OpenRA.Game/Graphics/CursorManager.cs b/OpenRA.Game/Graphics/CursorManager.cs index 425a2b33cf..0160d4b410 100644 --- a/OpenRA.Game/Graphics/CursorManager.cs +++ b/OpenRA.Game/Graphics/CursorManager.cs @@ -17,7 +17,7 @@ namespace OpenRA.Graphics { public sealed class CursorManager { - class Cursor + sealed class Cursor { public string Name; public int2 PaddedSize; diff --git a/OpenRA.Game/Graphics/Model.cs b/OpenRA.Game/Graphics/Model.cs index 458f24af96..30ece91622 100644 --- a/OpenRA.Game/Graphics/Model.cs +++ b/OpenRA.Game/Graphics/Model.cs @@ -62,7 +62,7 @@ namespace OpenRA.Graphics { public Action OnMissingModelError { get; set; } - class PlaceholderModelCache : IModelCache + sealed class PlaceholderModelCache : IModelCache { public IVertexBuffer VertexBuffer => throw new NotImplementedException(); diff --git a/OpenRA.Game/Graphics/Palette.cs b/OpenRA.Game/Graphics/Palette.cs index 186cae3574..97c61b3ea9 100644 --- a/OpenRA.Game/Graphics/Palette.cs +++ b/OpenRA.Game/Graphics/Palette.cs @@ -40,7 +40,7 @@ namespace OpenRA.Graphics return new ReadOnlyPalette(palette); } - class ReadOnlyPalette : IPalette + sealed class ReadOnlyPalette : IPalette { readonly IPalette palette; public ReadOnlyPalette(IPalette palette) { this.palette = palette; } diff --git a/OpenRA.Game/Graphics/SpriteFont.cs b/OpenRA.Game/Graphics/SpriteFont.cs index c120e73fef..a48ef63e8a 100644 --- a/OpenRA.Game/Graphics/SpriteFont.cs +++ b/OpenRA.Game/Graphics/SpriteFont.cs @@ -427,7 +427,7 @@ namespace OpenRA.Graphics } } - class GlyphInfo + sealed class GlyphInfo { public float Advance; public int2 Offset; diff --git a/OpenRA.Game/Map/Map.cs b/OpenRA.Game/Map/Map.cs index dfe1b6ea1d..4b51221224 100644 --- a/OpenRA.Game/Map/Map.cs +++ b/OpenRA.Game/Map/Map.cs @@ -65,7 +65,7 @@ namespace OpenRA MissionSelector = 4 } - class MapField + sealed class MapField { enum Type { Normal, NodeList, MiniYaml } readonly FieldInfo field; diff --git a/OpenRA.Game/Map/MapPreview.cs b/OpenRA.Game/Map/MapPreview.cs index 23a367ff67..cdfa253ea9 100644 --- a/OpenRA.Game/Map/MapPreview.cs +++ b/OpenRA.Game/Map/MapPreview.cs @@ -64,7 +64,7 @@ namespace OpenRA public class MapPreview : IDisposable, IReadOnlyFileSystem { /// Wrapper that enables map data to be replaced in an atomic fashion. - class InnerData + sealed class InnerData { public int MapFormat; public string Title; diff --git a/OpenRA.Game/Network/GeoIP.cs b/OpenRA.Game/Network/GeoIP.cs index cb1b4f1c70..834dd8f644 100644 --- a/OpenRA.Game/Network/GeoIP.cs +++ b/OpenRA.Game/Network/GeoIP.cs @@ -21,7 +21,7 @@ namespace OpenRA.Network { public class GeoIP { - class IP2LocationReader + sealed class IP2LocationReader { public readonly DateTime Date; readonly Stream stream; diff --git a/OpenRA.Game/Network/ReplayConnection.cs b/OpenRA.Game/Network/ReplayConnection.cs index 38d0b20eb5..e03d46bbcb 100644 --- a/OpenRA.Game/Network/ReplayConnection.cs +++ b/OpenRA.Game/Network/ReplayConnection.cs @@ -18,7 +18,7 @@ namespace OpenRA.Network { public sealed class ReplayConnection : IConnection { - class Chunk + sealed class Chunk { public int Frame; public (int ClientId, byte[] Packet)[] Packets; diff --git a/OpenRA.Game/Network/SyncReport.cs b/OpenRA.Game/Network/SyncReport.cs index bc18936c8c..6b3874ba26 100644 --- a/OpenRA.Game/Network/SyncReport.cs +++ b/OpenRA.Game/Network/SyncReport.cs @@ -19,7 +19,7 @@ using OpenRA.Primitives; namespace OpenRA.Network { - class SyncReport + sealed class SyncReport { const int NumSyncReports = 7; static readonly Cache TypeInfoCache = new(t => new TypeInfo(t)); @@ -161,7 +161,7 @@ namespace OpenRA.Network Log.Write("sync", $"Recorded frames do not contain the frame {frame}. No sync report available!"); } - class Report + sealed class Report { public int Frame; public int SyncedRandom; diff --git a/OpenRA.Game/Server/PlayerMessageTracker.cs b/OpenRA.Game/Server/PlayerMessageTracker.cs index 309955aa07..e4dce54b84 100644 --- a/OpenRA.Game/Server/PlayerMessageTracker.cs +++ b/OpenRA.Game/Server/PlayerMessageTracker.cs @@ -14,7 +14,7 @@ using System.Collections.Generic; namespace OpenRA.Server { - class PlayerMessageTracker + sealed class PlayerMessageTracker { [TranslationReference("remaining")] const string ChatTemporaryDisabled = "notification-chat-temp-disabled"; diff --git a/OpenRA.Game/Server/Server.cs b/OpenRA.Game/Server/Server.cs index 815e8fdb48..4d1002a93d 100644 --- a/OpenRA.Game/Server/Server.cs +++ b/OpenRA.Game/Server/Server.cs @@ -1441,7 +1441,7 @@ namespace OpenRA.Server interface IServerEvent { void Invoke(Server server); } - class ConnectionConnectEvent : IServerEvent + sealed class ConnectionConnectEvent : IServerEvent { readonly Socket socket; public ConnectionConnectEvent(Socket socket) @@ -1455,7 +1455,7 @@ namespace OpenRA.Server } } - class ConnectionDisconnectEvent : IServerEvent + sealed class ConnectionDisconnectEvent : IServerEvent { readonly Connection connection; public ConnectionDisconnectEvent(Connection connection) @@ -1469,7 +1469,7 @@ namespace OpenRA.Server } } - class ConnectionPacketEvent : IServerEvent + sealed class ConnectionPacketEvent : IServerEvent { readonly Connection connection; readonly int frame; @@ -1488,7 +1488,7 @@ namespace OpenRA.Server } } - class ConnectionPingEvent : IServerEvent + sealed class ConnectionPingEvent : IServerEvent { readonly Connection connection; readonly int[] pingHistory; @@ -1511,7 +1511,7 @@ namespace OpenRA.Server } } - class CallbackEvent : IServerEvent + sealed class CallbackEvent : IServerEvent { readonly Action action; diff --git a/OpenRA.Game/Support/AssemblyLoader.cs b/OpenRA.Game/Support/AssemblyLoader.cs index d876b2ec87..00a093e566 100644 --- a/OpenRA.Game/Support/AssemblyLoader.cs +++ b/OpenRA.Game/Support/AssemblyLoader.cs @@ -97,7 +97,7 @@ namespace OpenRA.Support } } - class ManagedLoadContext : AssemblyLoadContext + sealed class ManagedLoadContext : AssemblyLoadContext { readonly string basePath; readonly Dictionary managedAssemblies; diff --git a/OpenRA.Game/Support/Benchmark.cs b/OpenRA.Game/Support/Benchmark.cs index e881ccdbe0..3117544bdc 100644 --- a/OpenRA.Game/Support/Benchmark.cs +++ b/OpenRA.Game/Support/Benchmark.cs @@ -14,7 +14,7 @@ using System.Globalization; namespace OpenRA.Support { - class Benchmark + sealed class Benchmark { readonly string prefix; readonly Dictionary> samples = new(); @@ -30,7 +30,7 @@ namespace OpenRA.Support samples.GetOrAdd(item.Key).Add(new BenchmarkPoint(localTick, item.Value.LastValue)); } - class BenchmarkPoint + sealed class BenchmarkPoint { public int Tick { get; } public double Value { get; } diff --git a/OpenRA.Game/Support/VariableExpression.cs b/OpenRA.Game/Support/VariableExpression.cs index ec2065db16..6b00eecfcc 100644 --- a/OpenRA.Game/Support/VariableExpression.cs +++ b/OpenRA.Game/Support/VariableExpression.cs @@ -551,7 +551,7 @@ namespace OpenRA.Support } } - class VariableToken : Token + sealed class VariableToken : Token { public readonly string Name; @@ -561,7 +561,7 @@ namespace OpenRA.Support : base(TokenType.Variable, index) { Name = symbol; } } - class NumberToken : Token + sealed class NumberToken : Token { public readonly int Value; readonly string symbol; @@ -714,7 +714,7 @@ namespace OpenRA.Support return Expressions.Expression.Condition(test, ifTrue, ifFalse); } - class AstStack + sealed class AstStack { readonly List expressions = new(); readonly List types = new(); @@ -772,7 +772,7 @@ namespace OpenRA.Support } } - class Compiler + sealed class Compiler { readonly AstStack ast = new(); diff --git a/OpenRA.Game/TraitDictionary.cs b/OpenRA.Game/TraitDictionary.cs index afcb74a539..d71ff980de 100644 --- a/OpenRA.Game/TraitDictionary.cs +++ b/OpenRA.Game/TraitDictionary.cs @@ -39,7 +39,7 @@ namespace OpenRA /// /// Provides efficient ways to query a set of actors by their traits. /// - class TraitDictionary + sealed class TraitDictionary { static readonly Func CreateTraitContainer = t => (ITraitContainer)typeof(TraitContainer<>).MakeGenericType(t).GetConstructor(Type.EmptyTypes).Invoke(null); @@ -141,7 +141,7 @@ namespace OpenRA int Queries { get; } } - class TraitContainer : ITraitContainer + sealed class TraitContainer : ITraitContainer { readonly List actors = new(); readonly List traits = new(); @@ -185,7 +185,7 @@ namespace OpenRA return new MultipleEnumerable(this, actor); } - class MultipleEnumerable : IEnumerable + sealed class MultipleEnumerable : IEnumerable { readonly TraitContainer container; readonly uint actor; diff --git a/OpenRA.Game/Traits/Player/Shroud.cs b/OpenRA.Game/Traits/Player/Shroud.cs index 3bb5cf35a9..c106baa3c2 100644 --- a/OpenRA.Game/Traits/Player/Shroud.cs +++ b/OpenRA.Game/Traits/Player/Shroud.cs @@ -76,7 +76,7 @@ namespace OpenRA.Traits public int RevealedCells { get; private set; } enum ShroudCellType : byte { Shroud, Fog, Visible } - class ShroudSource + sealed class ShroudSource { public readonly SourceType Type; public readonly PPos[] ProjectedCells; diff --git a/OpenRA.Game/UtilityCommands/ClearInvalidModRegistrationsCommand.cs b/OpenRA.Game/UtilityCommands/ClearInvalidModRegistrationsCommand.cs index 4a8a50ec8d..745c3a2670 100644 --- a/OpenRA.Game/UtilityCommands/ClearInvalidModRegistrationsCommand.cs +++ b/OpenRA.Game/UtilityCommands/ClearInvalidModRegistrationsCommand.cs @@ -13,7 +13,7 @@ using System.Linq; namespace OpenRA.UtilityCommands { - class ClearInvalidModRegistrationsCommand : IUtilityCommand + sealed class ClearInvalidModRegistrationsCommand : IUtilityCommand { string IUtilityCommand.Name => "--clear-invalid-mod-registrations"; diff --git a/OpenRA.Game/UtilityCommands/RegisterModCommand.cs b/OpenRA.Game/UtilityCommands/RegisterModCommand.cs index 7697d6f840..b1de8432c5 100644 --- a/OpenRA.Game/UtilityCommands/RegisterModCommand.cs +++ b/OpenRA.Game/UtilityCommands/RegisterModCommand.cs @@ -13,7 +13,7 @@ using System.Linq; namespace OpenRA.UtilityCommands { - class RegisterModCommand : IUtilityCommand + sealed class RegisterModCommand : IUtilityCommand { string IUtilityCommand.Name => "--register-mod"; diff --git a/OpenRA.Game/UtilityCommands/UnregisterModCommand.cs b/OpenRA.Game/UtilityCommands/UnregisterModCommand.cs index 6234ffa668..2da214ff14 100644 --- a/OpenRA.Game/UtilityCommands/UnregisterModCommand.cs +++ b/OpenRA.Game/UtilityCommands/UnregisterModCommand.cs @@ -13,7 +13,7 @@ using System.Linq; namespace OpenRA.UtilityCommands { - class UnregisterModCommand : IUtilityCommand + sealed class UnregisterModCommand : IUtilityCommand { string IUtilityCommand.Name => "--unregister-mod"; diff --git a/OpenRA.Mods.Cnc/Activities/Infiltrate.cs b/OpenRA.Mods.Cnc/Activities/Infiltrate.cs index dae87cc046..05cb5bf719 100644 --- a/OpenRA.Mods.Cnc/Activities/Infiltrate.cs +++ b/OpenRA.Mods.Cnc/Activities/Infiltrate.cs @@ -18,7 +18,7 @@ using OpenRA.Traits; namespace OpenRA.Mods.Cnc.Activities { - class Infiltrate : Enter + sealed class Infiltrate : Enter { readonly Infiltrates infiltrates; readonly INotifyInfiltration[] notifiers; diff --git a/OpenRA.Mods.Cnc/Effects/GpsDotEffect.cs b/OpenRA.Mods.Cnc/Effects/GpsDotEffect.cs index 652c441d84..69040ea049 100644 --- a/OpenRA.Mods.Cnc/Effects/GpsDotEffect.cs +++ b/OpenRA.Mods.Cnc/Effects/GpsDotEffect.cs @@ -19,7 +19,7 @@ using OpenRA.Traits; namespace OpenRA.Mods.Cnc.Effects { - class GpsDotEffect : IEffect, IEffectAnnotation + sealed class GpsDotEffect : IEffect, IEffectAnnotation { readonly Actor actor; readonly GpsDotInfo info; @@ -28,7 +28,7 @@ namespace OpenRA.Mods.Cnc.Effects readonly PlayerDictionary dotStates; readonly IVisibilityModifier[] visibilityModifiers; - class DotState + sealed class DotState { public readonly GpsWatcher Watcher; public readonly bool FrozenActorWithRenderables; diff --git a/OpenRA.Mods.Cnc/Effects/GpsSatellite.cs b/OpenRA.Mods.Cnc/Effects/GpsSatellite.cs index 5f5a84f019..362c19e1ee 100644 --- a/OpenRA.Mods.Cnc/Effects/GpsSatellite.cs +++ b/OpenRA.Mods.Cnc/Effects/GpsSatellite.cs @@ -16,7 +16,7 @@ using OpenRA.Mods.Cnc.Traits; namespace OpenRA.Mods.Cnc.Effects { - class GpsSatellite : IEffect, ISpatiallyPartitionable + sealed class GpsSatellite : IEffect, ISpatiallyPartitionable { readonly Player launcher; readonly Animation anim; diff --git a/OpenRA.Mods.Cnc/Effects/SatelliteLaunch.cs b/OpenRA.Mods.Cnc/Effects/SatelliteLaunch.cs index d4c23ec26b..1dc83f9947 100644 --- a/OpenRA.Mods.Cnc/Effects/SatelliteLaunch.cs +++ b/OpenRA.Mods.Cnc/Effects/SatelliteLaunch.cs @@ -16,7 +16,7 @@ using OpenRA.Mods.Cnc.Traits; namespace OpenRA.Mods.Cnc.Effects { - class SatelliteLaunch : IEffect, ISpatiallyPartitionable + sealed class SatelliteLaunch : IEffect, ISpatiallyPartitionable { readonly GpsPowerInfo info; readonly Actor launcher; diff --git a/OpenRA.Mods.Cnc/FileFormats/Blowfish.cs b/OpenRA.Mods.Cnc/FileFormats/Blowfish.cs index 63fe3d9c61..35105db6c4 100644 --- a/OpenRA.Mods.Cnc/FileFormats/Blowfish.cs +++ b/OpenRA.Mods.Cnc/FileFormats/Blowfish.cs @@ -11,7 +11,7 @@ namespace OpenRA.Mods.Cnc.FileFormats { - class Blowfish + sealed class Blowfish { public Blowfish(byte[] key) { diff --git a/OpenRA.Mods.Cnc/FileFormats/BlowfishKeyProvider.cs b/OpenRA.Mods.Cnc/FileFormats/BlowfishKeyProvider.cs index 9bb84795be..3c68af3884 100644 --- a/OpenRA.Mods.Cnc/FileFormats/BlowfishKeyProvider.cs +++ b/OpenRA.Mods.Cnc/FileFormats/BlowfishKeyProvider.cs @@ -16,11 +16,11 @@ namespace OpenRA.Mods.Cnc.FileFormats { /* TODO: Convert this direct C port into readable code. */ - class BlowfishKeyProvider + sealed class BlowfishKeyProvider { const string PublicKeyString = "AihRvNoIbTn85FZRYNZRcT+i6KpU+maCsEqr3Q5q+LDB5tH7Tz2qQ38V"; - class PublicKey + sealed class PublicKey { public readonly uint[] KeyOne = new uint[64]; public readonly uint[] KeyTwo = new uint[64]; diff --git a/OpenRA.Mods.Cnc/FileSystem/BigFile.cs b/OpenRA.Mods.Cnc/FileSystem/BigFile.cs index 21f6550826..bd6f1dcf1b 100644 --- a/OpenRA.Mods.Cnc/FileSystem/BigFile.cs +++ b/OpenRA.Mods.Cnc/FileSystem/BigFile.cs @@ -61,7 +61,7 @@ namespace OpenRA.Mods.Cnc.FileSystem } } - class Entry + sealed class Entry { public readonly uint Offset; public readonly uint Size; diff --git a/OpenRA.Mods.Cnc/Graphics/TeslaZapRenderable.cs b/OpenRA.Mods.Cnc/Graphics/TeslaZapRenderable.cs index 48232d508f..8c53f979ae 100644 --- a/OpenRA.Mods.Cnc/Graphics/TeslaZapRenderable.cs +++ b/OpenRA.Mods.Cnc/Graphics/TeslaZapRenderable.cs @@ -17,7 +17,7 @@ using OpenRA.Primitives; namespace OpenRA.Mods.Cnc.Graphics { - class TeslaZapRenderable : IPalettedRenderable, IFinalizedRenderable + sealed class TeslaZapRenderable : IPalettedRenderable, IFinalizedRenderable { static readonly int[][] Steps = new[] { diff --git a/OpenRA.Mods.Cnc/SpriteLoaders/ShpD2Loader.cs b/OpenRA.Mods.Cnc/SpriteLoaders/ShpD2Loader.cs index 6bc60f98ec..3613d01240 100644 --- a/OpenRA.Mods.Cnc/SpriteLoaders/ShpD2Loader.cs +++ b/OpenRA.Mods.Cnc/SpriteLoaders/ShpD2Loader.cs @@ -28,7 +28,7 @@ namespace OpenRA.Mods.Cnc.SpriteLoaders VariableLengthTable = 4 } - class ShpD2Frame : ISpriteFrame + sealed class ShpD2Frame : ISpriteFrame { public SpriteFrameType Type => SpriteFrameType.Indexed8; public Size Size { get; } diff --git a/OpenRA.Mods.Cnc/SpriteLoaders/ShpTDLoader.cs b/OpenRA.Mods.Cnc/SpriteLoaders/ShpTDLoader.cs index 0eeb0de8a5..d49a4849f7 100644 --- a/OpenRA.Mods.Cnc/SpriteLoaders/ShpTDLoader.cs +++ b/OpenRA.Mods.Cnc/SpriteLoaders/ShpTDLoader.cs @@ -75,7 +75,7 @@ namespace OpenRA.Mods.Cnc.SpriteLoaders { enum Format { XORPrev = 0x20, XORLCW = 0x40, LCW = 0x80 } - class ImageHeader : ISpriteFrame + sealed class ImageHeader : ISpriteFrame { public SpriteFrameType Type => SpriteFrameType.Indexed8; public Size Size => reader.Size; diff --git a/OpenRA.Mods.Cnc/SpriteLoaders/TmpRALoader.cs b/OpenRA.Mods.Cnc/SpriteLoaders/TmpRALoader.cs index 49437a6de3..3b3bdbff04 100644 --- a/OpenRA.Mods.Cnc/SpriteLoaders/TmpRALoader.cs +++ b/OpenRA.Mods.Cnc/SpriteLoaders/TmpRALoader.cs @@ -18,7 +18,7 @@ namespace OpenRA.Mods.Cnc.SpriteLoaders { public class TmpRALoader : ISpriteLoader { - class TmpRAFrame : ISpriteFrame + sealed class TmpRAFrame : ISpriteFrame { public SpriteFrameType Type => SpriteFrameType.Indexed8; public Size Size { get; } diff --git a/OpenRA.Mods.Cnc/SpriteLoaders/TmpTDLoader.cs b/OpenRA.Mods.Cnc/SpriteLoaders/TmpTDLoader.cs index 9508122f05..f90db35c70 100644 --- a/OpenRA.Mods.Cnc/SpriteLoaders/TmpTDLoader.cs +++ b/OpenRA.Mods.Cnc/SpriteLoaders/TmpTDLoader.cs @@ -18,7 +18,7 @@ namespace OpenRA.Mods.Cnc.SpriteLoaders { public class TmpTDLoader : ISpriteLoader { - class TmpTDFrame : ISpriteFrame + sealed class TmpTDFrame : ISpriteFrame { public SpriteFrameType Type => SpriteFrameType.Indexed8; public Size Size { get; } diff --git a/OpenRA.Mods.Cnc/SpriteLoaders/TmpTSLoader.cs b/OpenRA.Mods.Cnc/SpriteLoaders/TmpTSLoader.cs index 620bfd53a2..09a6c0d1b6 100644 --- a/OpenRA.Mods.Cnc/SpriteLoaders/TmpTSLoader.cs +++ b/OpenRA.Mods.Cnc/SpriteLoaders/TmpTSLoader.cs @@ -18,7 +18,7 @@ namespace OpenRA.Mods.Cnc.SpriteLoaders { public class TmpTSLoader : ISpriteLoader { - class TmpTSDepthFrame : ISpriteFrame + sealed class TmpTSDepthFrame : ISpriteFrame { readonly TmpTSFrame parent; @@ -35,7 +35,7 @@ namespace OpenRA.Mods.Cnc.SpriteLoaders } } - class TmpTSFrame : ISpriteFrame + sealed class TmpTSFrame : ISpriteFrame { public SpriteFrameType Type => SpriteFrameType.Indexed8; public Size Size { get; } diff --git a/OpenRA.Mods.Cnc/Traits/Attack/AttackPopupTurreted.cs b/OpenRA.Mods.Cnc/Traits/Attack/AttackPopupTurreted.cs index 0ba491863f..12c3e13a01 100644 --- a/OpenRA.Mods.Cnc/Traits/Attack/AttackPopupTurreted.cs +++ b/OpenRA.Mods.Cnc/Traits/Attack/AttackPopupTurreted.cs @@ -18,7 +18,7 @@ using OpenRA.Traits; namespace OpenRA.Mods.Cnc.Traits { [Desc("Actor's turret rises from the ground before attacking.")] - class AttackPopupTurretedInfo : AttackTurretedInfo, Requires, Requires + sealed class AttackPopupTurretedInfo : AttackTurretedInfo, Requires, Requires { [Desc("How many game ticks should pass before closing the actor's turret.")] public readonly int CloseDelay = 125; @@ -46,7 +46,7 @@ namespace OpenRA.Mods.Cnc.Traits public override object Create(ActorInitializer init) { return new AttackPopupTurreted(init, this); } } - class AttackPopupTurreted : AttackTurreted, INotifyIdle, IDamageModifier + sealed class AttackPopupTurreted : AttackTurreted, INotifyIdle, IDamageModifier { enum PopupState { Open, Rotating, Transitioning, Closed } diff --git a/OpenRA.Mods.Cnc/Traits/Attack/AttackTDGunboatTurreted.cs b/OpenRA.Mods.Cnc/Traits/Attack/AttackTDGunboatTurreted.cs index 703ec88fc8..bbdad94d1d 100644 --- a/OpenRA.Mods.Cnc/Traits/Attack/AttackTDGunboatTurreted.cs +++ b/OpenRA.Mods.Cnc/Traits/Attack/AttackTDGunboatTurreted.cs @@ -34,7 +34,7 @@ namespace OpenRA.Mods.Cnc.Traits return new AttackTDGunboatTurretedActivity(self, newTarget, forceAttack, targetLineColor); } - class AttackTDGunboatTurretedActivity : Activity + sealed class AttackTDGunboatTurretedActivity : Activity { readonly AttackTDGunboatTurreted attack; readonly Target target; diff --git a/OpenRA.Mods.Cnc/Traits/Attack/AttackTesla.cs b/OpenRA.Mods.Cnc/Traits/Attack/AttackTesla.cs index 3456c1b795..498a9eb400 100644 --- a/OpenRA.Mods.Cnc/Traits/Attack/AttackTesla.cs +++ b/OpenRA.Mods.Cnc/Traits/Attack/AttackTesla.cs @@ -19,7 +19,7 @@ using OpenRA.Traits; namespace OpenRA.Mods.Cnc.Traits { [Desc("Implements the charge-then-burst attack logic specific to the RA tesla coil.")] - class AttackTeslaInfo : AttackBaseInfo + sealed class AttackTeslaInfo : AttackBaseInfo { [Desc("How many charges this actor has to attack with, once charged.")] public readonly int MaxCharges = 1; @@ -39,7 +39,7 @@ namespace OpenRA.Mods.Cnc.Traits public override object Create(ActorInitializer init) { return new AttackTesla(init.Self, this); } } - class AttackTesla : AttackBase, ITick, INotifyAttack + sealed class AttackTesla : AttackBase, ITick, INotifyAttack { readonly AttackTeslaInfo info; @@ -83,7 +83,7 @@ namespace OpenRA.Mods.Cnc.Traits return new ChargeAttack(this, newTarget, forceAttack, targetLineColor); } - class ChargeAttack : Activity, IActivityNotifyStanceChanged + sealed class ChargeAttack : Activity, IActivityNotifyStanceChanged { readonly AttackTesla attack; readonly Target target; @@ -144,7 +144,7 @@ namespace OpenRA.Mods.Cnc.Traits } } - class ChargeFire : Activity + sealed class ChargeFire : Activity { readonly AttackTesla attack; readonly Target target; diff --git a/OpenRA.Mods.Cnc/Traits/Disguise.cs b/OpenRA.Mods.Cnc/Traits/Disguise.cs index 0c9c03cbd1..eed1c0e603 100644 --- a/OpenRA.Mods.Cnc/Traits/Disguise.cs +++ b/OpenRA.Mods.Cnc/Traits/Disguise.cs @@ -20,12 +20,12 @@ using OpenRA.Traits; namespace OpenRA.Mods.Cnc.Traits { [Desc("Overrides the default Tooltip when this actor is disguised (aids in deceiving enemy players).")] - class DisguiseTooltipInfo : TooltipInfo, Requires + sealed class DisguiseTooltipInfo : TooltipInfo, Requires { public override object Create(ActorInitializer init) { return new DisguiseTooltip(init.Self, this); } } - class DisguiseTooltip : ConditionalTrait, ITooltip + sealed class DisguiseTooltip : ConditionalTrait, ITooltip { readonly Actor self; readonly Disguise disguise; @@ -64,7 +64,7 @@ namespace OpenRA.Mods.Cnc.Traits } [Desc("Provides access to the disguise command, which makes the actor appear to be another player's actor.")] - class DisguiseInfo : TraitInfo + sealed class DisguiseInfo : TraitInfo { [VoiceReference] public readonly string Voice = "Action"; @@ -98,7 +98,7 @@ namespace OpenRA.Mods.Cnc.Traits public override object Create(ActorInitializer init) { return new Disguise(init.Self, this); } } - class Disguise : IEffectiveOwner, IIssueOrder, IResolveOrder, IOrderVoice, IRadarColorModifier, INotifyAttack, + sealed class Disguise : IEffectiveOwner, IIssueOrder, IResolveOrder, IOrderVoice, IRadarColorModifier, INotifyAttack, INotifyDamage, INotifyUnload, INotifyDemolition, INotifyInfiltration, ITick { public ActorInfo AsActor { get; private set; } @@ -280,7 +280,7 @@ namespace OpenRA.Mods.Cnc.Traits } } - class DisguiseOrderTargeter : UnitOrderTargeter + sealed class DisguiseOrderTargeter : UnitOrderTargeter { readonly DisguiseInfo info; diff --git a/OpenRA.Mods.Cnc/Traits/FrozenUnderFogUpdatedByGps.cs b/OpenRA.Mods.Cnc/Traits/FrozenUnderFogUpdatedByGps.cs index 66f3d7ada3..a32400ec5b 100644 --- a/OpenRA.Mods.Cnc/Traits/FrozenUnderFogUpdatedByGps.cs +++ b/OpenRA.Mods.Cnc/Traits/FrozenUnderFogUpdatedByGps.cs @@ -44,7 +44,7 @@ namespace OpenRA.Mods.Cnc.Traits gps.UnregisterForOnGpsRefreshed(fufubg.self, fufubg); }; - class Traits + sealed class Traits { public readonly FrozenActorLayer FrozenActorLayer; public readonly GpsWatcher GpsWatcher; diff --git a/OpenRA.Mods.Cnc/Traits/GpsDot.cs b/OpenRA.Mods.Cnc/Traits/GpsDot.cs index 9d2342d193..11743c69d4 100644 --- a/OpenRA.Mods.Cnc/Traits/GpsDot.cs +++ b/OpenRA.Mods.Cnc/Traits/GpsDot.cs @@ -15,7 +15,7 @@ using OpenRA.Traits; namespace OpenRA.Mods.Cnc.Traits { [Desc("Show an indicator revealing the actor underneath the fog when a GPSWatcher is activated.")] - class GpsDotInfo : TraitInfo + sealed class GpsDotInfo : TraitInfo { [Desc("Sprite collection for symbols.")] public readonly string Image = "gpsdot"; @@ -30,7 +30,7 @@ namespace OpenRA.Mods.Cnc.Traits public override object Create(ActorInitializer init) { return new GpsDot(this); } } - class GpsDot : INotifyCreated, INotifyAddedToWorld, INotifyRemovedFromWorld + sealed class GpsDot : INotifyCreated, INotifyAddedToWorld, INotifyRemovedFromWorld { readonly GpsDotInfo info; GpsDotEffect effect; diff --git a/OpenRA.Mods.Cnc/Traits/GpsWatcher.cs b/OpenRA.Mods.Cnc/Traits/GpsWatcher.cs index cee03e271c..b7a094d14b 100644 --- a/OpenRA.Mods.Cnc/Traits/GpsWatcher.cs +++ b/OpenRA.Mods.Cnc/Traits/GpsWatcher.cs @@ -18,14 +18,14 @@ namespace OpenRA.Mods.Cnc.Traits { [TraitLocation(SystemActors.Player)] [Desc("Required for `GpsPower`. Attach this to the player actor.")] - class GpsWatcherInfo : TraitInfo + sealed class GpsWatcherInfo : TraitInfo { public override object Create(ActorInitializer init) { return new GpsWatcher(init.Self.Owner); } } interface IOnGpsRefreshed { void OnGpsRefresh(Actor self, Player player); } - class GpsWatcher : ISync, IPreventsShroudReset + sealed class GpsWatcher : ISync, IPreventsShroudReset { [Sync] public bool Launched { get; private set; } diff --git a/OpenRA.Mods.Cnc/Traits/Infiltration/InfiltrateForCash.cs b/OpenRA.Mods.Cnc/Traits/Infiltration/InfiltrateForCash.cs index 038a88d8e4..e4b92f56db 100644 --- a/OpenRA.Mods.Cnc/Traits/Infiltration/InfiltrateForCash.cs +++ b/OpenRA.Mods.Cnc/Traits/Infiltration/InfiltrateForCash.cs @@ -18,7 +18,7 @@ using OpenRA.Traits; namespace OpenRA.Mods.Cnc.Traits { [Desc("Funds are transferred from the owner to the infiltrator.")] - class InfiltrateForCashInfo : TraitInfo + sealed class InfiltrateForCashInfo : TraitInfo { [Desc("The `TargetTypes` from `Targetable` that are allowed to enter.")] public readonly BitSet Types = default; @@ -53,7 +53,7 @@ namespace OpenRA.Mods.Cnc.Traits public override object Create(ActorInitializer init) { return new InfiltrateForCash(this); } } - class InfiltrateForCash : INotifyInfiltrated + sealed class InfiltrateForCash : INotifyInfiltrated { readonly InfiltrateForCashInfo info; diff --git a/OpenRA.Mods.Cnc/Traits/Infiltration/InfiltrateForDecoration.cs b/OpenRA.Mods.Cnc/Traits/Infiltration/InfiltrateForDecoration.cs index a94731c539..eccca9e999 100644 --- a/OpenRA.Mods.Cnc/Traits/Infiltration/InfiltrateForDecoration.cs +++ b/OpenRA.Mods.Cnc/Traits/Infiltration/InfiltrateForDecoration.cs @@ -19,7 +19,7 @@ using OpenRA.Traits; namespace OpenRA.Mods.Cnc.Traits { [Desc("Reveals a decoration sprite to the indicated players when infiltrated.")] - class InfiltrateForDecorationInfo : WithDecorationInfo + sealed class InfiltrateForDecorationInfo : WithDecorationInfo { [Desc("The `TargetTypes` from `Targetable` that are allowed to enter.")] public readonly BitSet Types = default; @@ -27,7 +27,7 @@ namespace OpenRA.Mods.Cnc.Traits public override object Create(ActorInitializer init) { return new InfiltrateForDecoration(init.Self, this); } } - class InfiltrateForDecoration : WithDecoration, INotifyInfiltrated + sealed class InfiltrateForDecoration : WithDecoration, INotifyInfiltrated { readonly HashSet infiltrators = new(); readonly InfiltrateForDecorationInfo info; diff --git a/OpenRA.Mods.Cnc/Traits/Infiltration/InfiltrateForExploration.cs b/OpenRA.Mods.Cnc/Traits/Infiltration/InfiltrateForExploration.cs index bfd85e958b..cd6cb7bf71 100644 --- a/OpenRA.Mods.Cnc/Traits/Infiltration/InfiltrateForExploration.cs +++ b/OpenRA.Mods.Cnc/Traits/Infiltration/InfiltrateForExploration.cs @@ -17,7 +17,7 @@ using OpenRA.Traits; namespace OpenRA.Mods.Cnc.Traits { [Desc("Steal and reset the owner's exploration.")] - class InfiltrateForExplorationInfo : TraitInfo + sealed class InfiltrateForExplorationInfo : TraitInfo { [Desc("The `TargetTypes` from `Targetable` that are allowed to enter.")] public readonly BitSet Types = default; @@ -39,7 +39,7 @@ namespace OpenRA.Mods.Cnc.Traits public override object Create(ActorInitializer init) { return new InfiltrateForExploration(this); } } - class InfiltrateForExploration : INotifyInfiltrated + sealed class InfiltrateForExploration : INotifyInfiltrated { readonly InfiltrateForExplorationInfo info; diff --git a/OpenRA.Mods.Cnc/Traits/Infiltration/InfiltrateForPowerOutage.cs b/OpenRA.Mods.Cnc/Traits/Infiltration/InfiltrateForPowerOutage.cs index 75a8c7f043..81ab3756be 100644 --- a/OpenRA.Mods.Cnc/Traits/Infiltration/InfiltrateForPowerOutage.cs +++ b/OpenRA.Mods.Cnc/Traits/Infiltration/InfiltrateForPowerOutage.cs @@ -15,7 +15,7 @@ using OpenRA.Traits; namespace OpenRA.Mods.Cnc.Traits { - class InfiltrateForPowerOutageInfo : TraitInfo + sealed class InfiltrateForPowerOutageInfo : TraitInfo { [Desc("The `TargetTypes` from `Targetable` that are allowed to enter.")] public readonly BitSet Types = default; @@ -40,7 +40,7 @@ namespace OpenRA.Mods.Cnc.Traits public override object Create(ActorInitializer init) { return new InfiltrateForPowerOutage(init.Self, this); } } - class InfiltrateForPowerOutage : INotifyOwnerChanged, INotifyInfiltrated + sealed class InfiltrateForPowerOutage : INotifyOwnerChanged, INotifyInfiltrated { readonly InfiltrateForPowerOutageInfo info; PowerManager playerPower; diff --git a/OpenRA.Mods.Cnc/Traits/Infiltration/InfiltrateForSupportPower.cs b/OpenRA.Mods.Cnc/Traits/Infiltration/InfiltrateForSupportPower.cs index 3663deabce..8d0b1b815e 100644 --- a/OpenRA.Mods.Cnc/Traits/Infiltration/InfiltrateForSupportPower.cs +++ b/OpenRA.Mods.Cnc/Traits/Infiltration/InfiltrateForSupportPower.cs @@ -15,7 +15,7 @@ using OpenRA.Traits; namespace OpenRA.Mods.Cnc.Traits { - class InfiltrateForSupportPowerInfo : TraitInfo + sealed class InfiltrateForSupportPowerInfo : TraitInfo { [ActorReference] [FieldLoader.Require] @@ -41,7 +41,7 @@ namespace OpenRA.Mods.Cnc.Traits public override object Create(ActorInitializer init) { return new InfiltrateForSupportPower(this); } } - class InfiltrateForSupportPower : INotifyInfiltrated + sealed class InfiltrateForSupportPower : INotifyInfiltrated { readonly InfiltrateForSupportPowerInfo info; diff --git a/OpenRA.Mods.Cnc/Traits/Infiltration/InfiltrateForSupportPowerReset.cs b/OpenRA.Mods.Cnc/Traits/Infiltration/InfiltrateForSupportPowerReset.cs index fc6d8305d8..bae7980a37 100644 --- a/OpenRA.Mods.Cnc/Traits/Infiltration/InfiltrateForSupportPowerReset.cs +++ b/OpenRA.Mods.Cnc/Traits/Infiltration/InfiltrateForSupportPowerReset.cs @@ -16,7 +16,7 @@ using OpenRA.Traits; namespace OpenRA.Mods.Cnc.Traits { - class InfiltrateForSupportPowerResetInfo : TraitInfo + sealed class InfiltrateForSupportPowerResetInfo : TraitInfo { [Desc("The `TargetTypes` from `Targetable` that are allowed to enter.")] public readonly BitSet Types = default; @@ -38,7 +38,7 @@ namespace OpenRA.Mods.Cnc.Traits public override object Create(ActorInitializer init) { return new InfiltrateForSupportPowerReset(this); } } - class InfiltrateForSupportPowerReset : INotifyInfiltrated + sealed class InfiltrateForSupportPowerReset : INotifyInfiltrated { readonly InfiltrateForSupportPowerResetInfo info; diff --git a/OpenRA.Mods.Cnc/Traits/Infiltration/InfiltrateForTransform.cs b/OpenRA.Mods.Cnc/Traits/Infiltration/InfiltrateForTransform.cs index 75552e6436..b5bce8512a 100644 --- a/OpenRA.Mods.Cnc/Traits/Infiltration/InfiltrateForTransform.cs +++ b/OpenRA.Mods.Cnc/Traits/Infiltration/InfiltrateForTransform.cs @@ -18,7 +18,7 @@ using OpenRA.Traits; namespace OpenRA.Mods.Cnc.Traits { [Desc("Transform into a different actor type.")] - class InfiltrateForTransformInfo : TraitInfo + sealed class InfiltrateForTransformInfo : TraitInfo { [ActorReference] [FieldLoader.Require] @@ -34,7 +34,7 @@ namespace OpenRA.Mods.Cnc.Traits public override object Create(ActorInitializer init) { return new InfiltrateForTransform(init, this); } } - class InfiltrateForTransform : INotifyInfiltrated + sealed class InfiltrateForTransform : INotifyInfiltrated { readonly InfiltrateForTransformInfo info; readonly string faction; diff --git a/OpenRA.Mods.Cnc/Traits/Infiltration/Infiltrates.cs b/OpenRA.Mods.Cnc/Traits/Infiltration/Infiltrates.cs index 635a9c73f4..6ccd29e299 100644 --- a/OpenRA.Mods.Cnc/Traits/Infiltration/Infiltrates.cs +++ b/OpenRA.Mods.Cnc/Traits/Infiltration/Infiltrates.cs @@ -127,7 +127,7 @@ namespace OpenRA.Mods.Cnc.Traits } } - class InfiltrationOrderTargeter : UnitOrderTargeter + sealed class InfiltrationOrderTargeter : UnitOrderTargeter { readonly InfiltratesInfo info; diff --git a/OpenRA.Mods.Cnc/Traits/MadTank.cs b/OpenRA.Mods.Cnc/Traits/MadTank.cs index 980e79b14e..00368292bc 100644 --- a/OpenRA.Mods.Cnc/Traits/MadTank.cs +++ b/OpenRA.Mods.Cnc/Traits/MadTank.cs @@ -21,7 +21,7 @@ using OpenRA.Traits; namespace OpenRA.Mods.Cnc.Traits { - class MadTankInfo : TraitInfo, IRulesetLoaded, Requires, Requires + sealed class MadTankInfo : TraitInfo, IRulesetLoaded, Requires, Requires { [SequenceReference] public readonly string ThumpSequence = "piston"; @@ -87,7 +87,7 @@ namespace OpenRA.Mods.Cnc.Traits } } - class MadTank : IIssueOrder, IResolveOrder, IOrderVoice, IIssueDeployOrder + sealed class MadTank : IIssueOrder, IResolveOrder, IOrderVoice, IIssueDeployOrder { readonly MadTankInfo info; @@ -143,7 +143,7 @@ namespace OpenRA.Mods.Cnc.Traits self.QueueActivity(order.Queued, new DetonationSequence(self, this)); } - class DetonationSequence : Activity + sealed class DetonationSequence : Activity { readonly Actor self; readonly MadTank mad; diff --git a/OpenRA.Mods.Cnc/Traits/Mine.cs b/OpenRA.Mods.Cnc/Traits/Mine.cs index afa2ad816e..5d5f9ac5dc 100644 --- a/OpenRA.Mods.Cnc/Traits/Mine.cs +++ b/OpenRA.Mods.Cnc/Traits/Mine.cs @@ -15,7 +15,7 @@ using OpenRA.Traits; namespace OpenRA.Mods.Cnc.Traits { - class MineInfo : TraitInfo + sealed class MineInfo : TraitInfo { public readonly BitSet CrushClasses = default; public readonly bool AvoidFriendly = true; @@ -25,7 +25,7 @@ namespace OpenRA.Mods.Cnc.Traits public override object Create(ActorInitializer init) { return new Mine(this); } } - class Mine : ICrushable, INotifyCrushed + sealed class Mine : ICrushable, INotifyCrushed { readonly MineInfo info; @@ -70,6 +70,6 @@ namespace OpenRA.Mods.Cnc.Traits } [Desc("Tag trait for stuff that should not trigger mines.")] - class MineImmuneInfo : TraitInfo { } - class MineImmune { } + sealed class MineImmuneInfo : TraitInfo { } + sealed class MineImmune { } } diff --git a/OpenRA.Mods.Cnc/Traits/Minelayer.cs b/OpenRA.Mods.Cnc/Traits/Minelayer.cs index 342b8876f7..fe66bf74e5 100644 --- a/OpenRA.Mods.Cnc/Traits/Minelayer.cs +++ b/OpenRA.Mods.Cnc/Traits/Minelayer.cs @@ -204,7 +204,7 @@ namespace OpenRA.Mods.Cnc.Traits return Info.TerrainTypes.Contains(terrainType); } - class MinefieldOrderGenerator : OrderGenerator + sealed class MinefieldOrderGenerator : OrderGenerator { readonly List minelayers; readonly Minelayer minelayer; @@ -347,7 +347,7 @@ namespace OpenRA.Mods.Cnc.Traits } } - class BeginMinefieldOrderTargeter : IOrderTargeter + sealed class BeginMinefieldOrderTargeter : IOrderTargeter { public string OrderID => "BeginMinefield"; public int OrderPriority => 5; @@ -377,7 +377,7 @@ namespace OpenRA.Mods.Cnc.Traits return modifiers.HasModifier(TargetModifiers.ForceAttack); } - public bool IsQueued { get; protected set; } + public bool IsQueued { get; private set; } } } } diff --git a/OpenRA.Mods.Cnc/Traits/PaletteEffects/LightPaletteRotator.cs b/OpenRA.Mods.Cnc/Traits/PaletteEffects/LightPaletteRotator.cs index 7eb330c5a8..259abb7720 100644 --- a/OpenRA.Mods.Cnc/Traits/PaletteEffects/LightPaletteRotator.cs +++ b/OpenRA.Mods.Cnc/Traits/PaletteEffects/LightPaletteRotator.cs @@ -17,7 +17,7 @@ namespace OpenRA.Mods.Cnc.Traits { [TraitLocation(SystemActors.World | SystemActors.EditorWorld)] [Desc("Palette effect used for blinking \"animations\" on actors.")] - class LightPaletteRotatorInfo : TraitInfo + sealed class LightPaletteRotatorInfo : TraitInfo { [Desc("Palettes this effect should not apply to.")] public readonly HashSet ExcludePalettes = new(); @@ -34,7 +34,7 @@ namespace OpenRA.Mods.Cnc.Traits public override object Create(ActorInitializer init) { return new LightPaletteRotator(this); } } - class LightPaletteRotator : ITick, IPaletteModifier + sealed class LightPaletteRotator : ITick, IPaletteModifier { readonly LightPaletteRotatorInfo info; float t = 0; diff --git a/OpenRA.Mods.Cnc/Traits/PortableChrono.cs b/OpenRA.Mods.Cnc/Traits/PortableChrono.cs index 6f85733dc4..daffc1d53b 100644 --- a/OpenRA.Mods.Cnc/Traits/PortableChrono.cs +++ b/OpenRA.Mods.Cnc/Traits/PortableChrono.cs @@ -21,7 +21,7 @@ using OpenRA.Traits; namespace OpenRA.Mods.Cnc.Traits { - class PortableChronoInfo : PausableConditionalTraitInfo, Requires + sealed class PortableChronoInfo : PausableConditionalTraitInfo, Requires { [Desc("Cooldown in ticks until the unit can teleport.")] public readonly int ChargeDelay = 500; @@ -78,7 +78,7 @@ namespace OpenRA.Mods.Cnc.Traits public override object Create(ActorInitializer init) { return new PortableChrono(init.Self, this); } } - class PortableChrono : PausableConditionalTrait, IIssueOrder, IResolveOrder, ITick, ISelectionBar, IOrderVoice, ISync + sealed class PortableChrono : PausableConditionalTrait, IIssueOrder, IResolveOrder, ITick, ISelectionBar, IOrderVoice, ISync { readonly IMove move; [Sync] @@ -177,7 +177,7 @@ namespace OpenRA.Mods.Cnc.Traits } } - class PortableChronoOrderTargeter : IOrderTargeter + sealed class PortableChronoOrderTargeter : IOrderTargeter { readonly string targetCursor; @@ -188,7 +188,7 @@ namespace OpenRA.Mods.Cnc.Traits public string OrderID => "PortableChronoTeleport"; public int OrderPriority => 5; - public bool IsQueued { get; protected set; } + public bool IsQueued { get; private set; } public bool TargetOverridesSelection(Actor self, in Target target, List actorsAt, CPos xy, TargetModifiers modifiers) { return true; } public bool CanTarget(Actor self, in Target target, ref TargetModifiers modifiers, ref string cursor) @@ -212,7 +212,7 @@ namespace OpenRA.Mods.Cnc.Traits } } - class PortableChronoOrderGenerator : OrderGenerator + sealed class PortableChronoOrderGenerator : OrderGenerator { readonly Actor self; readonly PortableChrono portableChrono; diff --git a/OpenRA.Mods.Cnc/Traits/Render/WithBuildingBib.cs b/OpenRA.Mods.Cnc/Traits/Render/WithBuildingBib.cs index a6bc7aa642..7d595e072f 100644 --- a/OpenRA.Mods.Cnc/Traits/Render/WithBuildingBib.cs +++ b/OpenRA.Mods.Cnc/Traits/Render/WithBuildingBib.cs @@ -133,5 +133,5 @@ namespace OpenRA.Mods.Cnc.Traits } } - class HideBibPreviewInit : RuntimeFlagInit { } + sealed class HideBibPreviewInit : RuntimeFlagInit { } } diff --git a/OpenRA.Mods.Cnc/Traits/Render/WithDisguisingInfantryBody.cs b/OpenRA.Mods.Cnc/Traits/Render/WithDisguisingInfantryBody.cs index a13c5250d5..478827ffc4 100644 --- a/OpenRA.Mods.Cnc/Traits/Render/WithDisguisingInfantryBody.cs +++ b/OpenRA.Mods.Cnc/Traits/Render/WithDisguisingInfantryBody.cs @@ -15,12 +15,12 @@ using OpenRA.Traits; namespace OpenRA.Mods.Cnc.Traits.Render { - class WithDisguisingInfantryBodyInfo : WithInfantryBodyInfo, Requires + sealed class WithDisguisingInfantryBodyInfo : WithInfantryBodyInfo, Requires { public override object Create(ActorInitializer init) { return new WithDisguisingInfantryBody(init, this); } } - class WithDisguisingInfantryBody : WithInfantryBody + sealed class WithDisguisingInfantryBody : WithInfantryBody { readonly Disguise disguise; readonly RenderSprites rs; diff --git a/OpenRA.Mods.Cnc/Traits/Render/WithGunboatBody.cs b/OpenRA.Mods.Cnc/Traits/Render/WithGunboatBody.cs index 153184855b..9894200d85 100644 --- a/OpenRA.Mods.Cnc/Traits/Render/WithGunboatBody.cs +++ b/OpenRA.Mods.Cnc/Traits/Render/WithGunboatBody.cs @@ -18,7 +18,7 @@ using OpenRA.Traits; namespace OpenRA.Mods.Cnc.Traits.Render { - class WithGunboatBodyInfo : WithSpriteBodyInfo, Requires, Requires, Requires + sealed class WithGunboatBodyInfo : WithSpriteBodyInfo, Requires, Requires, Requires { [Desc("Turreted 'Turret' key to display")] public readonly string Turret = "primary"; @@ -38,7 +38,7 @@ namespace OpenRA.Mods.Cnc.Traits.Render public override object Create(ActorInitializer init) { return new WithGunboatBody(init, this); } } - class WithGunboatBody : WithSpriteBody, ITick + sealed class WithGunboatBody : WithSpriteBody, ITick { readonly WithGunboatBodyInfo info; readonly Animation wake; diff --git a/OpenRA.Mods.Cnc/Traits/Render/WithSplitAttackPaletteInfantryBody.cs b/OpenRA.Mods.Cnc/Traits/Render/WithSplitAttackPaletteInfantryBody.cs index feee19946e..968cb734ce 100644 --- a/OpenRA.Mods.Cnc/Traits/Render/WithSplitAttackPaletteInfantryBody.cs +++ b/OpenRA.Mods.Cnc/Traits/Render/WithSplitAttackPaletteInfantryBody.cs @@ -16,7 +16,7 @@ using OpenRA.Traits; namespace OpenRA.Mods.Cnc.Traits.Render { - class WithSplitAttackPaletteInfantryBodyInfo : WithInfantryBodyInfo + sealed class WithSplitAttackPaletteInfantryBodyInfo : WithInfantryBodyInfo { [PaletteReference] [Desc("Palette to use for the split attack rendering.")] @@ -28,7 +28,7 @@ namespace OpenRA.Mods.Cnc.Traits.Render public override object Create(ActorInitializer init) { return new WithSplitAttackPaletteInfantryBody(init, this); } } - class WithSplitAttackPaletteInfantryBody : WithInfantryBody + sealed class WithSplitAttackPaletteInfantryBody : WithInfantryBody { readonly WithSplitAttackPaletteInfantryBodyInfo info; readonly Animation splitAnimation; diff --git a/OpenRA.Mods.Cnc/Traits/SupportPowers/AttackOrderPower.cs b/OpenRA.Mods.Cnc/Traits/SupportPowers/AttackOrderPower.cs index b8975b271b..c069637167 100644 --- a/OpenRA.Mods.Cnc/Traits/SupportPowers/AttackOrderPower.cs +++ b/OpenRA.Mods.Cnc/Traits/SupportPowers/AttackOrderPower.cs @@ -20,7 +20,7 @@ using OpenRA.Traits; namespace OpenRA.Mods.Cnc.Traits { - class AttackOrderPowerInfo : SupportPowerInfo, Requires + sealed class AttackOrderPowerInfo : SupportPowerInfo, Requires { [Desc("Range circle color.")] public readonly Color CircleColor = Color.Red; @@ -37,7 +37,7 @@ namespace OpenRA.Mods.Cnc.Traits public override object Create(ActorInitializer init) { return new AttackOrderPower(init.Self, this); } } - class AttackOrderPower : SupportPower, INotifyCreated, INotifyBurstComplete + sealed class AttackOrderPower : SupportPower, INotifyCreated, INotifyBurstComplete { readonly AttackOrderPowerInfo info; AttackBase attack; diff --git a/OpenRA.Mods.Cnc/Traits/SupportPowers/ChronoshiftPower.cs b/OpenRA.Mods.Cnc/Traits/SupportPowers/ChronoshiftPower.cs index 884f71a650..06eda13de1 100644 --- a/OpenRA.Mods.Cnc/Traits/SupportPowers/ChronoshiftPower.cs +++ b/OpenRA.Mods.Cnc/Traits/SupportPowers/ChronoshiftPower.cs @@ -19,7 +19,7 @@ using OpenRA.Traits; namespace OpenRA.Mods.Cnc.Traits { - class ChronoshiftPowerInfo : SupportPowerInfo + sealed class ChronoshiftPowerInfo : SupportPowerInfo { [FieldLoader.Require] [Desc("Size of the footprint of the affected area.")] @@ -63,7 +63,7 @@ namespace OpenRA.Mods.Cnc.Traits public override object Create(ActorInitializer init) { return new ChronoshiftPower(init.Self, this); } } - class ChronoshiftPower : SupportPower + sealed class ChronoshiftPower : SupportPower { readonly char[] footprint; readonly CVec dimensions; @@ -140,7 +140,7 @@ namespace OpenRA.Mods.Cnc.Traits return true; } - class SelectChronoshiftTarget : OrderGenerator + sealed class SelectChronoshiftTarget : OrderGenerator { readonly ChronoshiftPower power; readonly char[] footprint; @@ -218,7 +218,7 @@ namespace OpenRA.Mods.Cnc.Traits } } - class SelectDestination : OrderGenerator + sealed class SelectDestination : OrderGenerator { readonly ChronoshiftPower power; readonly CPos sourceLocation; diff --git a/OpenRA.Mods.Cnc/Traits/SupportPowers/GpsPower.cs b/OpenRA.Mods.Cnc/Traits/SupportPowers/GpsPower.cs index 0a89335f7b..436be3c32f 100644 --- a/OpenRA.Mods.Cnc/Traits/SupportPowers/GpsPower.cs +++ b/OpenRA.Mods.Cnc/Traits/SupportPowers/GpsPower.cs @@ -18,7 +18,7 @@ using OpenRA.Traits; namespace OpenRA.Mods.Cnc.Traits { [Desc("Requires `GpsWatcher` on the player actor.")] - class GpsPowerInfo : SupportPowerInfo + sealed class GpsPowerInfo : SupportPowerInfo { [Desc("Delay in ticks between launching and revealing the map.")] public readonly int RevealDelay = 0; @@ -53,7 +53,7 @@ namespace OpenRA.Mods.Cnc.Traits public override object Create(ActorInitializer init) { return new GpsPower(init.Self, this); } } - class GpsPower : SupportPower, INotifyKilled, INotifySold, INotifyOwnerChanged, ITick + sealed class GpsPower : SupportPower, INotifyKilled, INotifySold, INotifyOwnerChanged, ITick { readonly Actor self; readonly GpsPowerInfo info; diff --git a/OpenRA.Mods.Cnc/Traits/SupportPowers/IonCannonPower.cs b/OpenRA.Mods.Cnc/Traits/SupportPowers/IonCannonPower.cs index d096783d61..562a5b0f18 100644 --- a/OpenRA.Mods.Cnc/Traits/SupportPowers/IonCannonPower.cs +++ b/OpenRA.Mods.Cnc/Traits/SupportPowers/IonCannonPower.cs @@ -18,7 +18,7 @@ using OpenRA.Traits; namespace OpenRA.Mods.Cnc.Traits { - class IonCannonPowerInfo : SupportPowerInfo, IRulesetLoaded + sealed class IonCannonPowerInfo : SupportPowerInfo, IRulesetLoaded { [ActorReference] [Desc("Actor to spawn when the attack starts")] @@ -62,7 +62,7 @@ namespace OpenRA.Mods.Cnc.Traits } } - class IonCannonPower : SupportPower + sealed class IonCannonPower : SupportPower { readonly IonCannonPowerInfo info; diff --git a/OpenRA.Mods.Cnc/Traits/World/ShroudPalette.cs b/OpenRA.Mods.Cnc/Traits/World/ShroudPalette.cs index 47daf74311..7f4d290e71 100644 --- a/OpenRA.Mods.Cnc/Traits/World/ShroudPalette.cs +++ b/OpenRA.Mods.Cnc/Traits/World/ShroudPalette.cs @@ -20,7 +20,7 @@ namespace OpenRA.Mods.Cnc.Traits { [TraitLocation(SystemActors.World | SystemActors.EditorWorld)] [Desc("Adds the hard-coded shroud palette to the game")] - class ShroudPaletteInfo : TraitInfo + sealed class ShroudPaletteInfo : TraitInfo { [PaletteDefinition] [FieldLoader.Require] @@ -33,7 +33,7 @@ namespace OpenRA.Mods.Cnc.Traits public override object Create(ActorInitializer init) { return new ShroudPalette(this); } } - class ShroudPalette : ILoadsPalettes, IProvidesAssetBrowserPalettes + sealed class ShroudPalette : ILoadsPalettes, IProvidesAssetBrowserPalettes { readonly ShroudPaletteInfo info; diff --git a/OpenRA.Mods.Cnc/Traits/World/TSEditorResourceLayer.cs b/OpenRA.Mods.Cnc/Traits/World/TSEditorResourceLayer.cs index 55db70c3c9..162c347e5a 100644 --- a/OpenRA.Mods.Cnc/Traits/World/TSEditorResourceLayer.cs +++ b/OpenRA.Mods.Cnc/Traits/World/TSEditorResourceLayer.cs @@ -17,7 +17,7 @@ using OpenRA.Traits; namespace OpenRA.Mods.Cnc.Traits { [TraitLocation(SystemActors.EditorWorld)] - class TSEditorResourceLayerInfo : EditorResourceLayerInfo, Requires + sealed class TSEditorResourceLayerInfo : EditorResourceLayerInfo, Requires { public readonly string VeinType = "Veins"; @@ -28,7 +28,7 @@ namespace OpenRA.Mods.Cnc.Traits public override object Create(ActorInitializer init) { return new TSEditorResourceLayer(init.Self, this); } } - class TSEditorResourceLayer : EditorResourceLayer + sealed class TSEditorResourceLayer : EditorResourceLayer { readonly TSEditorResourceLayerInfo info; readonly EditorActorLayer actorLayer; diff --git a/OpenRA.Mods.Cnc/Traits/World/TSResourceLayer.cs b/OpenRA.Mods.Cnc/Traits/World/TSResourceLayer.cs index 626357004f..0e3177c1b9 100644 --- a/OpenRA.Mods.Cnc/Traits/World/TSResourceLayer.cs +++ b/OpenRA.Mods.Cnc/Traits/World/TSResourceLayer.cs @@ -19,7 +19,7 @@ using OpenRA.Traits; namespace OpenRA.Mods.Cnc.Traits { [TraitLocation(SystemActors.World)] - class TSResourceLayerInfo : ResourceLayerInfo + sealed class TSResourceLayerInfo : ResourceLayerInfo { public readonly string VeinType = "Veins"; @@ -30,7 +30,7 @@ namespace OpenRA.Mods.Cnc.Traits public override object Create(ActorInitializer init) { return new TSResourceLayer(init.Self, this); } } - class TSResourceLayer : ResourceLayer, INotifyActorDisposing + sealed class TSResourceLayer : ResourceLayer, INotifyActorDisposing { readonly TSResourceLayerInfo info; readonly HashSet veinholeCells = new(); diff --git a/OpenRA.Mods.Cnc/Traits/World/TSShroudPalette.cs b/OpenRA.Mods.Cnc/Traits/World/TSShroudPalette.cs index fd399a71f3..ea6b7c0dac 100644 --- a/OpenRA.Mods.Cnc/Traits/World/TSShroudPalette.cs +++ b/OpenRA.Mods.Cnc/Traits/World/TSShroudPalette.cs @@ -19,7 +19,7 @@ namespace OpenRA.Mods.Cnc.Traits { [TraitLocation(SystemActors.World | SystemActors.EditorWorld)] [Desc("Adds the hard-coded shroud palette to the game")] - class TSShroudPaletteInfo : TraitInfo + sealed class TSShroudPaletteInfo : TraitInfo { [PaletteDefinition] [FieldLoader.Require] @@ -29,7 +29,7 @@ namespace OpenRA.Mods.Cnc.Traits public override object Create(ActorInitializer init) { return new TSShroudPalette(this); } } - class TSShroudPalette : ILoadsPalettes, IProvidesAssetBrowserPalettes + sealed class TSShroudPalette : ILoadsPalettes, IProvidesAssetBrowserPalettes { readonly TSShroudPaletteInfo info; diff --git a/OpenRA.Mods.Cnc/UtilityCommands/ConvertPngToShpCommand.cs b/OpenRA.Mods.Cnc/UtilityCommands/ConvertPngToShpCommand.cs index 208b2c2131..30bcac3842 100644 --- a/OpenRA.Mods.Cnc/UtilityCommands/ConvertPngToShpCommand.cs +++ b/OpenRA.Mods.Cnc/UtilityCommands/ConvertPngToShpCommand.cs @@ -20,7 +20,7 @@ using OpenRA.Primitives; namespace OpenRA.Mods.Cnc.UtilityCommands { - class ConvertPngToShpCommand : IUtilityCommand + sealed class ConvertPngToShpCommand : IUtilityCommand { string IUtilityCommand.Name => "--shp"; diff --git a/OpenRA.Mods.Cnc/UtilityCommands/ImportRedAlertMapCommand.cs b/OpenRA.Mods.Cnc/UtilityCommands/ImportRedAlertMapCommand.cs index 4d6b0ca813..0b7b09d2b5 100644 --- a/OpenRA.Mods.Cnc/UtilityCommands/ImportRedAlertMapCommand.cs +++ b/OpenRA.Mods.Cnc/UtilityCommands/ImportRedAlertMapCommand.cs @@ -19,7 +19,7 @@ using OpenRA.Mods.Common.FileFormats; namespace OpenRA.Mods.Cnc.UtilityCommands { - class ImportRedAlertMapCommand : ImportGen1MapCommand, IUtilityCommand + sealed class ImportRedAlertMapCommand : ImportGen1MapCommand, IUtilityCommand { // TODO: 128x128 is probably not true for "mega maps" from the expansions. public ImportRedAlertMapCommand() diff --git a/OpenRA.Mods.Cnc/UtilityCommands/ImportTiberianDawnMapCommand.cs b/OpenRA.Mods.Cnc/UtilityCommands/ImportTiberianDawnMapCommand.cs index 84cd1ddfb6..51d6d41f28 100644 --- a/OpenRA.Mods.Cnc/UtilityCommands/ImportTiberianDawnMapCommand.cs +++ b/OpenRA.Mods.Cnc/UtilityCommands/ImportTiberianDawnMapCommand.cs @@ -17,7 +17,7 @@ using OpenRA.Mods.Common.FileFormats; namespace OpenRA.Mods.Cnc.UtilityCommands { - class ImportTiberianDawnMapCommand : ImportGen1MapCommand, IUtilityCommand + sealed class ImportTiberianDawnMapCommand : ImportGen1MapCommand, IUtilityCommand { // NOTE: 64x64 map size is a C&C95 engine limitation public ImportTiberianDawnMapCommand() diff --git a/OpenRA.Mods.Cnc/UtilityCommands/ImportTiberianSunMapCommand.cs b/OpenRA.Mods.Cnc/UtilityCommands/ImportTiberianSunMapCommand.cs index 06f8c487ea..b04cd6bb3a 100644 --- a/OpenRA.Mods.Cnc/UtilityCommands/ImportTiberianSunMapCommand.cs +++ b/OpenRA.Mods.Cnc/UtilityCommands/ImportTiberianSunMapCommand.cs @@ -15,7 +15,7 @@ using OpenRA.Traits; namespace OpenRA.Mods.Cnc.UtilityCommands { - class ImportTiberianSunMapCommand : ImportGen2MapCommand, IUtilityCommand + sealed class ImportTiberianSunMapCommand : ImportGen2MapCommand, IUtilityCommand { string IUtilityCommand.Name => "--import-ts-map"; diff --git a/OpenRA.Mods.Cnc/UtilityCommands/LegacyRulesImporter.cs b/OpenRA.Mods.Cnc/UtilityCommands/LegacyRulesImporter.cs index 386d7e0a23..008f15eaee 100644 --- a/OpenRA.Mods.Cnc/UtilityCommands/LegacyRulesImporter.cs +++ b/OpenRA.Mods.Cnc/UtilityCommands/LegacyRulesImporter.cs @@ -17,7 +17,7 @@ using OpenRA.Mods.Common.FileFormats; namespace OpenRA.Mods.Cnc.UtilityCommands { - class LegacyRulesImporter : IUtilityCommand + sealed class LegacyRulesImporter : IUtilityCommand { bool IUtilityCommand.ValidateArguments(string[] args) { diff --git a/OpenRA.Mods.Cnc/UtilityCommands/LegacySequenceImporter.cs b/OpenRA.Mods.Cnc/UtilityCommands/LegacySequenceImporter.cs index aff27231ea..842307a557 100644 --- a/OpenRA.Mods.Cnc/UtilityCommands/LegacySequenceImporter.cs +++ b/OpenRA.Mods.Cnc/UtilityCommands/LegacySequenceImporter.cs @@ -16,7 +16,7 @@ using OpenRA.Mods.Common.FileFormats; namespace OpenRA.Mods.Cnc.UtilityCommands { - class ImportLegacySequenceCommand : IUtilityCommand + sealed class ImportLegacySequenceCommand : IUtilityCommand { bool IUtilityCommand.ValidateArguments(string[] args) { diff --git a/OpenRA.Mods.Cnc/UtilityCommands/LegacyTilesetImporter.cs b/OpenRA.Mods.Cnc/UtilityCommands/LegacyTilesetImporter.cs index 41035357ee..a04b9ef219 100644 --- a/OpenRA.Mods.Cnc/UtilityCommands/LegacyTilesetImporter.cs +++ b/OpenRA.Mods.Cnc/UtilityCommands/LegacyTilesetImporter.cs @@ -18,7 +18,7 @@ using OpenRA.Mods.Common.FileFormats; namespace OpenRA.Mods.Cnc.UtilityCommands { - class ImportLegacyTilesetCommand : IUtilityCommand + sealed class ImportLegacyTilesetCommand : IUtilityCommand { string IUtilityCommand.Name => "--tileset-import"; diff --git a/OpenRA.Mods.Cnc/UtilityCommands/RemapShpCommand.cs b/OpenRA.Mods.Cnc/UtilityCommands/RemapShpCommand.cs index 0dae94e4b5..97c44a3e96 100644 --- a/OpenRA.Mods.Cnc/UtilityCommands/RemapShpCommand.cs +++ b/OpenRA.Mods.Cnc/UtilityCommands/RemapShpCommand.cs @@ -20,7 +20,7 @@ using OpenRA.Primitives; namespace OpenRA.Mods.Cnc.UtilityCommands { - class RemapShpCommand : IUtilityCommand + sealed class RemapShpCommand : IUtilityCommand { string IUtilityCommand.Name => "--remap"; diff --git a/OpenRA.Mods.Common/Activities/Air/FlyAttack.cs b/OpenRA.Mods.Common/Activities/Air/FlyAttack.cs index ba4d9de55c..f2546fab62 100644 --- a/OpenRA.Mods.Common/Activities/Air/FlyAttack.cs +++ b/OpenRA.Mods.Common/Activities/Air/FlyAttack.cs @@ -212,7 +212,7 @@ namespace OpenRA.Mods.Common.Activities } } - class FlyAttackRun : Activity + sealed class FlyAttackRun : Activity { readonly AttackAircraft attack; readonly WDist exitRange; @@ -261,7 +261,7 @@ namespace OpenRA.Mods.Common.Activities } } - class StrafeAttackRun : Activity + sealed class StrafeAttackRun : Activity { readonly AttackAircraft attackAircraft; readonly Aircraft aircraft; diff --git a/OpenRA.Mods.Common/Activities/DeliverUnit.cs b/OpenRA.Mods.Common/Activities/DeliverUnit.cs index a6d481131d..352b3bfb0e 100644 --- a/OpenRA.Mods.Common/Activities/DeliverUnit.cs +++ b/OpenRA.Mods.Common/Activities/DeliverUnit.cs @@ -64,7 +64,7 @@ namespace OpenRA.Mods.Common.Activities yield return new TargetLineNode(destination, targetLineColor.Value); } - class ReleaseUnit : Activity + sealed class ReleaseUnit : Activity { readonly Carryall carryall; readonly BodyOrientation body; diff --git a/OpenRA.Mods.Common/Activities/Demolish.cs b/OpenRA.Mods.Common/Activities/Demolish.cs index 03fd7a594b..5b55a61ac9 100644 --- a/OpenRA.Mods.Common/Activities/Demolish.cs +++ b/OpenRA.Mods.Common/Activities/Demolish.cs @@ -17,7 +17,7 @@ using OpenRA.Traits; namespace OpenRA.Mods.Common.Activities { - class Demolish : Enter + sealed class Demolish : Enter { readonly int delay; readonly int flashes; diff --git a/OpenRA.Mods.Common/Activities/DonateCash.cs b/OpenRA.Mods.Common/Activities/DonateCash.cs index 524f91ca9d..cf9a52703a 100644 --- a/OpenRA.Mods.Common/Activities/DonateCash.cs +++ b/OpenRA.Mods.Common/Activities/DonateCash.cs @@ -16,7 +16,7 @@ using OpenRA.Traits; namespace OpenRA.Mods.Common.Activities { - class DonateCash : Enter + sealed class DonateCash : Enter { readonly int payload; readonly int playerExperience; diff --git a/OpenRA.Mods.Common/Activities/DonateExperience.cs b/OpenRA.Mods.Common/Activities/DonateExperience.cs index 1d95e9af85..b07da90ff0 100644 --- a/OpenRA.Mods.Common/Activities/DonateExperience.cs +++ b/OpenRA.Mods.Common/Activities/DonateExperience.cs @@ -15,7 +15,7 @@ using OpenRA.Traits; namespace OpenRA.Mods.Common.Activities { - class DonateExperience : Enter + sealed class DonateExperience : Enter { readonly int level; readonly int playerExperience; diff --git a/OpenRA.Mods.Common/Activities/InstantRepair.cs b/OpenRA.Mods.Common/Activities/InstantRepair.cs index 7b9dce845c..853d1e8095 100644 --- a/OpenRA.Mods.Common/Activities/InstantRepair.cs +++ b/OpenRA.Mods.Common/Activities/InstantRepair.cs @@ -14,7 +14,7 @@ using OpenRA.Traits; namespace OpenRA.Mods.Common.Activities { - class InstantRepair : Enter + sealed class InstantRepair : Enter { readonly InstantlyRepairsInfo info; diff --git a/OpenRA.Mods.Common/Activities/Move/Move.cs b/OpenRA.Mods.Common/Activities/Move/Move.cs index 2de6716623..8fb081cebc 100644 --- a/OpenRA.Mods.Common/Activities/Move/Move.cs +++ b/OpenRA.Mods.Common/Activities/Move/Move.cs @@ -486,7 +486,7 @@ namespace OpenRA.Mods.Common.Activities } } - class MoveFirstHalf : MovePart + sealed class MoveFirstHalf : MovePart { public MoveFirstHalf(Move move, WPos from, WPos to, WAngle fromFacing, WAngle toFacing, WRot? fromTerrainOrientation, WRot? toTerrainOrientation, int terrainOrientationMargin, int carryoverProgress, bool shouldArc, bool movingOnGroundLayer) @@ -569,7 +569,7 @@ namespace OpenRA.Mods.Common.Activities } } - class MoveSecondHalf : MovePart + sealed class MoveSecondHalf : MovePart { public MoveSecondHalf(Move move, WPos from, WPos to, WAngle fromFacing, WAngle toFacing, WRot? fromTerrainOrientation, WRot? toTerrainOrientation, int terrainOrientationMargin, int carryoverProgress, bool shouldArc, bool movingOnGroundLayer) diff --git a/OpenRA.Mods.Common/Activities/PickupUnit.cs b/OpenRA.Mods.Common/Activities/PickupUnit.cs index e2c72a5f18..08c90ff6a9 100644 --- a/OpenRA.Mods.Common/Activities/PickupUnit.cs +++ b/OpenRA.Mods.Common/Activities/PickupUnit.cs @@ -135,7 +135,7 @@ namespace OpenRA.Mods.Common.Activities yield return new TargetLineNode(Target.FromActor(cargo), targetLineColor.Value); } - class AttachUnit : Activity + sealed class AttachUnit : Activity { readonly Actor cargo; readonly Carryable carryable; diff --git a/OpenRA.Mods.Common/Activities/RepairBridge.cs b/OpenRA.Mods.Common/Activities/RepairBridge.cs index 6588da8e76..d5348a6c6b 100644 --- a/OpenRA.Mods.Common/Activities/RepairBridge.cs +++ b/OpenRA.Mods.Common/Activities/RepairBridge.cs @@ -15,7 +15,7 @@ using OpenRA.Traits; namespace OpenRA.Mods.Common.Activities { - class RepairBridge : Enter + sealed class RepairBridge : Enter { readonly EnterBehaviour enterBehaviour; readonly string speechNotification; diff --git a/OpenRA.Mods.Common/Activities/RideTransport.cs b/OpenRA.Mods.Common/Activities/RideTransport.cs index f11d39c83a..1bf6ec2fff 100644 --- a/OpenRA.Mods.Common/Activities/RideTransport.cs +++ b/OpenRA.Mods.Common/Activities/RideTransport.cs @@ -15,7 +15,7 @@ using OpenRA.Traits; namespace OpenRA.Mods.Common.Activities { - class RideTransport : Enter + sealed class RideTransport : Enter { readonly Passenger passenger; diff --git a/OpenRA.Mods.Common/Activities/Sell.cs b/OpenRA.Mods.Common/Activities/Sell.cs index 2476d331c0..ed718a0fde 100644 --- a/OpenRA.Mods.Common/Activities/Sell.cs +++ b/OpenRA.Mods.Common/Activities/Sell.cs @@ -16,7 +16,7 @@ using OpenRA.Traits; namespace OpenRA.Mods.Common.Activities { - class Sell : Activity + sealed class Sell : Activity { readonly IHealth health; readonly SellableInfo sellableInfo; diff --git a/OpenRA.Mods.Common/Activities/Transform.cs b/OpenRA.Mods.Common/Activities/Transform.cs index b6aaca59d9..4fc833df4c 100644 --- a/OpenRA.Mods.Common/Activities/Transform.cs +++ b/OpenRA.Mods.Common/Activities/Transform.cs @@ -162,7 +162,7 @@ namespace OpenRA.Mods.Common.Activities } } - class IssueOrderAfterTransform : Activity + sealed class IssueOrderAfterTransform : Activity { readonly string orderString; readonly Target target; diff --git a/OpenRA.Mods.Common/ActorInitializer.cs b/OpenRA.Mods.Common/ActorInitializer.cs index fea5c90f30..66614467b2 100644 --- a/OpenRA.Mods.Common/ActorInitializer.cs +++ b/OpenRA.Mods.Common/ActorInitializer.cs @@ -83,7 +83,7 @@ namespace OpenRA.Mods.Common : base(value) { } } - class ActorInitLoader : TypeConverter + sealed class ActorInitLoader : TypeConverter { public override bool CanConvertFrom(ITypeDescriptorContext context, Type sourceType) { diff --git a/OpenRA.Mods.Common/EditorBrushes/EditorActorBrush.cs b/OpenRA.Mods.Common/EditorBrushes/EditorActorBrush.cs index bfc78535f5..df0f377a0d 100644 --- a/OpenRA.Mods.Common/EditorBrushes/EditorActorBrush.cs +++ b/OpenRA.Mods.Common/EditorBrushes/EditorActorBrush.cs @@ -77,7 +77,7 @@ namespace OpenRA.Mods.Common.Widgets } } - class AddActorAction : IEditorAction + sealed class AddActorAction : IEditorAction { public string Text { get; private set; } diff --git a/OpenRA.Mods.Common/EditorBrushes/EditorCopyPasteBrush.cs b/OpenRA.Mods.Common/EditorBrushes/EditorCopyPasteBrush.cs index fca429f84e..fb40f6c863 100644 --- a/OpenRA.Mods.Common/EditorBrushes/EditorCopyPasteBrush.cs +++ b/OpenRA.Mods.Common/EditorBrushes/EditorCopyPasteBrush.cs @@ -174,7 +174,7 @@ namespace OpenRA.Mods.Common.Widgets } } - class CopyPasteEditorAction : IEditorAction + sealed class CopyPasteEditorAction : IEditorAction { [TranslationReference("amount")] const string CopiedTiles = "notification-copied-tiles"; @@ -271,7 +271,7 @@ namespace OpenRA.Mods.Common.Widgets } } - class UndoCopyPaste + sealed class UndoCopyPaste { public CPos Cell { get; } public TerrainTile MapTile { get; } diff --git a/OpenRA.Mods.Common/EditorBrushes/EditorDefaultBrush.cs b/OpenRA.Mods.Common/EditorBrushes/EditorDefaultBrush.cs index 7e186c93cf..8e5d3cb456 100644 --- a/OpenRA.Mods.Common/EditorBrushes/EditorDefaultBrush.cs +++ b/OpenRA.Mods.Common/EditorBrushes/EditorDefaultBrush.cs @@ -108,7 +108,7 @@ namespace OpenRA.Mods.Common.Widgets public void Dispose() { } } - class RemoveActorAction : IEditorAction + sealed class RemoveActorAction : IEditorAction { [TranslationReference("name", "id")] const string RemovedActor = "notification-removed-actor"; @@ -143,7 +143,7 @@ namespace OpenRA.Mods.Common.Widgets } } - class RemoveResourceAction : IEditorAction + sealed class RemoveResourceAction : IEditorAction { [TranslationReference("type")] const string RemovedResource = "notification-removed-resource"; diff --git a/OpenRA.Mods.Common/EditorBrushes/EditorResourceBrush.cs b/OpenRA.Mods.Common/EditorBrushes/EditorResourceBrush.cs index e742413683..8a856fd610 100644 --- a/OpenRA.Mods.Common/EditorBrushes/EditorResourceBrush.cs +++ b/OpenRA.Mods.Common/EditorBrushes/EditorResourceBrush.cs @@ -103,7 +103,7 @@ namespace OpenRA.Mods.Common.Widgets } } - class AddResourcesEditorAction : IEditorAction + sealed class AddResourcesEditorAction : IEditorAction { [TranslationReference("amount", "type")] const string AddedResource = "notification-added-resource"; diff --git a/OpenRA.Mods.Common/EditorBrushes/EditorTileBrush.cs b/OpenRA.Mods.Common/EditorBrushes/EditorTileBrush.cs index 16fea4d388..99c4698456 100644 --- a/OpenRA.Mods.Common/EditorBrushes/EditorTileBrush.cs +++ b/OpenRA.Mods.Common/EditorBrushes/EditorTileBrush.cs @@ -153,7 +153,7 @@ namespace OpenRA.Mods.Common.Widgets } } - class PaintTileEditorAction : IEditorAction + sealed class PaintTileEditorAction : IEditorAction { [TranslationReference("id")] const string AddedTile = "notification-added-tile"; @@ -225,7 +225,7 @@ namespace OpenRA.Mods.Common.Widgets } } - class FloodFillEditorAction : IEditorAction + sealed class FloodFillEditorAction : IEditorAction { [TranslationReference("id")] const string FilledTile = "notification-filled-tile"; @@ -363,7 +363,7 @@ namespace OpenRA.Mods.Common.Widgets } } - class UndoTile + sealed class UndoTile { public CPos Cell { get; } public TerrainTile MapTile { get; } diff --git a/OpenRA.Mods.Common/Effects/FloatingSprite.cs b/OpenRA.Mods.Common/Effects/FloatingSprite.cs index e9593404f2..073c70eb1d 100644 --- a/OpenRA.Mods.Common/Effects/FloatingSprite.cs +++ b/OpenRA.Mods.Common/Effects/FloatingSprite.cs @@ -15,7 +15,7 @@ using OpenRA.Graphics; namespace OpenRA.Mods.Common.Effects { - class FloatingSprite : IEffect, ISpatiallyPartitionable + sealed class FloatingSprite : IEffect, ISpatiallyPartitionable { readonly WDist[] speed; readonly WDist[] gravity; diff --git a/OpenRA.Mods.Common/FileFormats/Blast.cs b/OpenRA.Mods.Common/FileFormats/Blast.cs index 59e3be8df4..a636dd6dad 100644 --- a/OpenRA.Mods.Common/FileFormats/Blast.cs +++ b/OpenRA.Mods.Common/FileFormats/Blast.cs @@ -200,7 +200,7 @@ namespace OpenRA.Mods.Common.FileFormats } } - class BitReader + sealed class BitReader { readonly Stream stream; byte bitBuffer = 0; @@ -242,7 +242,7 @@ namespace OpenRA.Mods.Common.FileFormats * codes. Those tables are the number of codes of each length, and the symbols * sorted by length, retaining their original order within each length. */ - class Huffman + sealed class Huffman { public short[] Count; // number of symbols of each length public short[] Symbol; // canonically ordered symbols diff --git a/OpenRA.Mods.Common/FileFormats/InstallShieldCABCompression.cs b/OpenRA.Mods.Common/FileFormats/InstallShieldCABCompression.cs index a5d1b22bd0..e76b47c576 100644 --- a/OpenRA.Mods.Common/FileFormats/InstallShieldCABCompression.cs +++ b/OpenRA.Mods.Common/FileFormats/InstallShieldCABCompression.cs @@ -242,7 +242,7 @@ namespace OpenRA.Mods.Common.FileFormats } } - class CabExtracter + sealed class CabExtracter { readonly FileDescriptor file; readonly Dictionary volumes; diff --git a/OpenRA.Mods.Common/FileFormats/MSCabCompression.cs b/OpenRA.Mods.Common/FileFormats/MSCabCompression.cs index e92e2df8cf..3990bf8eed 100644 --- a/OpenRA.Mods.Common/FileFormats/MSCabCompression.cs +++ b/OpenRA.Mods.Common/FileFormats/MSCabCompression.cs @@ -20,7 +20,7 @@ namespace OpenRA.Mods.Common.FileFormats { public sealed class MSCabCompression { - class CabFolder + sealed class CabFolder { public readonly uint BlockOffset; public readonly ushort BlockCount; @@ -34,7 +34,7 @@ namespace OpenRA.Mods.Common.FileFormats } } - class CabFile + sealed class CabFile { public readonly string FileName; public readonly uint DecompressedLength; diff --git a/OpenRA.Mods.Common/Graphics/ModelRenderable.cs b/OpenRA.Mods.Common/Graphics/ModelRenderable.cs index 1c33e0905a..0f86a680b5 100644 --- a/OpenRA.Mods.Common/Graphics/ModelRenderable.cs +++ b/OpenRA.Mods.Common/Graphics/ModelRenderable.cs @@ -115,7 +115,7 @@ namespace OpenRA.Mods.Common.Graphics return new FinalizedModelRenderable(wr, this); } - class FinalizedModelRenderable : IFinalizedRenderable + sealed class FinalizedModelRenderable : IFinalizedRenderable { readonly ModelRenderable model; readonly ModelRenderProxy renderProxy; diff --git a/OpenRA.Mods.Common/Graphics/UIModelRenderable.cs b/OpenRA.Mods.Common/Graphics/UIModelRenderable.cs index 3682914672..19cb37b82c 100644 --- a/OpenRA.Mods.Common/Graphics/UIModelRenderable.cs +++ b/OpenRA.Mods.Common/Graphics/UIModelRenderable.cs @@ -70,7 +70,7 @@ namespace OpenRA.Mods.Common.Graphics return new FinalizedUIModelRenderable(wr, this); } - class FinalizedUIModelRenderable : IFinalizedRenderable + sealed class FinalizedUIModelRenderable : IFinalizedRenderable { readonly UIModelRenderable model; readonly ModelRenderProxy renderProxy; diff --git a/OpenRA.Mods.Common/Lint/CheckAngle.cs b/OpenRA.Mods.Common/Lint/CheckAngle.cs index 6fc9101ca7..22ea1ad064 100644 --- a/OpenRA.Mods.Common/Lint/CheckAngle.cs +++ b/OpenRA.Mods.Common/Lint/CheckAngle.cs @@ -15,7 +15,7 @@ using OpenRA.Server; namespace OpenRA.Mods.Common.Lint { - class CheckAngle : ILintRulesPass, ILintServerMapPass + sealed class CheckAngle : ILintRulesPass, ILintServerMapPass { void ILintRulesPass.Run(Action emitError, Action emitWarning, ModData modData, Ruleset rules) { diff --git a/OpenRA.Mods.Common/Lint/CheckChromeHotkeys.cs b/OpenRA.Mods.Common/Lint/CheckChromeHotkeys.cs index f3d6df3f67..6071caeeea 100644 --- a/OpenRA.Mods.Common/Lint/CheckChromeHotkeys.cs +++ b/OpenRA.Mods.Common/Lint/CheckChromeHotkeys.cs @@ -29,7 +29,7 @@ namespace OpenRA.Mods.Common.Lint [AttributeUsage(AttributeTargets.Method)] public sealed class CustomLintableHotkeyNames : Attribute { } - class CheckChromeHotkeys : ILintPass + sealed class CheckChromeHotkeys : ILintPass { public void Run(Action emitError, Action emitWarning, ModData modData) { diff --git a/OpenRA.Mods.Common/Lint/CheckChromeLogic.cs b/OpenRA.Mods.Common/Lint/CheckChromeLogic.cs index 4ecfdbcf59..02ab41a6af 100644 --- a/OpenRA.Mods.Common/Lint/CheckChromeLogic.cs +++ b/OpenRA.Mods.Common/Lint/CheckChromeLogic.cs @@ -15,7 +15,7 @@ using OpenRA.Widgets; namespace OpenRA.Mods.Common.Lint { - class CheckChromeLogic : ILintPass + sealed class CheckChromeLogic : ILintPass { public void Run(Action emitError, Action emitWarning, ModData modData) { diff --git a/OpenRA.Mods.Common/Lint/CheckCursors.cs b/OpenRA.Mods.Common/Lint/CheckCursors.cs index 245ee13c5e..43d3ebd39a 100644 --- a/OpenRA.Mods.Common/Lint/CheckCursors.cs +++ b/OpenRA.Mods.Common/Lint/CheckCursors.cs @@ -17,7 +17,7 @@ using OpenRA.Traits; namespace OpenRA.Mods.Common.Lint { - class CheckCursors : ILintRulesPass, ILintServerMapPass + sealed class CheckCursors : ILintRulesPass, ILintServerMapPass { void ILintRulesPass.Run(Action emitError, Action emitWarning, ModData modData, Ruleset rules) { diff --git a/OpenRA.Mods.Common/Lint/CheckDefaultVisibility.cs b/OpenRA.Mods.Common/Lint/CheckDefaultVisibility.cs index 8838ee9354..551b951ea2 100644 --- a/OpenRA.Mods.Common/Lint/CheckDefaultVisibility.cs +++ b/OpenRA.Mods.Common/Lint/CheckDefaultVisibility.cs @@ -17,7 +17,7 @@ using OpenRA.Traits; namespace OpenRA.Mods.Common.Lint { - class CheckDefaultVisibility : ILintRulesPass, ILintServerMapPass + sealed class CheckDefaultVisibility : ILintRulesPass, ILintServerMapPass { void ILintRulesPass.Run(Action emitError, Action emitWarning, ModData modData, Ruleset rules) { diff --git a/OpenRA.Mods.Common/Lint/CheckHitShapes.cs b/OpenRA.Mods.Common/Lint/CheckHitShapes.cs index 0cfba5dcbb..0c356e0859 100644 --- a/OpenRA.Mods.Common/Lint/CheckHitShapes.cs +++ b/OpenRA.Mods.Common/Lint/CheckHitShapes.cs @@ -17,7 +17,7 @@ using OpenRA.Traits; namespace OpenRA.Mods.Common.Lint { - class CheckHitShapes : ILintRulesPass, ILintServerMapPass + sealed class CheckHitShapes : ILintRulesPass, ILintServerMapPass { void ILintRulesPass.Run(Action emitError, Action emitWarning, ModData modData, Ruleset rules) { diff --git a/OpenRA.Mods.Common/Lint/CheckInteractable.cs b/OpenRA.Mods.Common/Lint/CheckInteractable.cs index b2eab3c7d8..77aacb50ab 100644 --- a/OpenRA.Mods.Common/Lint/CheckInteractable.cs +++ b/OpenRA.Mods.Common/Lint/CheckInteractable.cs @@ -16,7 +16,7 @@ using OpenRA.Server; namespace OpenRA.Mods.Common.Lint { - class CheckInteractable : ILintRulesPass, ILintServerMapPass + sealed class CheckInteractable : ILintRulesPass, ILintServerMapPass { void ILintRulesPass.Run(Action emitError, Action emitWarning, ModData modData, Ruleset rules) { diff --git a/OpenRA.Mods.Common/Lint/CheckNotifications.cs b/OpenRA.Mods.Common/Lint/CheckNotifications.cs index 45b00662e1..d0a847f4a1 100644 --- a/OpenRA.Mods.Common/Lint/CheckNotifications.cs +++ b/OpenRA.Mods.Common/Lint/CheckNotifications.cs @@ -17,7 +17,7 @@ using OpenRA.Traits; namespace OpenRA.Mods.Common.Lint { - class CheckNotifications : ILintRulesPass, ILintServerMapPass + sealed class CheckNotifications : ILintRulesPass, ILintServerMapPass { void ILintRulesPass.Run(Action emitError, Action emitWarning, ModData modData, Ruleset rules) { diff --git a/OpenRA.Mods.Common/Lint/CheckPalettes.cs b/OpenRA.Mods.Common/Lint/CheckPalettes.cs index 734df245ee..34dd2d9147 100644 --- a/OpenRA.Mods.Common/Lint/CheckPalettes.cs +++ b/OpenRA.Mods.Common/Lint/CheckPalettes.cs @@ -17,7 +17,7 @@ using OpenRA.Traits; namespace OpenRA.Mods.Common.Lint { - class CheckPalettes : ILintRulesPass, ILintServerMapPass + sealed class CheckPalettes : ILintRulesPass, ILintServerMapPass { void ILintRulesPass.Run(Action emitError, Action emitWarning, ModData modData, Ruleset rules) { diff --git a/OpenRA.Mods.Common/Lint/CheckRangeLimit.cs b/OpenRA.Mods.Common/Lint/CheckRangeLimit.cs index c213fc4f5a..7dce87f2eb 100644 --- a/OpenRA.Mods.Common/Lint/CheckRangeLimit.cs +++ b/OpenRA.Mods.Common/Lint/CheckRangeLimit.cs @@ -15,7 +15,7 @@ using OpenRA.Server; namespace OpenRA.Mods.Common.Lint { - class CheckRangeLimit : ILintRulesPass, ILintServerMapPass + sealed class CheckRangeLimit : ILintRulesPass, ILintServerMapPass { void ILintRulesPass.Run(Action emitError, Action emitWarning, ModData modData, Ruleset rules) { diff --git a/OpenRA.Mods.Common/Lint/CheckRevealFootprint.cs b/OpenRA.Mods.Common/Lint/CheckRevealFootprint.cs index f37391ec0c..540283dece 100644 --- a/OpenRA.Mods.Common/Lint/CheckRevealFootprint.cs +++ b/OpenRA.Mods.Common/Lint/CheckRevealFootprint.cs @@ -16,7 +16,7 @@ using OpenRA.Traits; namespace OpenRA.Mods.Common.Lint { - class CheckRevealFootprint : ILintRulesPass, ILintServerMapPass + sealed class CheckRevealFootprint : ILintRulesPass, ILintServerMapPass { void ILintRulesPass.Run(Action emitError, Action emitWarning, ModData modData, Ruleset rules) { diff --git a/OpenRA.Mods.Common/Lint/CheckSequences.cs b/OpenRA.Mods.Common/Lint/CheckSequences.cs index daa864120e..ae3362cb5b 100644 --- a/OpenRA.Mods.Common/Lint/CheckSequences.cs +++ b/OpenRA.Mods.Common/Lint/CheckSequences.cs @@ -19,7 +19,7 @@ using OpenRA.Traits; namespace OpenRA.Mods.Common.Lint { - class CheckSequences : ILintSequencesPass, ILintServerMapPass + sealed class CheckSequences : ILintSequencesPass, ILintServerMapPass { void ILintServerMapPass.Run(Action emitError, Action emitWarning, ModData modData, MapPreview map, Ruleset mapRules) { diff --git a/OpenRA.Mods.Common/Lint/CheckSpriteBodies.cs b/OpenRA.Mods.Common/Lint/CheckSpriteBodies.cs index 1c13eb5c0e..670133d483 100644 --- a/OpenRA.Mods.Common/Lint/CheckSpriteBodies.cs +++ b/OpenRA.Mods.Common/Lint/CheckSpriteBodies.cs @@ -16,7 +16,7 @@ using OpenRA.Server; namespace OpenRA.Mods.Common.Lint { - class CheckSpriteBodies : ILintRulesPass, ILintServerMapPass + sealed class CheckSpriteBodies : ILintRulesPass, ILintServerMapPass { void ILintRulesPass.Run(Action emitError, Action emitWarning, ModData modData, Ruleset rules) { diff --git a/OpenRA.Mods.Common/Lint/CheckSyncAnnotations.cs b/OpenRA.Mods.Common/Lint/CheckSyncAnnotations.cs index 42c571bcc5..43791f7410 100644 --- a/OpenRA.Mods.Common/Lint/CheckSyncAnnotations.cs +++ b/OpenRA.Mods.Common/Lint/CheckSyncAnnotations.cs @@ -16,7 +16,7 @@ using System.Reflection; namespace OpenRA.Mods.Common.Lint { - class CheckSyncAnnotations : ILintPass + sealed class CheckSyncAnnotations : ILintPass { public void Run(Action emitError, Action emitWarning, ModData modData) { diff --git a/OpenRA.Mods.Common/Lint/CheckTooltips.cs b/OpenRA.Mods.Common/Lint/CheckTooltips.cs index 90b71d83bc..c864b7495d 100644 --- a/OpenRA.Mods.Common/Lint/CheckTooltips.cs +++ b/OpenRA.Mods.Common/Lint/CheckTooltips.cs @@ -16,7 +16,7 @@ using OpenRA.Server; namespace OpenRA.Mods.Common.Lint { - class CheckTooltips : ILintRulesPass, ILintServerMapPass + sealed class CheckTooltips : ILintRulesPass, ILintServerMapPass { void ILintRulesPass.Run(Action emitError, Action emitWarning, ModData modData, Ruleset rules) { diff --git a/OpenRA.Mods.Common/Lint/CheckTranslationReference.cs b/OpenRA.Mods.Common/Lint/CheckTranslationReference.cs index 4fd8467428..df2ff65fae 100644 --- a/OpenRA.Mods.Common/Lint/CheckTranslationReference.cs +++ b/OpenRA.Mods.Common/Lint/CheckTranslationReference.cs @@ -20,7 +20,7 @@ using OpenRA.Traits; namespace OpenRA.Mods.Common.Lint { - class CheckTranslationReference : ILintPass, ILintMapPass + sealed class CheckTranslationReference : ILintPass, ILintMapPass { const BindingFlags Binding = BindingFlags.Public | BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.Static; diff --git a/OpenRA.Mods.Common/Lint/CheckTranslationSyntax.cs b/OpenRA.Mods.Common/Lint/CheckTranslationSyntax.cs index fea4efedec..b6082a3979 100644 --- a/OpenRA.Mods.Common/Lint/CheckTranslationSyntax.cs +++ b/OpenRA.Mods.Common/Lint/CheckTranslationSyntax.cs @@ -18,7 +18,7 @@ using OpenRA.FileSystem; namespace OpenRA.Mods.Common.Lint { - class CheckTranslationSyntax : ILintPass, ILintMapPass + sealed class CheckTranslationSyntax : ILintPass, ILintMapPass { void ILintMapPass.Run(Action emitError, Action emitWarning, ModData modData, Map map) { diff --git a/OpenRA.Mods.Common/Lint/CheckUnknownTraitFields.cs b/OpenRA.Mods.Common/Lint/CheckUnknownTraitFields.cs index c3773b8352..e488ea3fd4 100644 --- a/OpenRA.Mods.Common/Lint/CheckUnknownTraitFields.cs +++ b/OpenRA.Mods.Common/Lint/CheckUnknownTraitFields.cs @@ -16,7 +16,7 @@ using OpenRA.Server; namespace OpenRA.Mods.Common.Lint { - class CheckUnknownTraitFields : ILintPass, ILintMapPass, ILintServerMapPass + sealed class CheckUnknownTraitFields : ILintPass, ILintMapPass, ILintServerMapPass { void ILintPass.Run(Action emitError, Action emitWarning, ModData modData) { diff --git a/OpenRA.Mods.Common/Lint/CheckUnknownWeaponFields.cs b/OpenRA.Mods.Common/Lint/CheckUnknownWeaponFields.cs index 1c6486e7f8..671b470b61 100644 --- a/OpenRA.Mods.Common/Lint/CheckUnknownWeaponFields.cs +++ b/OpenRA.Mods.Common/Lint/CheckUnknownWeaponFields.cs @@ -17,7 +17,7 @@ using OpenRA.Server; namespace OpenRA.Mods.Common.Lint { - class CheckUnknownWeaponFields : ILintPass, ILintMapPass, ILintServerMapPass + sealed class CheckUnknownWeaponFields : ILintPass, ILintMapPass, ILintServerMapPass { void ILintPass.Run(Action emitError, Action emitWarning, ModData modData) { diff --git a/OpenRA.Mods.Common/Lint/LintBuildablePrerequisites.cs b/OpenRA.Mods.Common/Lint/LintBuildablePrerequisites.cs index dc16ef24b5..52c3373565 100644 --- a/OpenRA.Mods.Common/Lint/LintBuildablePrerequisites.cs +++ b/OpenRA.Mods.Common/Lint/LintBuildablePrerequisites.cs @@ -16,7 +16,7 @@ using OpenRA.Server; namespace OpenRA.Mods.Common.Lint { - class LintBuildablePrerequisites : ILintRulesPass, ILintServerMapPass + sealed class LintBuildablePrerequisites : ILintRulesPass, ILintServerMapPass { void ILintRulesPass.Run(Action emitError, Action emitWarning, ModData modData, Ruleset rules) { diff --git a/OpenRA.Mods.Common/Orders/PlaceBuildingOrderGenerator.cs b/OpenRA.Mods.Common/Orders/PlaceBuildingOrderGenerator.cs index 90d55f0884..1cb4d5fefc 100644 --- a/OpenRA.Mods.Common/Orders/PlaceBuildingOrderGenerator.cs +++ b/OpenRA.Mods.Common/Orders/PlaceBuildingOrderGenerator.cs @@ -42,7 +42,7 @@ namespace OpenRA.Mods.Common.Orders { readonly string worldDefaultCursor = ChromeMetrics.Get("WorldDefaultCursor"); - class VariantWrapper + sealed class VariantWrapper { public readonly ActorInfo ActorInfo; public readonly BuildingInfo BuildingInfo; diff --git a/OpenRA.Mods.Common/Orders/UnitOrderGenerator.cs b/OpenRA.Mods.Common/Orders/UnitOrderGenerator.cs index f946605cd8..ec44d30f38 100644 --- a/OpenRA.Mods.Common/Orders/UnitOrderGenerator.cs +++ b/OpenRA.Mods.Common/Orders/UnitOrderGenerator.cs @@ -193,7 +193,7 @@ namespace OpenRA.Mods.Common.Orders return order; } - class UnitOrderResult + sealed class UnitOrderResult { public readonly Actor Actor; public readonly IOrderTargeter Order; diff --git a/OpenRA.Mods.Common/Pathfinder/CellInfoLayerPool.cs b/OpenRA.Mods.Common/Pathfinder/CellInfoLayerPool.cs index 89451bde1d..24d2a7e135 100644 --- a/OpenRA.Mods.Common/Pathfinder/CellInfoLayerPool.cs +++ b/OpenRA.Mods.Common/Pathfinder/CellInfoLayerPool.cs @@ -55,7 +55,7 @@ namespace OpenRA.Mods.Common.Pathfinder pool.Push(layer); } - public class PooledCellInfoLayer : IDisposable + public sealed class PooledCellInfoLayer : IDisposable { CellInfoLayerPool layerPool; List> layers = new(); diff --git a/OpenRA.Mods.Common/SpriteLoaders/DdsLoader.cs b/OpenRA.Mods.Common/SpriteLoaders/DdsLoader.cs index 8850ef78fd..100ed677ac 100644 --- a/OpenRA.Mods.Common/SpriteLoaders/DdsLoader.cs +++ b/OpenRA.Mods.Common/SpriteLoaders/DdsLoader.cs @@ -45,7 +45,7 @@ namespace OpenRA.Mods.Common.SpriteLoaders public class DdsSprite { - class DdsFrame : ISpriteFrame + sealed class DdsFrame : ISpriteFrame { public SpriteFrameType Type { get; } public Size Size { get; } diff --git a/OpenRA.Mods.Common/SpriteLoaders/PngSheetLoader.cs b/OpenRA.Mods.Common/SpriteLoaders/PngSheetLoader.cs index 91b0601515..7363dd786d 100644 --- a/OpenRA.Mods.Common/SpriteLoaders/PngSheetLoader.cs +++ b/OpenRA.Mods.Common/SpriteLoaders/PngSheetLoader.cs @@ -32,7 +32,7 @@ namespace OpenRA.Mods.Common.SpriteLoaders public class PngSheetLoader : ISpriteLoader { - class PngSheetFrame : ISpriteFrame + sealed class PngSheetFrame : ISpriteFrame { public SpriteFrameType Type { get; set; } public Size Size { get; set; } diff --git a/OpenRA.Mods.Common/SpriteLoaders/ShpTSLoader.cs b/OpenRA.Mods.Common/SpriteLoaders/ShpTSLoader.cs index 1140fda55b..8c7f11d660 100644 --- a/OpenRA.Mods.Common/SpriteLoaders/ShpTSLoader.cs +++ b/OpenRA.Mods.Common/SpriteLoaders/ShpTSLoader.cs @@ -18,7 +18,7 @@ namespace OpenRA.Mods.Common.SpriteLoaders { public class ShpTSLoader : ISpriteLoader { - class ShpTSFrame : ISpriteFrame + sealed class ShpTSFrame : ISpriteFrame { public SpriteFrameType Type => SpriteFrameType.Indexed8; public Size Size { get; } diff --git a/OpenRA.Mods.Common/Traits/Air/Aircraft.cs b/OpenRA.Mods.Common/Traits/Air/Aircraft.cs index ddcaa0d949..7809f8ec68 100644 --- a/OpenRA.Mods.Common/Traits/Air/Aircraft.cs +++ b/OpenRA.Mods.Common/Traits/Air/Aircraft.cs @@ -1230,7 +1230,7 @@ namespace OpenRA.Mods.Common.Traits return new AssociateWithAirfieldActivity(self, creationActivityDelay); } - class AssociateWithAirfieldActivity : Activity + sealed class AssociateWithAirfieldActivity : Activity { readonly Aircraft aircraft; readonly int delay; diff --git a/OpenRA.Mods.Common/Traits/Attack/AttackBase.cs b/OpenRA.Mods.Common/Traits/Attack/AttackBase.cs index d6cadb1f33..86f5e8d385 100644 --- a/OpenRA.Mods.Common/Traits/Attack/AttackBase.cs +++ b/OpenRA.Mods.Common/Traits/Attack/AttackBase.cs @@ -411,7 +411,7 @@ namespace OpenRA.Mods.Common.Traits return stances; } - class AttackOrderTargeter : IOrderTargeter + sealed class AttackOrderTargeter : IOrderTargeter { readonly AttackBase ab; @@ -514,7 +514,7 @@ namespace OpenRA.Mods.Common.Traits } } - public bool IsQueued { get; protected set; } + public bool IsQueued { get; private set; } } } } diff --git a/OpenRA.Mods.Common/Traits/Attack/AttackFollow.cs b/OpenRA.Mods.Common/Traits/Attack/AttackFollow.cs index 1d0008a8e4..1d2030c8c5 100644 --- a/OpenRA.Mods.Common/Traits/Attack/AttackFollow.cs +++ b/OpenRA.Mods.Common/Traits/Attack/AttackFollow.cs @@ -226,7 +226,7 @@ namespace OpenRA.Mods.Common.Traits } } - class AttackActivity : Activity, IActivityNotifyStanceChanged + sealed class AttackActivity : Activity, IActivityNotifyStanceChanged { readonly AttackFollow attack; readonly RevealsShroud[] revealsShroud; diff --git a/OpenRA.Mods.Common/Traits/AttackMove.cs b/OpenRA.Mods.Common/Traits/AttackMove.cs index cf4d473e97..cfac34de50 100644 --- a/OpenRA.Mods.Common/Traits/AttackMove.cs +++ b/OpenRA.Mods.Common/Traits/AttackMove.cs @@ -19,7 +19,7 @@ using OpenRA.Traits; namespace OpenRA.Mods.Common.Traits { [Desc("Provides access to the attack-move command, which will make the actor automatically engage viable targets while moving to the destination.")] - class AttackMoveInfo : TraitInfo, Requires + sealed class AttackMoveInfo : TraitInfo, Requires { [VoiceReference] public readonly string Voice = "Action"; @@ -53,7 +53,7 @@ namespace OpenRA.Mods.Common.Traits public override object Create(ActorInitializer init) { return new AttackMove(init.Self, this); } } - class AttackMove : IResolveOrder, IOrderVoice + sealed class AttackMove : IResolveOrder, IOrderVoice { public readonly AttackMoveInfo Info; readonly IMove move; diff --git a/OpenRA.Mods.Common/Traits/AttackWander.cs b/OpenRA.Mods.Common/Traits/AttackWander.cs index be39f2b3df..9640dc98b5 100644 --- a/OpenRA.Mods.Common/Traits/AttackWander.cs +++ b/OpenRA.Mods.Common/Traits/AttackWander.cs @@ -16,12 +16,12 @@ namespace OpenRA.Mods.Common.Traits { [Desc("Will AttackMove to a random location within MoveRadius when idle.", "This conflicts with player orders and should only be added to animal creeps.")] - class AttackWanderInfo : WandersInfo, Requires + sealed class AttackWanderInfo : WandersInfo, Requires { public override object Create(ActorInitializer init) { return new AttackWander(init.Self, this); } } - class AttackWander : Wanders + sealed class AttackWander : Wanders { readonly AttackMove attackMove; diff --git a/OpenRA.Mods.Common/Traits/AutoCarryall.cs b/OpenRA.Mods.Common/Traits/AutoCarryall.cs index 81a7c2039b..189a4e0672 100644 --- a/OpenRA.Mods.Common/Traits/AutoCarryall.cs +++ b/OpenRA.Mods.Common/Traits/AutoCarryall.cs @@ -102,7 +102,7 @@ namespace OpenRA.Mods.Common.Traits } } - class FerryUnit : Activity + sealed class FerryUnit : Activity { readonly Actor cargo; readonly Carryable carryable; diff --git a/OpenRA.Mods.Common/Traits/AutoCrusher.cs b/OpenRA.Mods.Common/Traits/AutoCrusher.cs index 4856e662c9..4bf5818b38 100644 --- a/OpenRA.Mods.Common/Traits/AutoCrusher.cs +++ b/OpenRA.Mods.Common/Traits/AutoCrusher.cs @@ -16,7 +16,7 @@ using OpenRA.Traits; namespace OpenRA.Mods.Common.Traits { - class AutoCrusherInfo : PausableConditionalTraitInfo, Requires + sealed class AutoCrusherInfo : PausableConditionalTraitInfo, Requires { [Desc("Maximum range to scan for targets.")] public readonly WDist ScanRadius = WDist.FromCells(5); @@ -36,20 +36,20 @@ namespace OpenRA.Mods.Common.Traits public override object Create(ActorInitializer init) { return new AutoCrusher(init.Self, this); } } - class AutoCrusher : PausableConditionalTrait, INotifyIdle + sealed class AutoCrusher : PausableConditionalTrait, INotifyIdle { int nextScanTime; readonly IMoveInfo moveInfo; readonly bool isAircraft; - protected readonly IMove Move; + readonly IMove move; public AutoCrusher(Actor self, AutoCrusherInfo info) : base(info) { - Move = self.Trait(); + move = self.Trait(); moveInfo = self.Info.TraitInfo(); nextScanTime = self.World.SharedRandom.Next(Info.MinimumScanTimeInterval, Info.MaximumScanTimeInterval); - isAircraft = Move is Aircraft; + isAircraft = move is Aircraft; } void INotifyIdle.TickIdle(Actor self) @@ -71,7 +71,7 @@ namespace OpenRA.Mods.Common.Traits if (isAircraft) self.QueueActivity(new Land(self, Target.FromActor(crushableActor), targetLineColor: moveInfo.GetTargetLineColor())); else - self.QueueActivity(Move.MoveTo(crushableActor.Location, targetLineColor: moveInfo.GetTargetLineColor())); + self.QueueActivity(move.MoveTo(crushableActor.Location, targetLineColor: moveInfo.GetTargetLineColor())); nextScanTime = self.World.SharedRandom.Next(Info.MinimumScanTimeInterval, Info.MaximumScanTimeInterval); } diff --git a/OpenRA.Mods.Common/Traits/BotModules/BotModuleLogic/BaseBuilderQueueManager.cs b/OpenRA.Mods.Common/Traits/BotModules/BotModuleLogic/BaseBuilderQueueManager.cs index ca0f3a2a76..f96d666a63 100644 --- a/OpenRA.Mods.Common/Traits/BotModules/BotModuleLogic/BaseBuilderQueueManager.cs +++ b/OpenRA.Mods.Common/Traits/BotModules/BotModuleLogic/BaseBuilderQueueManager.cs @@ -16,7 +16,7 @@ using OpenRA.Traits; namespace OpenRA.Mods.Common.Traits { - class BaseBuilderQueueManager + sealed class BaseBuilderQueueManager { readonly string category; diff --git a/OpenRA.Mods.Common/Traits/BotModules/HarvesterBotModule.cs b/OpenRA.Mods.Common/Traits/BotModules/HarvesterBotModule.cs index ecf8107f4d..21892c0850 100644 --- a/OpenRA.Mods.Common/Traits/BotModules/HarvesterBotModule.cs +++ b/OpenRA.Mods.Common/Traits/BotModules/HarvesterBotModule.cs @@ -38,7 +38,7 @@ namespace OpenRA.Mods.Common.Traits public class HarvesterBotModule : ConditionalTrait, IBotTick { - class HarvesterTraitWrapper + sealed class HarvesterTraitWrapper { public readonly Actor Actor; public readonly Harvester Harvester; diff --git a/OpenRA.Mods.Common/Traits/BotModules/Squads/StateMachine.cs b/OpenRA.Mods.Common/Traits/BotModules/Squads/StateMachine.cs index ca50f692b3..8c40f0995e 100644 --- a/OpenRA.Mods.Common/Traits/BotModules/Squads/StateMachine.cs +++ b/OpenRA.Mods.Common/Traits/BotModules/Squads/StateMachine.cs @@ -11,7 +11,7 @@ namespace OpenRA.Mods.Common.Traits.BotModules.Squads { - class StateMachine + sealed class StateMachine { IState currentState; IState previousState; diff --git a/OpenRA.Mods.Common/Traits/BotModules/Squads/States/AirStates.cs b/OpenRA.Mods.Common/Traits/BotModules/Squads/States/AirStates.cs index c264c25ddc..43b8137d7e 100644 --- a/OpenRA.Mods.Common/Traits/BotModules/Squads/States/AirStates.cs +++ b/OpenRA.Mods.Common/Traits/BotModules/Squads/States/AirStates.cs @@ -115,7 +115,7 @@ namespace OpenRA.Mods.Common.Traits.BotModules.Squads } } - class AirIdleState : AirStateBase, IState + sealed class AirIdleState : AirStateBase, IState { public void Activate(Squad owner) { } @@ -141,7 +141,7 @@ namespace OpenRA.Mods.Common.Traits.BotModules.Squads public void Deactivate(Squad owner) { } } - class AirAttackState : AirStateBase, IState + sealed class AirAttackState : AirStateBase, IState { public void Activate(Squad owner) { } @@ -195,7 +195,7 @@ namespace OpenRA.Mods.Common.Traits.BotModules.Squads public void Deactivate(Squad owner) { } } - class AirFleeState : AirStateBase, IState + sealed class AirFleeState : AirStateBase, IState { public void Activate(Squad owner) { } diff --git a/OpenRA.Mods.Common/Traits/BotModules/Squads/States/GroundStates.cs b/OpenRA.Mods.Common/Traits/BotModules/Squads/States/GroundStates.cs index 70754fa927..796224a701 100644 --- a/OpenRA.Mods.Common/Traits/BotModules/Squads/States/GroundStates.cs +++ b/OpenRA.Mods.Common/Traits/BotModules/Squads/States/GroundStates.cs @@ -27,7 +27,7 @@ namespace OpenRA.Mods.Common.Traits.BotModules.Squads } } - class GroundUnitsIdleState : GroundStateBase, IState + sealed class GroundUnitsIdleState : GroundStateBase, IState { public void Activate(Squad owner) { } @@ -65,7 +65,7 @@ namespace OpenRA.Mods.Common.Traits.BotModules.Squads public void Deactivate(Squad owner) { } } - class GroundUnitsAttackMoveState : GroundStateBase, IState + sealed class GroundUnitsAttackMoveState : GroundStateBase, IState { int lastUpdatedTick; CPos? lastLeaderLocation; @@ -148,7 +148,7 @@ namespace OpenRA.Mods.Common.Traits.BotModules.Squads public void Deactivate(Squad owner) { } } - class GroundUnitsAttackState : GroundStateBase, IState + sealed class GroundUnitsAttackState : GroundStateBase, IState { int lastUpdatedTick; CPos? lastLeaderLocation; @@ -206,7 +206,7 @@ namespace OpenRA.Mods.Common.Traits.BotModules.Squads public void Deactivate(Squad owner) { } } - class GroundUnitsFleeState : GroundStateBase, IState + sealed class GroundUnitsFleeState : GroundStateBase, IState { public void Activate(Squad owner) { } diff --git a/OpenRA.Mods.Common/Traits/BotModules/Squads/States/NavyStates.cs b/OpenRA.Mods.Common/Traits/BotModules/Squads/States/NavyStates.cs index 74afef7870..4371aff747 100644 --- a/OpenRA.Mods.Common/Traits/BotModules/Squads/States/NavyStates.cs +++ b/OpenRA.Mods.Common/Traits/BotModules/Squads/States/NavyStates.cs @@ -51,7 +51,7 @@ namespace OpenRA.Mods.Common.Traits.BotModules.Squads } } - class NavyUnitsIdleState : NavyStateBase, IState + sealed class NavyUnitsIdleState : NavyStateBase, IState { public void Activate(Squad owner) { } @@ -89,7 +89,7 @@ namespace OpenRA.Mods.Common.Traits.BotModules.Squads public void Deactivate(Squad owner) { } } - class NavyUnitsAttackMoveState : NavyStateBase, IState + sealed class NavyUnitsAttackMoveState : NavyStateBase, IState { int lastUpdatedTick; CPos? lastLeaderLocation; @@ -172,7 +172,7 @@ namespace OpenRA.Mods.Common.Traits.BotModules.Squads public void Deactivate(Squad owner) { } } - class NavyUnitsAttackState : NavyStateBase, IState + sealed class NavyUnitsAttackState : NavyStateBase, IState { int lastUpdatedTick; CPos? lastLeaderLocation; @@ -230,7 +230,7 @@ namespace OpenRA.Mods.Common.Traits.BotModules.Squads public void Deactivate(Squad owner) { } } - class NavyUnitsFleeState : NavyStateBase, IState + sealed class NavyUnitsFleeState : NavyStateBase, IState { public void Activate(Squad owner) { } diff --git a/OpenRA.Mods.Common/Traits/BotModules/Squads/States/ProtectionStates.cs b/OpenRA.Mods.Common/Traits/BotModules/Squads/States/ProtectionStates.cs index d64113bd95..a5998990ec 100644 --- a/OpenRA.Mods.Common/Traits/BotModules/Squads/States/ProtectionStates.cs +++ b/OpenRA.Mods.Common/Traits/BotModules/Squads/States/ProtectionStates.cs @@ -13,14 +13,14 @@ using OpenRA.Traits; namespace OpenRA.Mods.Common.Traits.BotModules.Squads { - class UnitsForProtectionIdleState : GroundStateBase, IState + sealed class UnitsForProtectionIdleState : GroundStateBase, IState { public void Activate(Squad owner) { } public void Tick(Squad owner) { owner.FuzzyStateMachine.ChangeState(owner, new UnitsForProtectionAttackState(), true); } public void Deactivate(Squad owner) { } } - class UnitsForProtectionAttackState : GroundStateBase, IState + sealed class UnitsForProtectionAttackState : GroundStateBase, IState { public const int BackoffTicks = 4; internal int Backoff = BackoffTicks; @@ -61,7 +61,7 @@ namespace OpenRA.Mods.Common.Traits.BotModules.Squads public void Deactivate(Squad owner) { } } - class UnitsForProtectionFleeState : GroundStateBase, IState + sealed class UnitsForProtectionFleeState : GroundStateBase, IState { public void Activate(Squad owner) { } diff --git a/OpenRA.Mods.Common/Traits/Buildings/BridgePlaceholder.cs b/OpenRA.Mods.Common/Traits/Buildings/BridgePlaceholder.cs index 674ef1b149..0d9403c7cd 100644 --- a/OpenRA.Mods.Common/Traits/Buildings/BridgePlaceholder.cs +++ b/OpenRA.Mods.Common/Traits/Buildings/BridgePlaceholder.cs @@ -16,7 +16,7 @@ using OpenRA.Traits; namespace OpenRA.Mods.Common.Traits { [Desc("Placeholder actor used for dead segments and bridge end ramps.")] - class BridgePlaceholderInfo : TraitInfo + sealed class BridgePlaceholderInfo : TraitInfo { public readonly string Type = "GroundLevelBridge"; @@ -31,7 +31,7 @@ namespace OpenRA.Mods.Common.Traits public override object Create(ActorInitializer init) { return new BridgePlaceholder(init.Self, this); } } - class BridgePlaceholder : IBridgeSegment, INotifyAddedToWorld, INotifyRemovedFromWorld + sealed class BridgePlaceholder : IBridgeSegment, INotifyAddedToWorld, INotifyRemovedFromWorld { public readonly BridgePlaceholderInfo Info; readonly Actor self; diff --git a/OpenRA.Mods.Common/Traits/Buildings/BuildingInfluence.cs b/OpenRA.Mods.Common/Traits/Buildings/BuildingInfluence.cs index 72629fcd95..baa5be1149 100644 --- a/OpenRA.Mods.Common/Traits/Buildings/BuildingInfluence.cs +++ b/OpenRA.Mods.Common/Traits/Buildings/BuildingInfluence.cs @@ -23,7 +23,7 @@ namespace OpenRA.Mods.Common.Traits public class BuildingInfluence { - class InfluenceNode + sealed class InfluenceNode { public InfluenceNode Next; public Actor Actor; diff --git a/OpenRA.Mods.Common/Traits/Buildings/GroundLevelBridge.cs b/OpenRA.Mods.Common/Traits/Buildings/GroundLevelBridge.cs index 5ea67a06a9..420dddbe32 100644 --- a/OpenRA.Mods.Common/Traits/Buildings/GroundLevelBridge.cs +++ b/OpenRA.Mods.Common/Traits/Buildings/GroundLevelBridge.cs @@ -18,7 +18,7 @@ using OpenRA.Traits; namespace OpenRA.Mods.Common.Traits { [Desc("Bridge actor that can't be passed underneath.")] - class GroundLevelBridgeInfo : TraitInfo, IRulesetLoaded, Requires, Requires + sealed class GroundLevelBridgeInfo : TraitInfo, IRulesetLoaded, Requires, Requires { public readonly string TerrainType = "Bridge"; @@ -47,7 +47,7 @@ namespace OpenRA.Mods.Common.Traits public override object Create(ActorInitializer init) { return new GroundLevelBridge(init.Self, this); } } - class GroundLevelBridge : IBridgeSegment, INotifyAddedToWorld, INotifyRemovedFromWorld + sealed class GroundLevelBridge : IBridgeSegment, INotifyAddedToWorld, INotifyRemovedFromWorld { public readonly GroundLevelBridgeInfo Info; readonly Actor self; diff --git a/OpenRA.Mods.Common/Traits/Buildings/ProductionAirdrop.cs b/OpenRA.Mods.Common/Traits/Buildings/ProductionAirdrop.cs index b41f6cb8fc..3139c09bf3 100644 --- a/OpenRA.Mods.Common/Traits/Buildings/ProductionAirdrop.cs +++ b/OpenRA.Mods.Common/Traits/Buildings/ProductionAirdrop.cs @@ -41,7 +41,7 @@ namespace OpenRA.Mods.Common.Traits public override object Create(ActorInitializer init) { return new ProductionAirdrop(init, this); } } - class ProductionAirdrop : Production + sealed class ProductionAirdrop : Production { public ProductionAirdrop(ActorInitializer init, ProductionAirdropInfo info) : base(init, info) { } diff --git a/OpenRA.Mods.Common/Traits/Buildings/RallyPoint.cs b/OpenRA.Mods.Common/Traits/Buildings/RallyPoint.cs index 130c14a554..52e5188121 100644 --- a/OpenRA.Mods.Common/Traits/Buildings/RallyPoint.cs +++ b/OpenRA.Mods.Common/Traits/Buildings/RallyPoint.cs @@ -138,7 +138,7 @@ namespace OpenRA.Mods.Common.Traits return order.OrderString == OrderID && order.ExtraData == ForceSet; } - class RallyPointOrderTargeter : IOrderTargeter + sealed class RallyPointOrderTargeter : IOrderTargeter { readonly RallyPointInfo info; @@ -151,7 +151,7 @@ namespace OpenRA.Mods.Common.Traits public int OrderPriority => 0; public bool TargetOverridesSelection(Actor self, in Target target, List actorsAt, CPos xy, TargetModifiers modifiers) { return true; } public bool ForceSet { get; private set; } - public bool IsQueued { get; protected set; } + public bool IsQueued { get; private set; } public bool CanTarget(Actor self, in Target target, ref TargetModifiers modifiers, ref string cursor) { diff --git a/OpenRA.Mods.Common/Traits/Buildings/Reservable.cs b/OpenRA.Mods.Common/Traits/Buildings/Reservable.cs index 6f19edbbe4..761cfa9bce 100644 --- a/OpenRA.Mods.Common/Traits/Buildings/Reservable.cs +++ b/OpenRA.Mods.Common/Traits/Buildings/Reservable.cs @@ -17,7 +17,7 @@ using OpenRA.Traits; namespace OpenRA.Mods.Common.Traits { [Desc("Reserve landing places for aircraft.")] - class ReservableInfo : TraitInfo { } + sealed class ReservableInfo : TraitInfo { } public class Reservable : ITick, INotifyOwnerChanged, INotifySold, INotifyActorDisposing, INotifyCreated { diff --git a/OpenRA.Mods.Common/Traits/Buildings/SequencePlaceBuildingPreview.cs b/OpenRA.Mods.Common/Traits/Buildings/SequencePlaceBuildingPreview.cs index d619bfd128..decd80cb33 100644 --- a/OpenRA.Mods.Common/Traits/Buildings/SequencePlaceBuildingPreview.cs +++ b/OpenRA.Mods.Common/Traits/Buildings/SequencePlaceBuildingPreview.cs @@ -47,7 +47,7 @@ namespace OpenRA.Mods.Common.Traits public class SequencePlaceBuildingPreview { } - class SequencePlaceBuildingPreviewPreview : FootprintPlaceBuildingPreviewPreview + sealed class SequencePlaceBuildingPreviewPreview : FootprintPlaceBuildingPreviewPreview { readonly SequencePlaceBuildingPreviewInfo info; readonly Animation preview; diff --git a/OpenRA.Mods.Common/Traits/Buildings/TransformsIntoAircraft.cs b/OpenRA.Mods.Common/Traits/Buildings/TransformsIntoAircraft.cs index 42d47eed16..77ccc847b3 100644 --- a/OpenRA.Mods.Common/Traits/Buildings/TransformsIntoAircraft.cs +++ b/OpenRA.Mods.Common/Traits/Buildings/TransformsIntoAircraft.cs @@ -178,7 +178,7 @@ namespace OpenRA.Mods.Common.Traits } } - class AircraftMoveOrderTargeter : IOrderTargeter + sealed class AircraftMoveOrderTargeter : IOrderTargeter { readonly TransformsIntoAircraft aircraft; @@ -198,7 +198,7 @@ namespace OpenRA.Mods.Common.Traits public string OrderID => "Move"; public int OrderPriority => 4; - public bool IsQueued { get; protected set; } + public bool IsQueued { get; private set; } public bool CanTarget(Actor self, in Target target, ref TargetModifiers modifiers, ref string cursor) { diff --git a/OpenRA.Mods.Common/Traits/Buildings/TransformsIntoMobile.cs b/OpenRA.Mods.Common/Traits/Buildings/TransformsIntoMobile.cs index f04127695e..753be42533 100644 --- a/OpenRA.Mods.Common/Traits/Buildings/TransformsIntoMobile.cs +++ b/OpenRA.Mods.Common/Traits/Buildings/TransformsIntoMobile.cs @@ -166,7 +166,7 @@ namespace OpenRA.Mods.Common.Traits } } - class MoveOrderTargeter : IOrderTargeter + sealed class MoveOrderTargeter : IOrderTargeter { readonly TransformsIntoMobile mobile; readonly bool rejectMove; @@ -187,7 +187,7 @@ namespace OpenRA.Mods.Common.Traits public string OrderID => "Move"; public int OrderPriority => 4; - public bool IsQueued { get; protected set; } + public bool IsQueued { get; private set; } public bool CanTarget(Actor self, in Target target, ref TargetModifiers modifiers, ref string cursor) { diff --git a/OpenRA.Mods.Common/Traits/CapturableProgressBar.cs b/OpenRA.Mods.Common/Traits/CapturableProgressBar.cs index 2e79979c6d..8145e4fceb 100644 --- a/OpenRA.Mods.Common/Traits/CapturableProgressBar.cs +++ b/OpenRA.Mods.Common/Traits/CapturableProgressBar.cs @@ -17,14 +17,14 @@ using OpenRA.Traits; namespace OpenRA.Mods.Common.Traits { [Desc("Visualize capture progress.")] - class CapturableProgressBarInfo : ConditionalTraitInfo, Requires + sealed class CapturableProgressBarInfo : ConditionalTraitInfo, Requires { public readonly Color Color = Color.Orange; public override object Create(ActorInitializer init) { return new CapturableProgressBar(this); } } - class CapturableProgressBar : ConditionalTrait, ISelectionBar, ICaptureProgressWatcher + sealed class CapturableProgressBar : ConditionalTrait, ISelectionBar, ICaptureProgressWatcher { readonly Dictionary progress = new(); diff --git a/OpenRA.Mods.Common/Traits/CapturableProgressBlink.cs b/OpenRA.Mods.Common/Traits/CapturableProgressBlink.cs index fccfcb5a49..d7900d2855 100644 --- a/OpenRA.Mods.Common/Traits/CapturableProgressBlink.cs +++ b/OpenRA.Mods.Common/Traits/CapturableProgressBlink.cs @@ -17,7 +17,7 @@ using OpenRA.Traits; namespace OpenRA.Mods.Common.Traits { [Desc("Blinks the actor and captor when it is being captured.")] - class CapturableProgressBlinkInfo : ConditionalTraitInfo, Requires + sealed class CapturableProgressBlinkInfo : ConditionalTraitInfo, Requires { [Desc("Number of ticks to wait between repeating blinks.")] public readonly int Interval = 50; @@ -25,7 +25,7 @@ namespace OpenRA.Mods.Common.Traits public override object Create(ActorInitializer init) { return new CapturableProgressBlink(this); } } - class CapturableProgressBlink : ConditionalTrait, ITick, ICaptureProgressWatcher + sealed class CapturableProgressBlink : ConditionalTrait, ITick, ICaptureProgressWatcher { readonly List captorOwners = new(); readonly HashSet captors = new(); diff --git a/OpenRA.Mods.Common/Traits/CaptureProgressBar.cs b/OpenRA.Mods.Common/Traits/CaptureProgressBar.cs index f5e2b2179f..c27b6753d3 100644 --- a/OpenRA.Mods.Common/Traits/CaptureProgressBar.cs +++ b/OpenRA.Mods.Common/Traits/CaptureProgressBar.cs @@ -15,14 +15,14 @@ using OpenRA.Traits; namespace OpenRA.Mods.Common.Traits { [Desc("Visualize the progress of this actor being captured.")] - class CaptureProgressBarInfo : ConditionalTraitInfo, Requires + sealed class CaptureProgressBarInfo : ConditionalTraitInfo, Requires { public readonly Color Color = Color.Orange; public override object Create(ActorInitializer init) { return new CaptureProgressBar(this); } } - class CaptureProgressBar : ConditionalTrait, ISelectionBar, ICaptureProgressWatcher + sealed class CaptureProgressBar : ConditionalTrait, ISelectionBar, ICaptureProgressWatcher { int current; int total; diff --git a/OpenRA.Mods.Common/Traits/Captures.cs b/OpenRA.Mods.Common/Traits/Captures.cs index fa18c41e12..935ac88fbf 100644 --- a/OpenRA.Mods.Common/Traits/Captures.cs +++ b/OpenRA.Mods.Common/Traits/Captures.cs @@ -113,7 +113,7 @@ namespace OpenRA.Mods.Common.Traits protected override void TraitEnabled(Actor self) { captureManager.RefreshCaptures(); } protected override void TraitDisabled(Actor self) { captureManager.RefreshCaptures(); } - class CaptureOrderTargeter : UnitOrderTargeter + sealed class CaptureOrderTargeter : UnitOrderTargeter { readonly Captures captures; diff --git a/OpenRA.Mods.Common/Traits/Carryall.cs b/OpenRA.Mods.Common/Traits/Carryall.cs index 17d0cbd36b..a81681c37c 100644 --- a/OpenRA.Mods.Common/Traits/Carryall.cs +++ b/OpenRA.Mods.Common/Traits/Carryall.cs @@ -378,7 +378,7 @@ namespace OpenRA.Mods.Common.Traits } } - class CarryallPickupOrderTargeter : UnitOrderTargeter + sealed class CarryallPickupOrderTargeter : UnitOrderTargeter { public CarryallPickupOrderTargeter(CarryallInfo info) : base("PickupUnit", 5, info.PickUpCursor, false, true) @@ -411,14 +411,14 @@ namespace OpenRA.Mods.Common.Traits } } - class CarryallDeliverUnitTargeter : IOrderTargeter + sealed class CarryallDeliverUnitTargeter : IOrderTargeter { readonly AircraftInfo aircraftInfo; readonly CarryallInfo info; public string OrderID => "DeliverUnit"; public int OrderPriority => 6; - public bool IsQueued { get; protected set; } + public bool IsQueued { get; private set; } public bool TargetOverridesSelection(Actor self, in Target target, List actorsAt, CPos xy, TargetModifiers modifiers) { return true; } public CarryallDeliverUnitTargeter(AircraftInfo aircraftInfo, CarryallInfo info) diff --git a/OpenRA.Mods.Common/Traits/ChangesHealth.cs b/OpenRA.Mods.Common/Traits/ChangesHealth.cs index 6752de7710..1bf574639b 100644 --- a/OpenRA.Mods.Common/Traits/ChangesHealth.cs +++ b/OpenRA.Mods.Common/Traits/ChangesHealth.cs @@ -15,7 +15,7 @@ using OpenRA.Traits; namespace OpenRA.Mods.Common.Traits { [Desc("Attach this to actors which should regenerate or lose health points over time.")] - class ChangesHealthInfo : ConditionalTraitInfo, Requires + sealed class ChangesHealthInfo : ConditionalTraitInfo, Requires { [Desc("Absolute amount of health points added in each step.", "Use negative values to apply damage.")] @@ -41,7 +41,7 @@ namespace OpenRA.Mods.Common.Traits public override object Create(ActorInitializer init) { return new ChangesHealth(init.Self, this); } } - class ChangesHealth : ConditionalTrait, ITick, INotifyDamage, ISync + sealed class ChangesHealth : ConditionalTrait, ITick, INotifyDamage, ISync { readonly IHealth health; diff --git a/OpenRA.Mods.Common/Traits/ChangesTerrain.cs b/OpenRA.Mods.Common/Traits/ChangesTerrain.cs index 4f36d547b4..0dd78da4b6 100644 --- a/OpenRA.Mods.Common/Traits/ChangesTerrain.cs +++ b/OpenRA.Mods.Common/Traits/ChangesTerrain.cs @@ -14,7 +14,7 @@ using OpenRA.Traits; namespace OpenRA.Mods.Common.Traits { [Desc("Modifies the terrain type underneath the actors location.")] - class ChangesTerrainInfo : TraitInfo, Requires + sealed class ChangesTerrainInfo : TraitInfo, Requires { [FieldLoader.Require] public readonly string TerrainType = null; @@ -22,7 +22,7 @@ namespace OpenRA.Mods.Common.Traits public override object Create(ActorInitializer init) { return new ChangesTerrain(this); } } - class ChangesTerrain : INotifyAddedToWorld, INotifyRemovedFromWorld + sealed class ChangesTerrain : INotifyAddedToWorld, INotifyRemovedFromWorld { readonly ChangesTerrainInfo info; byte previousTerrain; diff --git a/OpenRA.Mods.Common/Traits/Conditions/GrantCondition.cs b/OpenRA.Mods.Common/Traits/Conditions/GrantCondition.cs index 4262ffecec..14dcac2a11 100644 --- a/OpenRA.Mods.Common/Traits/Conditions/GrantCondition.cs +++ b/OpenRA.Mods.Common/Traits/Conditions/GrantCondition.cs @@ -14,7 +14,7 @@ using OpenRA.Traits; namespace OpenRA.Mods.Common.Traits { [Desc("Grants a condition while the trait is active.")] - class GrantConditionInfo : ConditionalTraitInfo + sealed class GrantConditionInfo : ConditionalTraitInfo { [FieldLoader.Require] [GrantedConditionReference] @@ -27,7 +27,7 @@ namespace OpenRA.Mods.Common.Traits public override object Create(ActorInitializer init) { return new GrantCondition(this); } } - class GrantCondition : ConditionalTrait + sealed class GrantCondition : ConditionalTrait { int conditionToken = Actor.InvalidConditionToken; diff --git a/OpenRA.Mods.Common/Traits/Conditions/GrantConditionOnFaction.cs b/OpenRA.Mods.Common/Traits/Conditions/GrantConditionOnFaction.cs index 742bfd7e07..ef4575b0f5 100644 --- a/OpenRA.Mods.Common/Traits/Conditions/GrantConditionOnFaction.cs +++ b/OpenRA.Mods.Common/Traits/Conditions/GrantConditionOnFaction.cs @@ -15,7 +15,7 @@ using OpenRA.Traits; namespace OpenRA.Mods.Common.Traits { [Desc("Grants a condition while the trait is active.")] - class GrantConditionOnFactionInfo : ConditionalTraitInfo + sealed class GrantConditionOnFactionInfo : ConditionalTraitInfo { [FieldLoader.Require] [GrantedConditionReference] @@ -31,7 +31,7 @@ namespace OpenRA.Mods.Common.Traits public override object Create(ActorInitializer init) { return new GrantConditionOnFaction(init, this); } } - class GrantConditionOnFaction : ConditionalTrait, INotifyOwnerChanged + sealed class GrantConditionOnFaction : ConditionalTrait, INotifyOwnerChanged { int conditionToken = Actor.InvalidConditionToken; string faction; diff --git a/OpenRA.Mods.Common/Traits/Crates/DuplicateUnitCrateAction.cs b/OpenRA.Mods.Common/Traits/Crates/DuplicateUnitCrateAction.cs index ab80cde475..05bebc0bd9 100644 --- a/OpenRA.Mods.Common/Traits/Crates/DuplicateUnitCrateAction.cs +++ b/OpenRA.Mods.Common/Traits/Crates/DuplicateUnitCrateAction.cs @@ -18,7 +18,7 @@ using OpenRA.Traits; namespace OpenRA.Mods.Common.Traits { [Desc("Creates duplicates of the actor that collects the crate.")] - class DuplicateUnitCrateActionInfo : CrateActionInfo + sealed class DuplicateUnitCrateActionInfo : CrateActionInfo { [Desc("The maximum number of duplicates to make.")] public readonly int MaxAmount = 2; @@ -44,7 +44,7 @@ namespace OpenRA.Mods.Common.Traits public override object Create(ActorInitializer init) { return new DuplicateUnitCrateAction(init.Self, this); } } - class DuplicateUnitCrateAction : CrateAction + sealed class DuplicateUnitCrateAction : CrateAction { readonly DuplicateUnitCrateActionInfo info; diff --git a/OpenRA.Mods.Common/Traits/Crates/ExplodeCrateAction.cs b/OpenRA.Mods.Common/Traits/Crates/ExplodeCrateAction.cs index 721da5bf61..5f9d158d0b 100644 --- a/OpenRA.Mods.Common/Traits/Crates/ExplodeCrateAction.cs +++ b/OpenRA.Mods.Common/Traits/Crates/ExplodeCrateAction.cs @@ -14,7 +14,7 @@ using OpenRA.Traits; namespace OpenRA.Mods.Common.Traits { [Desc("Fires a weapon at the location when collected.")] - class ExplodeCrateActionInfo : CrateActionInfo + sealed class ExplodeCrateActionInfo : CrateActionInfo { [WeaponReference] [FieldLoader.Require] @@ -24,7 +24,7 @@ namespace OpenRA.Mods.Common.Traits public override object Create(ActorInitializer init) { return new ExplodeCrateAction(init.Self, this); } } - class ExplodeCrateAction : CrateAction + sealed class ExplodeCrateAction : CrateAction { readonly ExplodeCrateActionInfo info; diff --git a/OpenRA.Mods.Common/Traits/Crates/GiveCashCrateAction.cs b/OpenRA.Mods.Common/Traits/Crates/GiveCashCrateAction.cs index 67e6de8c1d..f9c71669da 100644 --- a/OpenRA.Mods.Common/Traits/Crates/GiveCashCrateAction.cs +++ b/OpenRA.Mods.Common/Traits/Crates/GiveCashCrateAction.cs @@ -14,7 +14,7 @@ using OpenRA.Mods.Common.Effects; namespace OpenRA.Mods.Common.Traits { [Desc("Gives cash to the collector.")] - class GiveCashCrateActionInfo : CrateActionInfo + sealed class GiveCashCrateActionInfo : CrateActionInfo { [Desc("Amount of cash to give.")] public readonly int Amount = 2000; @@ -25,7 +25,7 @@ namespace OpenRA.Mods.Common.Traits public override object Create(ActorInitializer init) { return new GiveCashCrateAction(init.Self, this); } } - class GiveCashCrateAction : CrateAction + sealed class GiveCashCrateAction : CrateAction { readonly GiveCashCrateActionInfo info; public GiveCashCrateAction(Actor self, GiveCashCrateActionInfo info) diff --git a/OpenRA.Mods.Common/Traits/Crates/GiveMcvCrateAction.cs b/OpenRA.Mods.Common/Traits/Crates/GiveMcvCrateAction.cs index 0a42380c40..6eb0f3d96c 100644 --- a/OpenRA.Mods.Common/Traits/Crates/GiveMcvCrateAction.cs +++ b/OpenRA.Mods.Common/Traits/Crates/GiveMcvCrateAction.cs @@ -14,7 +14,7 @@ using System.Linq; namespace OpenRA.Mods.Common.Traits { [Desc("Spawns units when collected.", "Adjust selection shares when player has no base.")] - class GiveBaseBuilderCrateActionInfo : GiveUnitCrateActionInfo + sealed class GiveBaseBuilderCrateActionInfo : GiveUnitCrateActionInfo { [Desc("The selection shares to use if the collector has no actor with `" + nameof(BaseBuilding) + ".")] public readonly int NoBaseSelectionShares = 1000; @@ -22,7 +22,7 @@ namespace OpenRA.Mods.Common.Traits public override object Create(ActorInitializer init) { return new GiveBaseBuilderCrateAction(init.Self, this); } } - class GiveBaseBuilderCrateAction : GiveUnitCrateAction + sealed class GiveBaseBuilderCrateAction : GiveUnitCrateAction { readonly GiveBaseBuilderCrateActionInfo info; public GiveBaseBuilderCrateAction(Actor self, GiveBaseBuilderCrateActionInfo info) diff --git a/OpenRA.Mods.Common/Traits/Crates/HealActorsCrateAction.cs b/OpenRA.Mods.Common/Traits/Crates/HealActorsCrateAction.cs index e1a3a0cdf5..aae43b09d0 100644 --- a/OpenRA.Mods.Common/Traits/Crates/HealActorsCrateAction.cs +++ b/OpenRA.Mods.Common/Traits/Crates/HealActorsCrateAction.cs @@ -16,7 +16,7 @@ using OpenRA.Traits; namespace OpenRA.Mods.Common.Traits { [Desc("Heals all actors that belong to the owner of the collector.")] - class HealActorsCrateActionInfo : CrateActionInfo + sealed class HealActorsCrateActionInfo : CrateActionInfo { [Desc("The target type(s) of the actors this crate action will heal. Leave empty to heal all actors.")] public readonly BitSet TargetTypes = default; @@ -24,7 +24,7 @@ namespace OpenRA.Mods.Common.Traits public override object Create(ActorInitializer init) { return new HealActorsCrateAction(init.Self, this); } } - class HealActorsCrateAction : CrateAction + sealed class HealActorsCrateAction : CrateAction { readonly HealActorsCrateActionInfo info; diff --git a/OpenRA.Mods.Common/Traits/Crates/HideMapCrateAction.cs b/OpenRA.Mods.Common/Traits/Crates/HideMapCrateAction.cs index 8931719776..017ea8b6b0 100644 --- a/OpenRA.Mods.Common/Traits/Crates/HideMapCrateAction.cs +++ b/OpenRA.Mods.Common/Traits/Crates/HideMapCrateAction.cs @@ -14,7 +14,7 @@ using System.Linq; namespace OpenRA.Mods.Common.Traits { [Desc("Hides the entire map in shroud.")] - class HideMapCrateActionInfo : CrateActionInfo + sealed class HideMapCrateActionInfo : CrateActionInfo { [Desc("Should the map also be hidden for the allies of the collector's owner?")] public readonly bool IncludeAllies = false; @@ -22,7 +22,7 @@ namespace OpenRA.Mods.Common.Traits public override object Create(ActorInitializer init) { return new HideMapCrateAction(init.Self, this); } } - class HideMapCrateAction : CrateAction + sealed class HideMapCrateAction : CrateAction { readonly HideMapCrateActionInfo info; diff --git a/OpenRA.Mods.Common/Traits/Crates/LevelUpCrateAction.cs b/OpenRA.Mods.Common/Traits/Crates/LevelUpCrateAction.cs index 3d1c7861be..9292b9e140 100644 --- a/OpenRA.Mods.Common/Traits/Crates/LevelUpCrateAction.cs +++ b/OpenRA.Mods.Common/Traits/Crates/LevelUpCrateAction.cs @@ -14,7 +14,7 @@ using System.Linq; namespace OpenRA.Mods.Common.Traits { [Desc("Gives experience levels to the collector.")] - class LevelUpCrateActionInfo : CrateActionInfo + sealed class LevelUpCrateActionInfo : CrateActionInfo { [Desc("Number of experience levels to give.")] public readonly int Levels = 1; @@ -28,7 +28,7 @@ namespace OpenRA.Mods.Common.Traits public override object Create(ActorInitializer init) { return new LevelUpCrateAction(init.Self, this); } } - class LevelUpCrateAction : CrateAction + sealed class LevelUpCrateAction : CrateAction { readonly Actor self; readonly LevelUpCrateActionInfo info; diff --git a/OpenRA.Mods.Common/Traits/Crates/RevealMapCrateAction.cs b/OpenRA.Mods.Common/Traits/Crates/RevealMapCrateAction.cs index ee6c242f32..732984964f 100644 --- a/OpenRA.Mods.Common/Traits/Crates/RevealMapCrateAction.cs +++ b/OpenRA.Mods.Common/Traits/Crates/RevealMapCrateAction.cs @@ -12,7 +12,7 @@ namespace OpenRA.Mods.Common.Traits { [Desc("Reveals the entire map.")] - class RevealMapCrateActionInfo : CrateActionInfo + sealed class RevealMapCrateActionInfo : CrateActionInfo { [Desc("Should the map also be revealed for the allies of the collector's owner?")] public readonly bool IncludeAllies = false; @@ -20,7 +20,7 @@ namespace OpenRA.Mods.Common.Traits public override object Create(ActorInitializer init) { return new RevealMapCrateAction(init.Self, this); } } - class RevealMapCrateAction : CrateAction + sealed class RevealMapCrateAction : CrateAction { readonly RevealMapCrateActionInfo info; diff --git a/OpenRA.Mods.Common/Traits/Crates/SupportPowerCrateAction.cs b/OpenRA.Mods.Common/Traits/Crates/SupportPowerCrateAction.cs index 2dae9bcff4..8d43bf2e7a 100644 --- a/OpenRA.Mods.Common/Traits/Crates/SupportPowerCrateAction.cs +++ b/OpenRA.Mods.Common/Traits/Crates/SupportPowerCrateAction.cs @@ -15,7 +15,7 @@ using OpenRA.Traits; namespace OpenRA.Mods.Common.Traits { [Desc("Gives a supportpower to the collector.")] - class SupportPowerCrateActionInfo : CrateActionInfo + sealed class SupportPowerCrateActionInfo : CrateActionInfo { [ActorReference] [FieldLoader.Require] @@ -25,7 +25,7 @@ namespace OpenRA.Mods.Common.Traits public override object Create(ActorInitializer init) { return new SupportPowerCrateAction(init.Self, this); } } - class SupportPowerCrateAction : CrateAction + sealed class SupportPowerCrateAction : CrateAction { readonly SupportPowerCrateActionInfo info; public SupportPowerCrateAction(Actor self, SupportPowerCrateActionInfo info) diff --git a/OpenRA.Mods.Common/Traits/Crushable.cs b/OpenRA.Mods.Common/Traits/Crushable.cs index 58b4f9ba13..7b0023e979 100644 --- a/OpenRA.Mods.Common/Traits/Crushable.cs +++ b/OpenRA.Mods.Common/Traits/Crushable.cs @@ -14,7 +14,7 @@ using OpenRA.Primitives; namespace OpenRA.Mods.Common.Traits { [Desc("This actor is crushable.")] - class CrushableInfo : ConditionalTraitInfo + sealed class CrushableInfo : ConditionalTraitInfo { [Desc("Sound to play when being crushed.")] public readonly string CrushSound = null; @@ -28,7 +28,7 @@ namespace OpenRA.Mods.Common.Traits public override object Create(ActorInitializer init) { return new Crushable(init.Self, this); } } - class Crushable : ConditionalTrait, ICrushable, INotifyCrushed + sealed class Crushable : ConditionalTrait, ICrushable, INotifyCrushed { readonly Actor self; diff --git a/OpenRA.Mods.Common/Traits/DeliversCash.cs b/OpenRA.Mods.Common/Traits/DeliversCash.cs index e6599deb54..e1567acd1b 100644 --- a/OpenRA.Mods.Common/Traits/DeliversCash.cs +++ b/OpenRA.Mods.Common/Traits/DeliversCash.cs @@ -19,7 +19,7 @@ using OpenRA.Traits; namespace OpenRA.Mods.Common.Traits { [Desc("Donate money to actors with the `" + nameof(AcceptsDeliveredCash) + "` trait.")] - class DeliversCashInfo : TraitInfo + sealed class DeliversCashInfo : TraitInfo { [Desc("The amount of cash the owner receives.")] public readonly int Payload = 500; @@ -46,7 +46,7 @@ namespace OpenRA.Mods.Common.Traits public override object Create(ActorInitializer init) { return new DeliversCash(this); } } - class DeliversCash : IIssueOrder, IResolveOrder, IOrderVoice, INotifyCashTransfer + sealed class DeliversCash : IIssueOrder, IResolveOrder, IOrderVoice, INotifyCashTransfer { readonly DeliversCashInfo info; @@ -93,7 +93,7 @@ namespace OpenRA.Mods.Common.Traits Game.Sound.Play(SoundType.World, info.Sounds, self.World, self.CenterPosition); } - public class DeliversCashOrderTargeter : UnitOrderTargeter + public sealed class DeliversCashOrderTargeter : UnitOrderTargeter { public DeliversCashOrderTargeter(DeliversCashInfo info) : base("DeliverCash", 5, info.Cursor, false, true) { } diff --git a/OpenRA.Mods.Common/Traits/DeliversExperience.cs b/OpenRA.Mods.Common/Traits/DeliversExperience.cs index 43537cdbc6..4a238b0943 100644 --- a/OpenRA.Mods.Common/Traits/DeliversExperience.cs +++ b/OpenRA.Mods.Common/Traits/DeliversExperience.cs @@ -18,7 +18,7 @@ using OpenRA.Traits; namespace OpenRA.Mods.Common.Traits { [Desc("This actor can grant experience levels equal to it's own current level via entering to other actors with the `" + nameof(AcceptsDeliveredExperience) + "` trait.")] - class DeliversExperienceInfo : TraitInfo, Requires + sealed class DeliversExperienceInfo : TraitInfo, Requires { [Desc("The amount of experience the donating player receives.")] public readonly int PlayerExperience = 0; @@ -39,7 +39,7 @@ namespace OpenRA.Mods.Common.Traits public override object Create(ActorInitializer init) { return new DeliversExperience(init, this); } } - class DeliversExperience : IIssueOrder, IResolveOrder, IOrderVoice + sealed class DeliversExperience : IIssueOrder, IResolveOrder, IOrderVoice { readonly DeliversExperienceInfo info; readonly Actor self; @@ -95,7 +95,7 @@ namespace OpenRA.Mods.Common.Traits self.ShowTargetLines(); } - public class DeliversExperienceOrderTargeter : UnitOrderTargeter + public sealed class DeliversExperienceOrderTargeter : UnitOrderTargeter { public DeliversExperienceOrderTargeter(DeliversExperienceInfo info) : base("DeliverExperience", 5, info.Cursor, true, true) { } diff --git a/OpenRA.Mods.Common/Traits/Demolishable.cs b/OpenRA.Mods.Common/Traits/Demolishable.cs index 57c04dd8b4..8c929e7d69 100644 --- a/OpenRA.Mods.Common/Traits/Demolishable.cs +++ b/OpenRA.Mods.Common/Traits/Demolishable.cs @@ -30,7 +30,7 @@ namespace OpenRA.Mods.Common.Traits public class Demolishable : ConditionalTrait, IDemolishable, ITick, INotifyOwnerChanged { - class DemolishAction + sealed class DemolishAction { public readonly Actor Saboteur; public readonly int Token; diff --git a/OpenRA.Mods.Common/Traits/Demolition.cs b/OpenRA.Mods.Common/Traits/Demolition.cs index 77835a3863..1cca080896 100644 --- a/OpenRA.Mods.Common/Traits/Demolition.cs +++ b/OpenRA.Mods.Common/Traits/Demolition.cs @@ -18,7 +18,7 @@ using OpenRA.Traits; namespace OpenRA.Mods.Common.Traits { - class DemolitionInfo : ConditionalTraitInfo + sealed class DemolitionInfo : ConditionalTraitInfo { [Desc("Delay to demolish the target once the explosive device is planted. " + "Measured in game ticks. Default is 1.8 seconds.")] @@ -57,7 +57,7 @@ namespace OpenRA.Mods.Common.Traits public override object Create(ActorInitializer init) { return new Demolition(this); } } - class Demolition : ConditionalTrait, IIssueOrder, IResolveOrder, IOrderVoice + sealed class Demolition : ConditionalTrait, IIssueOrder, IResolveOrder, IOrderVoice { public Demolition(DemolitionInfo info) : base(info) { } @@ -111,7 +111,7 @@ namespace OpenRA.Mods.Common.Traits return order.OrderString == "C4" ? Info.Voice : null; } - class DemolitionOrderTargeter : UnitOrderTargeter + sealed class DemolitionOrderTargeter : UnitOrderTargeter { readonly DemolitionInfo info; diff --git a/OpenRA.Mods.Common/Traits/GainsExperience.cs b/OpenRA.Mods.Common/Traits/GainsExperience.cs index d071cef699..4f3a8cbd8f 100644 --- a/OpenRA.Mods.Common/Traits/GainsExperience.cs +++ b/OpenRA.Mods.Common/Traits/GainsExperience.cs @@ -150,7 +150,7 @@ namespace OpenRA.Mods.Common.Traits } } - class ExperienceInit : ValueActorInit + sealed class ExperienceInit : ValueActorInit { public ExperienceInit(TraitInfo info, int value) : base(info, value) { } diff --git a/OpenRA.Mods.Common/Traits/GivesBounty.cs b/OpenRA.Mods.Common/Traits/GivesBounty.cs index 560da701ed..3c58d0fc15 100644 --- a/OpenRA.Mods.Common/Traits/GivesBounty.cs +++ b/OpenRA.Mods.Common/Traits/GivesBounty.cs @@ -18,7 +18,7 @@ using OpenRA.Traits; namespace OpenRA.Mods.Common.Traits { [Desc("When killed, this actor causes the attacking player to receive money.")] - class GivesBountyInfo : ConditionalTraitInfo + sealed class GivesBountyInfo : ConditionalTraitInfo { [Desc("Percentage of the killed actor's Cost or CustomSellValue to be given.")] public readonly int Percentage = 10; @@ -36,7 +36,7 @@ namespace OpenRA.Mods.Common.Traits public override object Create(ActorInitializer init) { return new GivesBounty(this); } } - class GivesBounty : ConditionalTrait, INotifyKilled, INotifyPassengerEntered, INotifyPassengerExited + sealed class GivesBounty : ConditionalTrait, INotifyKilled, INotifyPassengerEntered, INotifyPassengerExited { readonly Dictionary passengerBounties = new(); diff --git a/OpenRA.Mods.Common/Traits/GivesExperience.cs b/OpenRA.Mods.Common/Traits/GivesExperience.cs index c5dc3d8214..6ba0f4efad 100644 --- a/OpenRA.Mods.Common/Traits/GivesExperience.cs +++ b/OpenRA.Mods.Common/Traits/GivesExperience.cs @@ -16,7 +16,7 @@ using OpenRA.Traits; namespace OpenRA.Mods.Common.Traits { [Desc("This actor gives experience to a GainsExperience actor when they are killed.")] - class GivesExperienceInfo : TraitInfo + sealed class GivesExperienceInfo : TraitInfo { [Desc("If -1, use the value of the unit cost.")] public readonly int Experience = -1; @@ -33,7 +33,7 @@ namespace OpenRA.Mods.Common.Traits public override object Create(ActorInitializer init) { return new GivesExperience(this); } } - class GivesExperience : INotifyKilled, INotifyCreated + sealed class GivesExperience : INotifyKilled, INotifyCreated { readonly GivesExperienceInfo info; diff --git a/OpenRA.Mods.Common/Traits/Harvester.cs b/OpenRA.Mods.Common/Traits/Harvester.cs index 10ed1c1c81..e0d77f41b7 100644 --- a/OpenRA.Mods.Common/Traits/Harvester.cs +++ b/OpenRA.Mods.Common/Traits/Harvester.cs @@ -381,11 +381,11 @@ namespace OpenRA.Mods.Common.Traits conditionToken = self.RevokeCondition(conditionToken); } - class HarvestOrderTargeter : IOrderTargeter + sealed class HarvestOrderTargeter : IOrderTargeter { public string OrderID => "Harvest"; public int OrderPriority => 10; - public bool IsQueued { get; protected set; } + public bool IsQueued { get; private set; } public bool TargetOverridesSelection(Actor self, in Target target, List actorsAt, CPos xy, TargetModifiers modifiers) { return true; } public bool CanTarget(Actor self, in Target target, ref TargetModifiers modifiers, ref string cursor) diff --git a/OpenRA.Mods.Common/Traits/IgnoresCloak.cs b/OpenRA.Mods.Common/Traits/IgnoresCloak.cs index f448b21423..4102ed21da 100644 --- a/OpenRA.Mods.Common/Traits/IgnoresCloak.cs +++ b/OpenRA.Mods.Common/Traits/IgnoresCloak.cs @@ -14,6 +14,6 @@ using OpenRA.Traits; namespace OpenRA.Mods.Common.Traits { [Desc("This actor does not care about any type of cloak its targets might have, regardless of distance.")] - class IgnoresCloakInfo : TraitInfo { } - class IgnoresCloak { } + sealed class IgnoresCloakInfo : TraitInfo { } + sealed class IgnoresCloak { } } diff --git a/OpenRA.Mods.Common/Traits/IgnoresDisguise.cs b/OpenRA.Mods.Common/Traits/IgnoresDisguise.cs index e33778fb9f..8030631a2b 100644 --- a/OpenRA.Mods.Common/Traits/IgnoresDisguise.cs +++ b/OpenRA.Mods.Common/Traits/IgnoresDisguise.cs @@ -14,7 +14,7 @@ using OpenRA.Traits; namespace OpenRA.Mods.Common.Traits { [Desc("Allows automatic targeting of disguised actors.")] - class IgnoresDisguiseInfo : TraitInfo { } + sealed class IgnoresDisguiseInfo : TraitInfo { } - class IgnoresDisguise { } + sealed class IgnoresDisguise { } } diff --git a/OpenRA.Mods.Common/Traits/Immobile.cs b/OpenRA.Mods.Common/Traits/Immobile.cs index f99350ea62..28db3d94e4 100644 --- a/OpenRA.Mods.Common/Traits/Immobile.cs +++ b/OpenRA.Mods.Common/Traits/Immobile.cs @@ -15,7 +15,7 @@ using OpenRA.Traits; namespace OpenRA.Mods.Common.Traits { - class ImmobileInfo : TraitInfo, IOccupySpaceInfo + sealed class ImmobileInfo : TraitInfo, IOccupySpaceInfo { public readonly bool OccupiesSpace = true; public override object Create(ActorInitializer init) { return new Immobile(init, this); } @@ -29,7 +29,7 @@ namespace OpenRA.Mods.Common.Traits bool IOccupySpaceInfo.SharesCell => false; } - class Immobile : IOccupySpace, ISync, INotifyAddedToWorld, INotifyRemovedFromWorld + sealed class Immobile : IOccupySpace, ISync, INotifyAddedToWorld, INotifyRemovedFromWorld { [Sync] readonly CPos location; diff --git a/OpenRA.Mods.Common/Traits/Infantry/ScaredyCat.cs b/OpenRA.Mods.Common/Traits/Infantry/ScaredyCat.cs index e8e70a2e10..bc76baf00e 100644 --- a/OpenRA.Mods.Common/Traits/Infantry/ScaredyCat.cs +++ b/OpenRA.Mods.Common/Traits/Infantry/ScaredyCat.cs @@ -16,7 +16,7 @@ using OpenRA.Traits; namespace OpenRA.Mods.Common.Traits { [Desc("Makes the unit automatically run around when taking damage.")] - class ScaredyCatInfo : TraitInfo, Requires + sealed class ScaredyCatInfo : TraitInfo, Requires { [Desc("Chance (out of 100) the unit has to enter panic mode when attacked.")] public readonly int PanicChance = 100; @@ -39,7 +39,7 @@ namespace OpenRA.Mods.Common.Traits public override object Create(ActorInitializer init) { return new ScaredyCat(init.Self, this); } } - class ScaredyCat : ITick, INotifyIdle, INotifyDamage, INotifyAttack, ISpeedModifier, ISync, IRenderInfantrySequenceModifier + sealed class ScaredyCat : ITick, INotifyIdle, INotifyDamage, INotifyAttack, ISpeedModifier, ISync, IRenderInfantrySequenceModifier { readonly ScaredyCatInfo info; readonly Mobile mobile; diff --git a/OpenRA.Mods.Common/Traits/InstantlyRepairs.cs b/OpenRA.Mods.Common/Traits/InstantlyRepairs.cs index 397f24a0b2..d76822afd2 100644 --- a/OpenRA.Mods.Common/Traits/InstantlyRepairs.cs +++ b/OpenRA.Mods.Common/Traits/InstantlyRepairs.cs @@ -100,7 +100,7 @@ namespace OpenRA.Mods.Common.Traits self.ShowTargetLines(); } - class InstantRepairOrderTargeter : UnitOrderTargeter + sealed class InstantRepairOrderTargeter : UnitOrderTargeter { readonly InstantlyRepairsInfo info; diff --git a/OpenRA.Mods.Common/Traits/KillsSelf.cs b/OpenRA.Mods.Common/Traits/KillsSelf.cs index 58f24b1427..76bdcdc98b 100644 --- a/OpenRA.Mods.Common/Traits/KillsSelf.cs +++ b/OpenRA.Mods.Common/Traits/KillsSelf.cs @@ -14,7 +14,7 @@ using OpenRA.Traits; namespace OpenRA.Mods.Common.Traits { - class KillsSelfInfo : ConditionalTraitInfo + sealed class KillsSelfInfo : ConditionalTraitInfo { [Desc("Remove the actor from the world (and destroy it) instead of killing it.")] public readonly bool RemoveInstead = false; @@ -32,7 +32,7 @@ namespace OpenRA.Mods.Common.Traits public override object Create(ActorInitializer init) { return new KillsSelf(init.Self, this); } } - class KillsSelf : ConditionalTrait, INotifyAddedToWorld, ITick + sealed class KillsSelf : ConditionalTrait, INotifyAddedToWorld, ITick { int lifetime; diff --git a/OpenRA.Mods.Common/Traits/Mobile.cs b/OpenRA.Mods.Common/Traits/Mobile.cs index 31aec635d2..7d133dec36 100644 --- a/OpenRA.Mods.Common/Traits/Mobile.cs +++ b/OpenRA.Mods.Common/Traits/Mobile.cs @@ -969,7 +969,7 @@ namespace OpenRA.Mods.Common.Traits return returnToCellOnCreation ? new ReturnToCellActivity(self, creationActivityDelay, returnToCellOnCreationRecalculateSubCell) : null; } - class MoveOrderTargeter : IOrderTargeter + sealed class MoveOrderTargeter : IOrderTargeter { readonly Mobile mobile; readonly LocomotorInfo locomotorInfo; @@ -992,7 +992,7 @@ namespace OpenRA.Mods.Common.Traits public string OrderID => "Move"; public int OrderPriority => 4; - public bool IsQueued { get; protected set; } + public bool IsQueued { get; private set; } public bool CanTarget(Actor self, in Target target, ref TargetModifiers modifiers, ref string cursor) { diff --git a/OpenRA.Mods.Common/Traits/Modifiers/FrozenUnderFog.cs b/OpenRA.Mods.Common/Traits/Modifiers/FrozenUnderFog.cs index ac3eb47b58..f3582be2ac 100644 --- a/OpenRA.Mods.Common/Traits/Modifiers/FrozenUnderFog.cs +++ b/OpenRA.Mods.Common/Traits/Modifiers/FrozenUnderFog.cs @@ -39,7 +39,7 @@ namespace OpenRA.Mods.Common.Traits bool isRendering; bool created; - class FrozenState + sealed class FrozenState { public readonly FrozenActor FrozenActor; public bool IsVisible; diff --git a/OpenRA.Mods.Common/Traits/PaletteEffects/RotationPaletteEffect.cs b/OpenRA.Mods.Common/Traits/PaletteEffects/RotationPaletteEffect.cs index fe37eb20e0..390268d5c5 100644 --- a/OpenRA.Mods.Common/Traits/PaletteEffects/RotationPaletteEffect.cs +++ b/OpenRA.Mods.Common/Traits/PaletteEffects/RotationPaletteEffect.cs @@ -17,7 +17,7 @@ namespace OpenRA.Mods.Common.Traits { [TraitLocation(SystemActors.World | SystemActors.EditorWorld)] [Desc("Palette effect used for sprinkle \"animations\".")] - class RotationPaletteEffectInfo : TraitInfo + sealed class RotationPaletteEffectInfo : TraitInfo { [Desc("Defines to which palettes this effect should be applied to.", "If none specified, it applies to all palettes not explicitly excluded.")] @@ -45,7 +45,7 @@ namespace OpenRA.Mods.Common.Traits public override object Create(ActorInitializer init) { return new RotationPaletteEffect(init.World, this); } } - class RotationPaletteEffect : ITick, IPaletteModifier + sealed class RotationPaletteEffect : ITick, IPaletteModifier { readonly RotationPaletteEffectInfo info; readonly uint[] rotationBuffer; diff --git a/OpenRA.Mods.Common/Traits/Palettes/ColorPickerPalette.cs b/OpenRA.Mods.Common/Traits/Palettes/ColorPickerPalette.cs index bba181ee81..15f5c2c40e 100644 --- a/OpenRA.Mods.Common/Traits/Palettes/ColorPickerPalette.cs +++ b/OpenRA.Mods.Common/Traits/Palettes/ColorPickerPalette.cs @@ -20,7 +20,7 @@ namespace OpenRA.Mods.Common.Traits { [TraitLocation(SystemActors.World | SystemActors.EditorWorld)] [Desc("Create a color picker palette from another palette.")] - class ColorPickerPaletteInfo : TraitInfo + sealed class ColorPickerPaletteInfo : TraitInfo { [PaletteDefinition] [FieldLoader.Require] @@ -41,7 +41,7 @@ namespace OpenRA.Mods.Common.Traits public override object Create(ActorInitializer init) { return new ColorPickerPalette(this); } } - class ColorPickerPalette : ILoadsPalettes, IProvidesAssetBrowserColorPickerPalettes, ITickRender + sealed class ColorPickerPalette : ILoadsPalettes, IProvidesAssetBrowserColorPickerPalettes, ITickRender { readonly ColorPickerPaletteInfo info; Color color; diff --git a/OpenRA.Mods.Common/Traits/Palettes/PaletteFromFile.cs b/OpenRA.Mods.Common/Traits/Palettes/PaletteFromFile.cs index e2ab35d150..8a86c80cbc 100644 --- a/OpenRA.Mods.Common/Traits/Palettes/PaletteFromFile.cs +++ b/OpenRA.Mods.Common/Traits/Palettes/PaletteFromFile.cs @@ -19,7 +19,7 @@ namespace OpenRA.Mods.Common.Traits { [TraitLocation(SystemActors.World | SystemActors.EditorWorld)] [Desc("Load VGA palette (.pal) registers.")] - class PaletteFromFileInfo : TraitInfo, ITilesetSpecificPaletteInfo, IProvidesCursorPaletteInfo + sealed class PaletteFromFileInfo : TraitInfo, ITilesetSpecificPaletteInfo, IProvidesCursorPaletteInfo { [PaletteDefinition] [FieldLoader.Require] @@ -56,7 +56,7 @@ namespace OpenRA.Mods.Common.Traits } } - class PaletteFromFile : ILoadsPalettes, IProvidesAssetBrowserPalettes + sealed class PaletteFromFile : ILoadsPalettes, IProvidesAssetBrowserPalettes { readonly World world; readonly PaletteFromFileInfo info; diff --git a/OpenRA.Mods.Common/Traits/Palettes/PaletteFromGimpOrJascFile.cs b/OpenRA.Mods.Common/Traits/Palettes/PaletteFromGimpOrJascFile.cs index 9ed6852543..3c11dfad0a 100644 --- a/OpenRA.Mods.Common/Traits/Palettes/PaletteFromGimpOrJascFile.cs +++ b/OpenRA.Mods.Common/Traits/Palettes/PaletteFromGimpOrJascFile.cs @@ -21,7 +21,7 @@ namespace OpenRA.Mods.Common.Traits { [TraitLocation(SystemActors.World | SystemActors.EditorWorld)] [Desc("Load a GIMP .gpl or JASC .pal palette file. Supports per-color alpha.")] - class PaletteFromGimpOrJascFileInfo : TraitInfo, IProvidesCursorPaletteInfo + sealed class PaletteFromGimpOrJascFileInfo : TraitInfo, IProvidesCursorPaletteInfo { [PaletteDefinition] [FieldLoader.Require] @@ -110,7 +110,7 @@ namespace OpenRA.Mods.Common.Traits } } - class PaletteFromGimpOrJascFile : ILoadsPalettes, IProvidesAssetBrowserPalettes + sealed class PaletteFromGimpOrJascFile : ILoadsPalettes, IProvidesAssetBrowserPalettes { readonly World world; readonly PaletteFromGimpOrJascFileInfo info; diff --git a/OpenRA.Mods.Common/Traits/Palettes/PaletteFromGrayscale.cs b/OpenRA.Mods.Common/Traits/Palettes/PaletteFromGrayscale.cs index d33402aeaf..88252cb3e2 100644 --- a/OpenRA.Mods.Common/Traits/Palettes/PaletteFromGrayscale.cs +++ b/OpenRA.Mods.Common/Traits/Palettes/PaletteFromGrayscale.cs @@ -19,7 +19,7 @@ namespace OpenRA.Mods.Common.Traits { [TraitLocation(SystemActors.World | SystemActors.EditorWorld)] [Desc("Creates a greyscale palette without any base palette file.")] - class PaletteFromGrayscaleInfo : TraitInfo, ITilesetSpecificPaletteInfo + sealed class PaletteFromGrayscaleInfo : TraitInfo, ITilesetSpecificPaletteInfo { [PaletteDefinition] [FieldLoader.Require] @@ -39,7 +39,7 @@ namespace OpenRA.Mods.Common.Traits public override object Create(ActorInitializer init) { return new PaletteFromGrayscale(init.World, this); } } - class PaletteFromGrayscale : ILoadsPalettes + sealed class PaletteFromGrayscale : ILoadsPalettes { readonly World world; readonly PaletteFromGrayscaleInfo info; diff --git a/OpenRA.Mods.Common/Traits/Palettes/PaletteFromPaletteWithAlpha.cs b/OpenRA.Mods.Common/Traits/Palettes/PaletteFromPaletteWithAlpha.cs index 7c6c2a7a19..b39551a883 100644 --- a/OpenRA.Mods.Common/Traits/Palettes/PaletteFromPaletteWithAlpha.cs +++ b/OpenRA.Mods.Common/Traits/Palettes/PaletteFromPaletteWithAlpha.cs @@ -18,7 +18,7 @@ namespace OpenRA.Mods.Common.Traits { [TraitLocation(SystemActors.World | SystemActors.EditorWorld)] [Desc("Create a palette by applying alpha transparency to another palette.")] - class PaletteFromPaletteWithAlphaInfo : TraitInfo + sealed class PaletteFromPaletteWithAlphaInfo : TraitInfo { [PaletteDefinition] [FieldLoader.Require] @@ -42,7 +42,7 @@ namespace OpenRA.Mods.Common.Traits public override object Create(ActorInitializer init) { return new PaletteFromPaletteWithAlpha(this); } } - class PaletteFromPaletteWithAlpha : ILoadsPalettes, IProvidesAssetBrowserPalettes + sealed class PaletteFromPaletteWithAlpha : ILoadsPalettes, IProvidesAssetBrowserPalettes { readonly PaletteFromPaletteWithAlphaInfo info; @@ -57,7 +57,7 @@ namespace OpenRA.Mods.Common.Traits public IEnumerable PaletteNames { get { yield return info.Name; } } } - class AlphaPaletteRemap : IPaletteRemap + sealed class AlphaPaletteRemap : IPaletteRemap { readonly float alpha; readonly bool premultiply; diff --git a/OpenRA.Mods.Common/Traits/Palettes/PaletteFromPlayerPaletteWithAlpha.cs b/OpenRA.Mods.Common/Traits/Palettes/PaletteFromPlayerPaletteWithAlpha.cs index e571c75788..aefc48f880 100644 --- a/OpenRA.Mods.Common/Traits/Palettes/PaletteFromPlayerPaletteWithAlpha.cs +++ b/OpenRA.Mods.Common/Traits/Palettes/PaletteFromPlayerPaletteWithAlpha.cs @@ -17,7 +17,7 @@ namespace OpenRA.Mods.Common.Traits { [TraitLocation(SystemActors.World | SystemActors.EditorWorld)] [Desc("Create player palettes by applying alpha transparency to another player palette.")] - class PaletteFromPlayerPaletteWithAlphaInfo : TraitInfo + sealed class PaletteFromPlayerPaletteWithAlphaInfo : TraitInfo { [FieldLoader.Require] [PaletteDefinition(true)] @@ -41,7 +41,7 @@ namespace OpenRA.Mods.Common.Traits public override object Create(ActorInitializer init) { return new PaletteFromPlayerPaletteWithAlpha(this); } } - class PaletteFromPlayerPaletteWithAlpha : ILoadsPlayerPalettes + sealed class PaletteFromPlayerPaletteWithAlpha : ILoadsPlayerPalettes { readonly PaletteFromPlayerPaletteWithAlphaInfo info; diff --git a/OpenRA.Mods.Common/Traits/Palettes/PaletteFromPng.cs b/OpenRA.Mods.Common/Traits/Palettes/PaletteFromPng.cs index 75e7ee1c7e..5b7ac9e57e 100644 --- a/OpenRA.Mods.Common/Traits/Palettes/PaletteFromPng.cs +++ b/OpenRA.Mods.Common/Traits/Palettes/PaletteFromPng.cs @@ -20,7 +20,7 @@ namespace OpenRA.Mods.Common.Traits { [TraitLocation(SystemActors.World | SystemActors.EditorWorld)] [Desc("Load a PNG and use its embedded palette.")] - class PaletteFromPngInfo : TraitInfo, ITilesetSpecificPaletteInfo, IProvidesCursorPaletteInfo + sealed class PaletteFromPngInfo : TraitInfo, ITilesetSpecificPaletteInfo, IProvidesCursorPaletteInfo { [PaletteDefinition] [FieldLoader.Require] @@ -64,7 +64,7 @@ namespace OpenRA.Mods.Common.Traits } } - class PaletteFromPng : ILoadsPalettes, IProvidesAssetBrowserPalettes + sealed class PaletteFromPng : ILoadsPalettes, IProvidesAssetBrowserPalettes { readonly World world; readonly PaletteFromPngInfo info; diff --git a/OpenRA.Mods.Common/Traits/Palettes/PaletteFromRGBA.cs b/OpenRA.Mods.Common/Traits/Palettes/PaletteFromRGBA.cs index 9951a948c3..a65eb06d7d 100644 --- a/OpenRA.Mods.Common/Traits/Palettes/PaletteFromRGBA.cs +++ b/OpenRA.Mods.Common/Traits/Palettes/PaletteFromRGBA.cs @@ -19,7 +19,7 @@ namespace OpenRA.Mods.Common.Traits { [TraitLocation(SystemActors.World | SystemActors.EditorWorld)] [Desc("Creates a single color palette without any base palette file.")] - class PaletteFromRGBAInfo : TraitInfo, ITilesetSpecificPaletteInfo + sealed class PaletteFromRGBAInfo : TraitInfo, ITilesetSpecificPaletteInfo { [PaletteDefinition] [FieldLoader.Require] @@ -51,7 +51,7 @@ namespace OpenRA.Mods.Common.Traits public override object Create(ActorInitializer init) { return new PaletteFromRGBA(init.World, this); } } - class PaletteFromRGBA : ILoadsPalettes + sealed class PaletteFromRGBA : ILoadsPalettes { readonly World world; readonly PaletteFromRGBAInfo info; diff --git a/OpenRA.Mods.Common/Traits/Player/AllyRepair.cs b/OpenRA.Mods.Common/Traits/Player/AllyRepair.cs index 532b46a6e9..5e4823d2f3 100644 --- a/OpenRA.Mods.Common/Traits/Player/AllyRepair.cs +++ b/OpenRA.Mods.Common/Traits/Player/AllyRepair.cs @@ -15,9 +15,9 @@ namespace OpenRA.Mods.Common.Traits { [TraitLocation(SystemActors.Player)] [Desc("Attach this to the player actor to allow building repair by team mates.")] - class AllyRepairInfo : TraitInfo { } + sealed class AllyRepairInfo : TraitInfo { } - class AllyRepair : IResolveOrder + sealed class AllyRepair : IResolveOrder { public void ResolveOrder(Actor self, Order order) { diff --git a/OpenRA.Mods.Common/Traits/Player/EnemyWatcher.cs b/OpenRA.Mods.Common/Traits/Player/EnemyWatcher.cs index 91dff438f2..aaaba27200 100644 --- a/OpenRA.Mods.Common/Traits/Player/EnemyWatcher.cs +++ b/OpenRA.Mods.Common/Traits/Player/EnemyWatcher.cs @@ -18,7 +18,7 @@ namespace OpenRA.Mods.Common.Traits [TraitLocation(SystemActors.Player)] [Desc("Tracks neutral and enemy actors' visibility and notifies the player.", "Attach this to the player actor. The actors to track need the 'AnnounceOnSeen' trait.")] - class EnemyWatcherInfo : TraitInfo + sealed class EnemyWatcherInfo : TraitInfo { [Desc("Interval in ticks between scanning for enemies.")] public readonly int ScanInterval = 25; @@ -29,7 +29,7 @@ namespace OpenRA.Mods.Common.Traits public override object Create(ActorInitializer init) { return new EnemyWatcher(this); } } - class EnemyWatcher : ITick + sealed class EnemyWatcher : ITick { readonly EnemyWatcherInfo info; readonly HashSet discoveredPlayers; diff --git a/OpenRA.Mods.Common/Traits/Player/TechTree.cs b/OpenRA.Mods.Common/Traits/Player/TechTree.cs index 81c0095b52..219df4c98d 100644 --- a/OpenRA.Mods.Common/Traits/Player/TechTree.cs +++ b/OpenRA.Mods.Common/Traits/Player/TechTree.cs @@ -114,7 +114,7 @@ namespace OpenRA.Mods.Common.Traits public Player Owner { get; } - class Watcher + sealed class Watcher { public readonly string Key; public ITechTreeElement RegisteredBy { get; } diff --git a/OpenRA.Mods.Common/Traits/ProductionFromMapEdge.cs b/OpenRA.Mods.Common/Traits/ProductionFromMapEdge.cs index 811ab82a38..bbcf99ad82 100644 --- a/OpenRA.Mods.Common/Traits/ProductionFromMapEdge.cs +++ b/OpenRA.Mods.Common/Traits/ProductionFromMapEdge.cs @@ -17,12 +17,12 @@ using OpenRA.Traits; namespace OpenRA.Mods.Common.Traits { [Desc("Produce a unit on the closest map edge cell and move into the world.")] - class ProductionFromMapEdgeInfo : ProductionInfo + sealed class ProductionFromMapEdgeInfo : ProductionInfo { public override object Create(ActorInitializer init) { return new ProductionFromMapEdge(init, this); } } - class ProductionFromMapEdge : Production + sealed class ProductionFromMapEdge : Production { readonly CPos? spawnLocation; readonly IPathFinder pathFinder; diff --git a/OpenRA.Mods.Common/Traits/ProductionParadrop.cs b/OpenRA.Mods.Common/Traits/ProductionParadrop.cs index 1f0304f013..2905c49e9b 100644 --- a/OpenRA.Mods.Common/Traits/ProductionParadrop.cs +++ b/OpenRA.Mods.Common/Traits/ProductionParadrop.cs @@ -38,7 +38,7 @@ namespace OpenRA.Mods.Common.Traits public override object Create(ActorInitializer init) { return new ProductionParadrop(init, this); } } - class ProductionParadrop : Production + sealed class ProductionParadrop : Production { readonly Lazy rp; diff --git a/OpenRA.Mods.Common/Traits/ProductionQueueFromSelection.cs b/OpenRA.Mods.Common/Traits/ProductionQueueFromSelection.cs index 35280b6362..1c86547be4 100644 --- a/OpenRA.Mods.Common/Traits/ProductionQueueFromSelection.cs +++ b/OpenRA.Mods.Common/Traits/ProductionQueueFromSelection.cs @@ -18,7 +18,7 @@ using OpenRA.Widgets; namespace OpenRA.Mods.Common.Traits { [TraitLocation(SystemActors.World)] - class ProductionQueueFromSelectionInfo : TraitInfo + sealed class ProductionQueueFromSelectionInfo : TraitInfo { public readonly string ProductionTabsWidget = null; public readonly string ProductionPaletteWidget = null; @@ -26,7 +26,7 @@ namespace OpenRA.Mods.Common.Traits public override object Create(ActorInitializer init) { return new ProductionQueueFromSelection(init.World, this); } } - class ProductionQueueFromSelection : INotifySelection + sealed class ProductionQueueFromSelection : INotifySelection { readonly World world; readonly Lazy tabsWidget; diff --git a/OpenRA.Mods.Common/Traits/Render/CashTricklerBar.cs b/OpenRA.Mods.Common/Traits/Render/CashTricklerBar.cs index 0b5767a174..a2d4248d88 100644 --- a/OpenRA.Mods.Common/Traits/Render/CashTricklerBar.cs +++ b/OpenRA.Mods.Common/Traits/Render/CashTricklerBar.cs @@ -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 + sealed class CashTricklerBarInfo : TraitInfo, Requires { [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; diff --git a/OpenRA.Mods.Common/Traits/Render/CustomTerrainDebugOverlay.cs b/OpenRA.Mods.Common/Traits/Render/CustomTerrainDebugOverlay.cs index 43c9c23408..6f8272da44 100644 --- a/OpenRA.Mods.Common/Traits/Render/CustomTerrainDebugOverlay.cs +++ b/OpenRA.Mods.Common/Traits/Render/CustomTerrainDebugOverlay.cs @@ -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"; diff --git a/OpenRA.Mods.Common/Traits/Render/ProductionBar.cs b/OpenRA.Mods.Common/Traits/Render/ProductionBar.cs index 4102639eaf..c22c1454aa 100644 --- a/OpenRA.Mods.Common/Traits/Render/ProductionBar.cs +++ b/OpenRA.Mods.Common/Traits/Render/ProductionBar.cs @@ -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, IRulesetLoaded + sealed class ProductionBarInfo : ConditionalTraitInfo, Requires, 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, ISelectionBar, ITick, INotifyOwnerChanged + sealed class ProductionBar : ConditionalTrait, ISelectionBar, ITick, INotifyOwnerChanged { readonly Actor self; ProductionQueue queue; diff --git a/OpenRA.Mods.Common/Traits/Render/ReloadArmamentsBar.cs b/OpenRA.Mods.Common/Traits/Render/ReloadArmamentsBar.cs index 55ef844cde..520d4bf4bc 100644 --- a/OpenRA.Mods.Common/Traits/Render/ReloadArmamentsBar.cs +++ b/OpenRA.Mods.Common/Traits/Render/ReloadArmamentsBar.cs @@ -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; diff --git a/OpenRA.Mods.Common/Traits/Render/RenderDebugState.cs b/OpenRA.Mods.Common/Traits/Render/RenderDebugState.cs index 8616b16c8c..bea697c060 100644 --- a/OpenRA.Mods.Common/Traits/Render/RenderDebugState.cs +++ b/OpenRA.Mods.Common/Traits/Render/RenderDebugState.cs @@ -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; diff --git a/OpenRA.Mods.Common/Traits/Render/RenderJammerCircle.cs b/OpenRA.Mods.Common/Traits/Render/RenderJammerCircle.cs index 20b20e1ca5..6606503c28 100644 --- a/OpenRA.Mods.Common/Traits/Render/RenderJammerCircle.cs +++ b/OpenRA.Mods.Common/Traits/Render/RenderJammerCircle.cs @@ -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, IRenderAnnotationsWhenSelected + sealed class RenderJammerCircle : ConditionalTrait, IRenderAnnotationsWhenSelected { readonly RenderJammerCircleInfo info; diff --git a/OpenRA.Mods.Common/Traits/Render/RenderRangeCircle.cs b/OpenRA.Mods.Common/Traits/Render/RenderRangeCircle.cs index 608f31b814..47e4200469 100644 --- a/OpenRA.Mods.Common/Traits/Render/RenderRangeCircle.cs +++ b/OpenRA.Mods.Common/Traits/Render/RenderRangeCircle.cs @@ -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 + sealed class RenderRangeCircleInfo : TraitInfo, IPlaceBuildingDecorationInfo, IRulesetLoaded, Requires { 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; diff --git a/OpenRA.Mods.Common/Traits/Render/RenderShroudCircle.cs b/OpenRA.Mods.Common/Traits/Render/RenderShroudCircle.cs index 75c6f05f10..86d164caf5 100644 --- a/OpenRA.Mods.Common/Traits/Render/RenderShroudCircle.cs +++ b/OpenRA.Mods.Common/Traits/Render/RenderShroudCircle.cs @@ -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, INotifyCreated, IRenderAnnotationsWhenSelected + sealed class RenderShroudCircle : ConditionalTrait, INotifyCreated, IRenderAnnotationsWhenSelected { readonly RenderShroudCircleInfo info; WDist range; diff --git a/OpenRA.Mods.Common/Traits/Render/RenderSprites.cs b/OpenRA.Mods.Common/Traits/Render/RenderSprites.cs index 8e4d262b53..9913be451c 100644 --- a/OpenRA.Mods.Common/Traits/Render/RenderSprites.cs +++ b/OpenRA.Mods.Common/Traits/Render/RenderSprites.cs @@ -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; diff --git a/OpenRA.Mods.Common/Traits/Render/RenderSpritesEditorOnly.cs b/OpenRA.Mods.Common/Traits/Render/RenderSpritesEditorOnly.cs index efe667d5fd..ed60bfcb0c 100644 --- a/OpenRA.Mods.Common/Traits/Render/RenderSpritesEditorOnly.cs +++ b/OpenRA.Mods.Common/Traits/Render/RenderSpritesEditorOnly.cs @@ -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) { } diff --git a/OpenRA.Mods.Common/Traits/Render/RenderVoxels.cs b/OpenRA.Mods.Common/Traits/Render/RenderVoxels.cs index 7090e6761f..d0f43f82c4 100644 --- a/OpenRA.Mods.Common/Traits/Render/RenderVoxels.cs +++ b/OpenRA.Mods.Common/Traits/Render/RenderVoxels.cs @@ -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; diff --git a/OpenRA.Mods.Common/Traits/Render/SupportPowerChargeBar.cs b/OpenRA.Mods.Common/Traits/Render/SupportPowerChargeBar.cs index d484a3bcc2..d6ec6a9f70 100644 --- a/OpenRA.Mods.Common/Traits/Render/SupportPowerChargeBar.cs +++ b/OpenRA.Mods.Common/Traits/Render/SupportPowerChargeBar.cs @@ -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, ISelectionBar, INotifyOwnerChanged + sealed class SupportPowerChargeBar : ConditionalTrait, ISelectionBar, INotifyOwnerChanged { readonly Actor self; SupportPowerManager spm; diff --git a/OpenRA.Mods.Common/Traits/Render/TimedConditionBar.cs b/OpenRA.Mods.Common/Traits/Render/TimedConditionBar.cs index 9679815788..10a557d314 100644 --- a/OpenRA.Mods.Common/Traits/Render/TimedConditionBar.cs +++ b/OpenRA.Mods.Common/Traits/Render/TimedConditionBar.cs @@ -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; diff --git a/OpenRA.Mods.Common/Traits/Render/WithBridgeSpriteBody.cs b/OpenRA.Mods.Common/Traits/Render/WithBridgeSpriteBody.cs index 60d780b87e..e28bb15417 100644 --- a/OpenRA.Mods.Common/Traits/Render/WithBridgeSpriteBody.cs +++ b/OpenRA.Mods.Common/Traits/Render/WithBridgeSpriteBody.cs @@ -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; diff --git a/OpenRA.Mods.Common/Traits/Render/WithChargeOverlay.cs b/OpenRA.Mods.Common/Traits/Render/WithChargeOverlay.cs index c7fda1da35..4ad4038d48 100644 --- a/OpenRA.Mods.Common/Traits/Render/WithChargeOverlay.cs +++ b/OpenRA.Mods.Common/Traits/Render/WithChargeOverlay.cs @@ -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, Requires + sealed class WithChargeOverlayInfo : PausableConditionalTraitInfo, Requires, Requires { [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, INotifyDamageStateChanged + sealed class WithChargeOverlay : PausableConditionalTrait, INotifyDamageStateChanged { readonly Animation overlay; diff --git a/OpenRA.Mods.Common/Traits/Render/WithCrateBody.cs b/OpenRA.Mods.Common/Traits/Render/WithCrateBody.cs index 1af100af59..8af987a513 100644 --- a/OpenRA.Mods.Common/Traits/Render/WithCrateBody.cs +++ b/OpenRA.Mods.Common/Traits/Render/WithCrateBody.cs @@ -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, IRenderActorPreviewSpritesInfo + sealed class WithCrateBodyInfo : TraitInfo, Requires, IRenderActorPreviewSpritesInfo { [Desc("Easteregg sequences to use in December.")] public readonly string[] XmasImages = Array.Empty(); @@ -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; diff --git a/OpenRA.Mods.Common/Traits/Render/WithDeadBridgeSpriteBody.cs b/OpenRA.Mods.Common/Traits/Render/WithDeadBridgeSpriteBody.cs index 0f42d1865f..5a38bbc35f 100644 --- a/OpenRA.Mods.Common/Traits/Render/WithDeadBridgeSpriteBody.cs +++ b/OpenRA.Mods.Common/Traits/Render/WithDeadBridgeSpriteBody.cs @@ -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(); @@ -61,7 +61,7 @@ namespace OpenRA.Mods.Common.Traits.Render } } - class WithDeadBridgeSpriteBody : WithSpriteBody + sealed class WithDeadBridgeSpriteBody : WithSpriteBody { readonly WithDeadBridgeSpriteBodyInfo bridgeInfo; readonly BridgeLayer bridgeLayer; diff --git a/OpenRA.Mods.Common/Traits/Render/WithGateSpriteBody.cs b/OpenRA.Mods.Common/Traits/Render/WithGateSpriteBody.cs index a07de89d4d..55de51945d 100644 --- a/OpenRA.Mods.Common/Traits/Render/WithGateSpriteBody.cs +++ b/OpenRA.Mods.Common/Traits/Render/WithGateSpriteBody.cs @@ -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 + sealed class WithGateSpriteBodyInfo : WithSpriteBodyInfo, IWallConnectorInfo, Requires { [Desc("Cells (outside the gate footprint) that contain wall cells that can connect to the gate")] public readonly CVec[] WallConnections = Array.Empty(); @@ -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; diff --git a/OpenRA.Mods.Common/Traits/Render/WithHarvestOverlay.cs b/OpenRA.Mods.Common/Traits/Render/WithHarvestOverlay.cs index 4808ab30b1..d2e014761e 100644 --- a/OpenRA.Mods.Common/Traits/Render/WithHarvestOverlay.cs +++ b/OpenRA.Mods.Common/Traits/Render/WithHarvestOverlay.cs @@ -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, Requires + sealed class WithHarvestOverlayInfo : TraitInfo, Requires, Requires { [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; diff --git a/OpenRA.Mods.Common/Traits/Render/WithMuzzleOverlay.cs b/OpenRA.Mods.Common/Traits/Render/WithMuzzleOverlay.cs index 6e88455046..c0c9a5f8e2 100644 --- a/OpenRA.Mods.Common/Traits/Render/WithMuzzleOverlay.cs +++ b/OpenRA.Mods.Common/Traits/Render/WithMuzzleOverlay.cs @@ -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, Requires, Requires + sealed class WithMuzzleOverlayInfo : ConditionalTraitInfo, Requires, Requires, Requires { [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, INotifyAttack, IRender, ITick + sealed class WithMuzzleOverlay : ConditionalTrait, INotifyAttack, IRender, ITick { readonly Dictionary visible = new(); readonly Dictionary anims = new(); diff --git a/OpenRA.Mods.Common/Traits/Render/WithProductionDoorOverlay.cs b/OpenRA.Mods.Common/Traits/Render/WithProductionDoorOverlay.cs index 43a5976c41..3f13b95457 100644 --- a/OpenRA.Mods.Common/Traits/Render/WithProductionDoorOverlay.cs +++ b/OpenRA.Mods.Common/Traits/Render/WithProductionDoorOverlay.cs @@ -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, Requires, Requires + sealed class WithProductionDoorOverlayInfo : ConditionalTraitInfo, IRenderActorPreviewSpritesInfo, Requires, Requires, Requires { [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, ITick, INotifyProduction, INotifyDamageStateChanged + sealed class WithProductionDoorOverlay : ConditionalTrait, ITick, INotifyProduction, INotifyDamageStateChanged { readonly Animation door; int desiredFrame; diff --git a/OpenRA.Mods.Common/Traits/Render/WithRangeCircle.cs b/OpenRA.Mods.Common/Traits/Render/WithRangeCircle.cs index c2123364f4..1b6ae5c77b 100644 --- a/OpenRA.Mods.Common/Traits/Render/WithRangeCircle.cs +++ b/OpenRA.Mods.Common/Traits/Render/WithRangeCircle.cs @@ -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, IRenderAnnotationsWhenSelected, IRenderAnnotations + sealed class WithRangeCircle : ConditionalTrait, IRenderAnnotationsWhenSelected, IRenderAnnotations { readonly Actor self; diff --git a/OpenRA.Mods.Common/Traits/Render/WithResourceLevelOverlay.cs b/OpenRA.Mods.Common/Traits/Render/WithResourceLevelOverlay.cs index 0fccb1dffa..06a2dc7e17 100644 --- a/OpenRA.Mods.Common/Traits/Render/WithResourceLevelOverlay.cs +++ b/OpenRA.Mods.Common/Traits/Render/WithResourceLevelOverlay.cs @@ -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, Requires + sealed class WithResourceLevelOverlayInfo : ConditionalTraitInfo, Requires, Requires { [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, INotifyOwnerChanged, INotifyDamageStateChanged + sealed class WithResourceLevelOverlay : ConditionalTrait, INotifyOwnerChanged, INotifyDamageStateChanged { readonly AnimationWithOffset anim; readonly RenderSprites rs; diff --git a/OpenRA.Mods.Common/Traits/Render/WithWallSpriteBody.cs b/OpenRA.Mods.Common/Traits/Render/WithWallSpriteBody.cs index 74cfa75827..63d1175332 100644 --- a/OpenRA.Mods.Common/Traits/Render/WithWallSpriteBody.cs +++ b/OpenRA.Mods.Common/Traits/Render/WithWallSpriteBody.cs @@ -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 + sealed class WithWallSpriteBodyInfo : WithSpriteBodyInfo, IWallConnectorInfo, Requires { 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; diff --git a/OpenRA.Mods.Common/Traits/RepairsBridges.cs b/OpenRA.Mods.Common/Traits/RepairsBridges.cs index ee0c8faebe..88bcdbc0d6 100644 --- a/OpenRA.Mods.Common/Traits/RepairsBridges.cs +++ b/OpenRA.Mods.Common/Traits/RepairsBridges.cs @@ -115,7 +115,7 @@ namespace OpenRA.Mods.Common.Traits } } - class RepairBridgeOrderTargeter : UnitOrderTargeter + sealed class RepairBridgeOrderTargeter : UnitOrderTargeter { readonly RepairsBridgesInfo info; diff --git a/OpenRA.Mods.Common/Traits/SeedsResource.cs b/OpenRA.Mods.Common/Traits/SeedsResource.cs index 227a1848bd..a4cbaba8e3 100644 --- a/OpenRA.Mods.Common/Traits/SeedsResource.cs +++ b/OpenRA.Mods.Common/Traits/SeedsResource.cs @@ -15,7 +15,7 @@ using OpenRA.Traits; namespace OpenRA.Mods.Common.Traits { [Desc("Lets the actor spread resources around it in a circle.")] - class SeedsResourceInfo : ConditionalTraitInfo + sealed class SeedsResourceInfo : ConditionalTraitInfo { public readonly int Interval = 75; public readonly string ResourceType = "Ore"; @@ -24,7 +24,7 @@ namespace OpenRA.Mods.Common.Traits public override object Create(ActorInitializer init) { return new SeedsResource(init.Self, this); } } - class SeedsResource : ConditionalTrait, ITick, ISeedableResource + sealed class SeedsResource : ConditionalTrait, ITick, ISeedableResource { readonly SeedsResourceInfo info; readonly IResourceLayer resourceLayer; diff --git a/OpenRA.Mods.Common/Traits/Sound/ActorLostNotification.cs b/OpenRA.Mods.Common/Traits/Sound/ActorLostNotification.cs index 50cd299433..c8b1e9da9f 100644 --- a/OpenRA.Mods.Common/Traits/Sound/ActorLostNotification.cs +++ b/OpenRA.Mods.Common/Traits/Sound/ActorLostNotification.cs @@ -13,7 +13,7 @@ using OpenRA.Traits; namespace OpenRA.Mods.Common.Traits.Sound { - class ActorLostNotificationInfo : ConditionalTraitInfo + sealed class ActorLostNotificationInfo : ConditionalTraitInfo { [NotificationReference("Speech")] [Desc("Speech notification to play.")] @@ -27,7 +27,7 @@ namespace OpenRA.Mods.Common.Traits.Sound public override object Create(ActorInitializer init) { return new ActorLostNotification(this); } } - class ActorLostNotification : ConditionalTrait, INotifyKilled + sealed class ActorLostNotification : ConditionalTrait, INotifyKilled { public ActorLostNotification(ActorLostNotificationInfo info) : base(info) { } diff --git a/OpenRA.Mods.Common/Traits/Sound/AmbientSound.cs b/OpenRA.Mods.Common/Traits/Sound/AmbientSound.cs index 670e962df7..7efd75e6ad 100644 --- a/OpenRA.Mods.Common/Traits/Sound/AmbientSound.cs +++ b/OpenRA.Mods.Common/Traits/Sound/AmbientSound.cs @@ -15,7 +15,7 @@ using OpenRA.Traits; namespace OpenRA.Mods.Common.Traits.Sound { [Desc("Plays a looping audio file at the actor position. Attach this to the `World` actor to cover the whole map.")] - class AmbientSoundInfo : ConditionalTraitInfo + sealed class AmbientSoundInfo : ConditionalTraitInfo { [FieldLoader.Require] public readonly string[] SoundFiles = null; @@ -31,7 +31,7 @@ namespace OpenRA.Mods.Common.Traits.Sound public override object Create(ActorInitializer init) { return new AmbientSound(init.Self, this); } } - class AmbientSound : ConditionalTrait, ITick, INotifyRemovedFromWorld + sealed class AmbientSound : ConditionalTrait, ITick, INotifyRemovedFromWorld { readonly bool loop; readonly HashSet currentSounds = new(); diff --git a/OpenRA.Mods.Common/Traits/SupportPowers/GrantExternalConditionPower.cs b/OpenRA.Mods.Common/Traits/SupportPowers/GrantExternalConditionPower.cs index 66d882cc71..d8bf57bd68 100644 --- a/OpenRA.Mods.Common/Traits/SupportPowers/GrantExternalConditionPower.cs +++ b/OpenRA.Mods.Common/Traits/SupportPowers/GrantExternalConditionPower.cs @@ -110,7 +110,7 @@ namespace OpenRA.Mods.Common.Traits }); } - class SelectConditionTarget : OrderGenerator + sealed class SelectConditionTarget : OrderGenerator { readonly GrantExternalConditionPower power; readonly char[] footprint; diff --git a/OpenRA.Mods.Common/Traits/SupportPowers/NukePower.cs b/OpenRA.Mods.Common/Traits/SupportPowers/NukePower.cs index 5adadd25b5..55830e35e5 100644 --- a/OpenRA.Mods.Common/Traits/SupportPowers/NukePower.cs +++ b/OpenRA.Mods.Common/Traits/SupportPowers/NukePower.cs @@ -138,7 +138,7 @@ namespace OpenRA.Mods.Common.Traits } } - class NukePower : SupportPower + sealed class NukePower : SupportPower { readonly NukePowerInfo info; BodyOrientation body; diff --git a/OpenRA.Mods.Common/Traits/SupportPowers/SelectDirectionalTarget.cs b/OpenRA.Mods.Common/Traits/SupportPowers/SelectDirectionalTarget.cs index ae98c12f04..cdcaf268bd 100644 --- a/OpenRA.Mods.Common/Traits/SupportPowers/SelectDirectionalTarget.cs +++ b/OpenRA.Mods.Common/Traits/SupportPowers/SelectDirectionalTarget.cs @@ -176,7 +176,7 @@ namespace OpenRA.Mods.Common.Traits return points; } - class Arrow + sealed class Arrow { public Sprite Sprite { get; } public double EndAngle { get; } diff --git a/OpenRA.Mods.Common/Traits/ThrowsParticle.cs b/OpenRA.Mods.Common/Traits/ThrowsParticle.cs index 4d43c4ff02..68c7fa9fcc 100644 --- a/OpenRA.Mods.Common/Traits/ThrowsParticle.cs +++ b/OpenRA.Mods.Common/Traits/ThrowsParticle.cs @@ -16,7 +16,7 @@ using OpenRA.Traits; namespace OpenRA.Mods.Common.Traits { - class ThrowsParticleInfo : TraitInfo, Requires, Requires + sealed class ThrowsParticleInfo : TraitInfo, Requires, Requires { [FieldLoader.Require] public readonly string Anim = null; @@ -45,7 +45,7 @@ namespace OpenRA.Mods.Common.Traits public override object Create(ActorInitializer init) { return new ThrowsParticle(init, this); } } - class ThrowsParticle : ITick + sealed class ThrowsParticle : ITick { WVec pos; readonly WVec initialPos; diff --git a/OpenRA.Mods.Common/Traits/ThrowsShrapnel.cs b/OpenRA.Mods.Common/Traits/ThrowsShrapnel.cs index 4d02d4948f..e0fc1c2a2f 100644 --- a/OpenRA.Mods.Common/Traits/ThrowsShrapnel.cs +++ b/OpenRA.Mods.Common/Traits/ThrowsShrapnel.cs @@ -47,7 +47,7 @@ namespace OpenRA.Mods.Common.Traits } } - class ThrowsShrapnel : ConditionalTrait, INotifyKilled + sealed class ThrowsShrapnel : ConditionalTrait, INotifyKilled { public ThrowsShrapnel(ThrowsShrapnelInfo info) : base(info) { } diff --git a/OpenRA.Mods.Common/Traits/TurnOnIdle.cs b/OpenRA.Mods.Common/Traits/TurnOnIdle.cs index 2735d5da3d..5af489f440 100644 --- a/OpenRA.Mods.Common/Traits/TurnOnIdle.cs +++ b/OpenRA.Mods.Common/Traits/TurnOnIdle.cs @@ -14,7 +14,7 @@ using OpenRA.Traits; namespace OpenRA.Mods.Common.Traits { [Desc("Turns actor randomly when idle.")] - class TurnOnIdleInfo : ConditionalTraitInfo, Requires + sealed class TurnOnIdleInfo : ConditionalTraitInfo, Requires { [Desc("Minimum amount of ticks the actor will wait before the turn.")] public readonly int MinDelay = 400; @@ -25,7 +25,7 @@ namespace OpenRA.Mods.Common.Traits public override object Create(ActorInitializer init) { return new TurnOnIdle(init, this); } } - class TurnOnIdle : ConditionalTrait, INotifyIdle + sealed class TurnOnIdle : ConditionalTrait, INotifyIdle { int currentDelay; WAngle targetFacing; diff --git a/OpenRA.Mods.Common/Traits/World/ActorMap.cs b/OpenRA.Mods.Common/Traits/World/ActorMap.cs index c0dc75913a..595ec77a5f 100644 --- a/OpenRA.Mods.Common/Traits/World/ActorMap.cs +++ b/OpenRA.Mods.Common/Traits/World/ActorMap.cs @@ -29,20 +29,20 @@ namespace OpenRA.Mods.Common.Traits public class ActorMap : IActorMap, ITick, INotifyCreated { - class InfluenceNode + sealed class InfluenceNode { public InfluenceNode Next; public SubCell SubCell; public Actor Actor; } - class Bin + sealed class Bin { public readonly List Actors = new(); public readonly List ProximityTriggers = new(); } - class CellTrigger + sealed class CellTrigger { public readonly CPos[] Footprint; public bool Dirty; @@ -89,7 +89,7 @@ namespace OpenRA.Mods.Common.Traits } } - class ProximityTrigger : IDisposable + sealed class ProximityTrigger : IDisposable { public WPos TopLeft { get; private set; } public WPos BottomRight { get; private set; } diff --git a/OpenRA.Mods.Common/Traits/World/BridgeLayer.cs b/OpenRA.Mods.Common/Traits/World/BridgeLayer.cs index 9027cacd9d..1abef2bf7b 100644 --- a/OpenRA.Mods.Common/Traits/World/BridgeLayer.cs +++ b/OpenRA.Mods.Common/Traits/World/BridgeLayer.cs @@ -27,12 +27,12 @@ namespace OpenRA.Mods.Common.Traits } [TraitLocation(SystemActors.World)] - class BridgeLayerInfo : TraitInfo + sealed class BridgeLayerInfo : TraitInfo { public override object Create(ActorInitializer init) { return new BridgeLayer(init.World); } } - class BridgeLayer + sealed class BridgeLayer { readonly CellLayer bridges; diff --git a/OpenRA.Mods.Common/Traits/World/CliffBackImpassabilityLayer.cs b/OpenRA.Mods.Common/Traits/World/CliffBackImpassabilityLayer.cs index 574f1aebfc..1a84a14a5b 100644 --- a/OpenRA.Mods.Common/Traits/World/CliffBackImpassabilityLayer.cs +++ b/OpenRA.Mods.Common/Traits/World/CliffBackImpassabilityLayer.cs @@ -18,14 +18,14 @@ namespace OpenRA.Mods.Common.Traits [Desc("Sets a custom terrain type for cells that are obscured by back-facing cliffs.", "This trait replicates the default CliffBackImpassability=2 behaviour from the TS/RA2 rules.ini.")] [TraitLocation(SystemActors.World | SystemActors.EditorWorld)] - class CliffBackImpassabilityLayerInfo : TraitInfo + sealed class CliffBackImpassabilityLayerInfo : TraitInfo { public readonly string TerrainType = "Impassable"; public override object Create(ActorInitializer init) { return new CliffBackImpassabilityLayer(this); } } - class CliffBackImpassabilityLayer : IWorldLoaded + sealed class CliffBackImpassabilityLayer : IWorldLoaded { readonly CliffBackImpassabilityLayerInfo info; diff --git a/OpenRA.Mods.Common/Traits/World/EditorActionManager.cs b/OpenRA.Mods.Common/Traits/World/EditorActionManager.cs index 1bcdc8d2f8..63fa037aab 100644 --- a/OpenRA.Mods.Common/Traits/World/EditorActionManager.cs +++ b/OpenRA.Mods.Common/Traits/World/EditorActionManager.cs @@ -144,7 +144,7 @@ namespace OpenRA.Mods.Common.Traits string Text { get; } } - class OpenMapAction : IEditorAction + sealed class OpenMapAction : IEditorAction { [TranslationReference] const string Opened = "notification-opened"; diff --git a/OpenRA.Mods.Common/Traits/World/MapStartingLocations.cs b/OpenRA.Mods.Common/Traits/World/MapStartingLocations.cs index 4e5dc4e4e1..69797a2c50 100644 --- a/OpenRA.Mods.Common/Traits/World/MapStartingLocations.cs +++ b/OpenRA.Mods.Common/Traits/World/MapStartingLocations.cs @@ -60,7 +60,7 @@ namespace OpenRA.Mods.Common.Traits SeparateTeamSpawnsCheckboxLocked); } - class AssignSpawnLocationsState + sealed class AssignSpawnLocationsState { public CPos[] SpawnLocations; public List AvailableSpawnPoints; diff --git a/OpenRA.Mods.Common/Traits/World/StartGameNotification.cs b/OpenRA.Mods.Common/Traits/World/StartGameNotification.cs index 2e541f5ad7..23aa00495d 100644 --- a/OpenRA.Mods.Common/Traits/World/StartGameNotification.cs +++ b/OpenRA.Mods.Common/Traits/World/StartGameNotification.cs @@ -15,7 +15,7 @@ using OpenRA.Traits; namespace OpenRA.Mods.Common.Traits { [TraitLocation(SystemActors.World)] - class StartGameNotificationInfo : TraitInfo + sealed class StartGameNotificationInfo : TraitInfo { [NotificationReference("Speech")] public readonly string Notification = "StartGame"; @@ -35,7 +35,7 @@ namespace OpenRA.Mods.Common.Traits public override object Create(ActorInitializer init) { return new StartGameNotification(this); } } - class StartGameNotification : IWorldLoaded, INotifyGameLoaded, INotifyGameSaved + sealed class StartGameNotification : IWorldLoaded, INotifyGameLoaded, INotifyGameSaved { readonly StartGameNotificationInfo info; public StartGameNotification(StartGameNotificationInfo info) diff --git a/OpenRA.Mods.Common/Traits/World/TerrainLighting.cs b/OpenRA.Mods.Common/Traits/World/TerrainLighting.cs index 062e5438da..a612e5b3be 100644 --- a/OpenRA.Mods.Common/Traits/World/TerrainLighting.cs +++ b/OpenRA.Mods.Common/Traits/World/TerrainLighting.cs @@ -35,7 +35,7 @@ namespace OpenRA.Mods.Common.Traits public sealed class TerrainLighting : ITerrainLighting { - class LightSource + sealed class LightSource { public readonly WPos Pos; public readonly CPos Cell; diff --git a/OpenRA.Mods.Common/Traits/World/WarheadDebugOverlay.cs b/OpenRA.Mods.Common/Traits/World/WarheadDebugOverlay.cs index 7446fe217a..7d8f2a1a02 100644 --- a/OpenRA.Mods.Common/Traits/World/WarheadDebugOverlay.cs +++ b/OpenRA.Mods.Common/Traits/World/WarheadDebugOverlay.cs @@ -28,7 +28,7 @@ namespace OpenRA.Mods.Common.Traits public class WarheadDebugOverlay : IRenderAnnotations { - class WHImpact + sealed class WHImpact { public readonly WPos CenterPosition; public readonly WDist[] Range; diff --git a/OpenRA.Mods.Common/UpdateRules/Rules/20200503/ChangeTargetLineDelayToMilliseconds.cs b/OpenRA.Mods.Common/UpdateRules/Rules/20200503/ChangeTargetLineDelayToMilliseconds.cs index cf000b8027..29348f10ef 100644 --- a/OpenRA.Mods.Common/UpdateRules/Rules/20200503/ChangeTargetLineDelayToMilliseconds.cs +++ b/OpenRA.Mods.Common/UpdateRules/Rules/20200503/ChangeTargetLineDelayToMilliseconds.cs @@ -13,7 +13,7 @@ using System.Collections.Generic; namespace OpenRA.Mods.Common.UpdateRules.Rules { - class ChangeTargetLineDelayToMilliseconds : UpdateRule + sealed class ChangeTargetLineDelayToMilliseconds : UpdateRule { public override string Name => "Changed DrawLineToTarget.Delay interpretation from ticks to milliseconds."; diff --git a/OpenRA.Mods.Common/UpdateRules/Rules/20200503/RenameInfiltrationNotifications.cs b/OpenRA.Mods.Common/UpdateRules/Rules/20200503/RenameInfiltrationNotifications.cs index 109232ae6c..2e2f057fb1 100644 --- a/OpenRA.Mods.Common/UpdateRules/Rules/20200503/RenameInfiltrationNotifications.cs +++ b/OpenRA.Mods.Common/UpdateRules/Rules/20200503/RenameInfiltrationNotifications.cs @@ -13,7 +13,7 @@ using System.Collections.Generic; namespace OpenRA.Mods.Common.UpdateRules.Rules { - class RenameInfiltrationNotifications : UpdateRule + sealed class RenameInfiltrationNotifications : UpdateRule { public override string Name => "Renamed InfiltrateForCash Notification to InfiltratedNotification."; diff --git a/OpenRA.Mods.Common/UpdateRules/Rules/20200503/RenameWithNukeLaunch.cs b/OpenRA.Mods.Common/UpdateRules/Rules/20200503/RenameWithNukeLaunch.cs index 59cf92d32a..c8060f71a0 100644 --- a/OpenRA.Mods.Common/UpdateRules/Rules/20200503/RenameWithNukeLaunch.cs +++ b/OpenRA.Mods.Common/UpdateRules/Rules/20200503/RenameWithNukeLaunch.cs @@ -13,7 +13,7 @@ using System.Collections.Generic; namespace OpenRA.Mods.Common.UpdateRules.Rules { - class RenameWithNukeLaunch : UpdateRule + sealed class RenameWithNukeLaunch : UpdateRule { public override string Name => "Renamed WithNukeLaunchAnimation and Overlay"; diff --git a/OpenRA.Mods.Common/UpdateRules/Rules/20200503/ReplaceFacingAngles.cs b/OpenRA.Mods.Common/UpdateRules/Rules/20200503/ReplaceFacingAngles.cs index 4379b950e6..6b9d0be553 100644 --- a/OpenRA.Mods.Common/UpdateRules/Rules/20200503/ReplaceFacingAngles.cs +++ b/OpenRA.Mods.Common/UpdateRules/Rules/20200503/ReplaceFacingAngles.cs @@ -14,7 +14,7 @@ using System.Linq; namespace OpenRA.Mods.Common.UpdateRules.Rules { - class ReplaceFacingAngles : UpdateRule + sealed class ReplaceFacingAngles : UpdateRule { static readonly Dictionary TraitFields = new() { diff --git a/OpenRA.Mods.Common/UpdateRules/Rules/20200503/SpawnActorPowerDefaultEffect.cs b/OpenRA.Mods.Common/UpdateRules/Rules/20200503/SpawnActorPowerDefaultEffect.cs index e0ad305867..0afe0e6828 100644 --- a/OpenRA.Mods.Common/UpdateRules/Rules/20200503/SpawnActorPowerDefaultEffect.cs +++ b/OpenRA.Mods.Common/UpdateRules/Rules/20200503/SpawnActorPowerDefaultEffect.cs @@ -13,7 +13,7 @@ using System.Collections.Generic; namespace OpenRA.Mods.Common.UpdateRules.Rules { - class SpawnActorPowerDefaultEffect : UpdateRule + sealed class SpawnActorPowerDefaultEffect : UpdateRule { public override string Name => "Set SpawnActorPower EffectSequence to it's previous default value."; diff --git a/OpenRA.Mods.Common/UpdateRules/Rules/20200503/UpdateMapInits.cs b/OpenRA.Mods.Common/UpdateRules/Rules/20200503/UpdateMapInits.cs index 407fa917bb..fb8945e8c7 100644 --- a/OpenRA.Mods.Common/UpdateRules/Rules/20200503/UpdateMapInits.cs +++ b/OpenRA.Mods.Common/UpdateRules/Rules/20200503/UpdateMapInits.cs @@ -13,7 +13,7 @@ using System.Collections.Generic; namespace OpenRA.Mods.Common.UpdateRules.Rules { - class UpdateMapInits : UpdateRule + sealed class UpdateMapInits : UpdateRule { public override string Name => "Update map actor definitions"; diff --git a/OpenRA.Mods.Common/UpdateRules/Rules/20200503/UpdateTilesetColors.cs b/OpenRA.Mods.Common/UpdateRules/Rules/20200503/UpdateTilesetColors.cs index 1d238baf50..2448663903 100644 --- a/OpenRA.Mods.Common/UpdateRules/Rules/20200503/UpdateTilesetColors.cs +++ b/OpenRA.Mods.Common/UpdateRules/Rules/20200503/UpdateTilesetColors.cs @@ -13,7 +13,7 @@ using System.Collections.Generic; namespace OpenRA.Mods.Common.UpdateRules.Rules { - class UpdateTilesetColors : UpdateRule + sealed class UpdateTilesetColors : UpdateRule { public override string Name => "Rename Tileset LeftColor and RightColor"; diff --git a/OpenRA.Mods.Common/UtilityCommands/CheckMissingSprites.cs b/OpenRA.Mods.Common/UtilityCommands/CheckMissingSprites.cs index cf2d55bac5..eb34591f40 100644 --- a/OpenRA.Mods.Common/UtilityCommands/CheckMissingSprites.cs +++ b/OpenRA.Mods.Common/UtilityCommands/CheckMissingSprites.cs @@ -16,7 +16,7 @@ using OpenRA.Mods.Common.Traits; namespace OpenRA.Mods.Common.UtilityCommands { - class CheckMissingSprites : IUtilityCommand + sealed class CheckMissingSprites : IUtilityCommand { string IUtilityCommand.Name => "--check-missing-sprites"; diff --git a/OpenRA.Mods.Common/UtilityCommands/CheckYaml.cs b/OpenRA.Mods.Common/UtilityCommands/CheckYaml.cs index 267827235a..8b31d0d7c0 100644 --- a/OpenRA.Mods.Common/UtilityCommands/CheckYaml.cs +++ b/OpenRA.Mods.Common/UtilityCommands/CheckYaml.cs @@ -18,7 +18,7 @@ using OpenRA.Mods.Common.Lint; namespace OpenRA.Mods.Common.UtilityCommands { - class CheckYaml : IUtilityCommand + sealed class CheckYaml : IUtilityCommand { string IUtilityCommand.Name => "--check-yaml"; diff --git a/OpenRA.Mods.Common/UtilityCommands/ConvertSpriteToPngCommand.cs b/OpenRA.Mods.Common/UtilityCommands/ConvertSpriteToPngCommand.cs index 7779742649..4a2fd886a5 100644 --- a/OpenRA.Mods.Common/UtilityCommands/ConvertSpriteToPngCommand.cs +++ b/OpenRA.Mods.Common/UtilityCommands/ConvertSpriteToPngCommand.cs @@ -18,7 +18,7 @@ using OpenRA.Primitives; namespace OpenRA.Mods.Common.UtilityCommands { - class ConvertSpriteToPngCommand : IUtilityCommand + sealed class ConvertSpriteToPngCommand : IUtilityCommand { string IUtilityCommand.Name => "--png"; diff --git a/OpenRA.Mods.Common/UtilityCommands/CreateManPage.cs b/OpenRA.Mods.Common/UtilityCommands/CreateManPage.cs index 2c6dc17086..63ef62ec9c 100644 --- a/OpenRA.Mods.Common/UtilityCommands/CreateManPage.cs +++ b/OpenRA.Mods.Common/UtilityCommands/CreateManPage.cs @@ -14,7 +14,7 @@ using System.Linq; namespace OpenRA.Mods.Common.UtilityCommands { - class CreateManPage : IUtilityCommand + sealed class CreateManPage : IUtilityCommand { string IUtilityCommand.Name => "--man-page"; diff --git a/OpenRA.Mods.Common/UtilityCommands/DebugChromeRegions.cs b/OpenRA.Mods.Common/UtilityCommands/DebugChromeRegions.cs index 0e9b4e0eec..da636777ab 100644 --- a/OpenRA.Mods.Common/UtilityCommands/DebugChromeRegions.cs +++ b/OpenRA.Mods.Common/UtilityCommands/DebugChromeRegions.cs @@ -17,7 +17,7 @@ using OpenRA.Primitives; namespace OpenRA.Mods.Common.UtilityCommands { - class DebugChromeRegions : IUtilityCommand + sealed class DebugChromeRegions : IUtilityCommand { string IUtilityCommand.Name => "--debug-chrome-regions"; diff --git a/OpenRA.Mods.Common/UtilityCommands/DumpSequenceSheetsCommand.cs b/OpenRA.Mods.Common/UtilityCommands/DumpSequenceSheetsCommand.cs index 47a9e7c3ba..ae6eb431e8 100644 --- a/OpenRA.Mods.Common/UtilityCommands/DumpSequenceSheetsCommand.cs +++ b/OpenRA.Mods.Common/UtilityCommands/DumpSequenceSheetsCommand.cs @@ -15,7 +15,7 @@ using OpenRA.Graphics; namespace OpenRA.Mods.Common.UtilityCommands { - class DumpSequenceSheetsCommand : IUtilityCommand + sealed class DumpSequenceSheetsCommand : IUtilityCommand { static readonly int[] ChannelMasks = { 2, 1, 0, 3 }; diff --git a/OpenRA.Mods.Common/UtilityCommands/ExtractEmmyLuaAPI.cs b/OpenRA.Mods.Common/UtilityCommands/ExtractEmmyLuaAPI.cs index 4e26f835d5..12be8d749a 100644 --- a/OpenRA.Mods.Common/UtilityCommands/ExtractEmmyLuaAPI.cs +++ b/OpenRA.Mods.Common/UtilityCommands/ExtractEmmyLuaAPI.cs @@ -19,7 +19,7 @@ using OpenRA.Traits; namespace OpenRA.Mods.Common.UtilityCommands { // See https://emmylua.github.io/annotation.html for reference - class ExtractEmmyLuaAPI : IUtilityCommand + sealed class ExtractEmmyLuaAPI : IUtilityCommand { string IUtilityCommand.Name => "--emmy-lua-api"; diff --git a/OpenRA.Mods.Common/UtilityCommands/ExtractFilesCommand.cs b/OpenRA.Mods.Common/UtilityCommands/ExtractFilesCommand.cs index d46627f340..1409475478 100644 --- a/OpenRA.Mods.Common/UtilityCommands/ExtractFilesCommand.cs +++ b/OpenRA.Mods.Common/UtilityCommands/ExtractFilesCommand.cs @@ -15,7 +15,7 @@ using System.Linq; namespace OpenRA.Mods.Common.UtilityCommands { - class ExtractFilesCommand : IUtilityCommand + sealed class ExtractFilesCommand : IUtilityCommand { string IUtilityCommand.Name => "--extract"; diff --git a/OpenRA.Mods.Common/UtilityCommands/ExtractLuaDocsCommand.cs b/OpenRA.Mods.Common/UtilityCommands/ExtractLuaDocsCommand.cs index 39641feb1c..88d83a9f90 100644 --- a/OpenRA.Mods.Common/UtilityCommands/ExtractLuaDocsCommand.cs +++ b/OpenRA.Mods.Common/UtilityCommands/ExtractLuaDocsCommand.cs @@ -15,7 +15,7 @@ using OpenRA.Scripting; namespace OpenRA.Mods.Common.UtilityCommands { - class ExtractLuaDocsCommand : IUtilityCommand + sealed class ExtractLuaDocsCommand : IUtilityCommand { string IUtilityCommand.Name => "--lua-docs"; diff --git a/OpenRA.Mods.Common/UtilityCommands/ExtractSettingsDocsCommand.cs b/OpenRA.Mods.Common/UtilityCommands/ExtractSettingsDocsCommand.cs index fa8d4a5792..644f982ec6 100644 --- a/OpenRA.Mods.Common/UtilityCommands/ExtractSettingsDocsCommand.cs +++ b/OpenRA.Mods.Common/UtilityCommands/ExtractSettingsDocsCommand.cs @@ -14,7 +14,7 @@ using System.Linq; namespace OpenRA.Mods.Common.UtilityCommands { - class ExtractSettingsDocsCommand : IUtilityCommand + sealed class ExtractSettingsDocsCommand : IUtilityCommand { string IUtilityCommand.Name => "--settings-docs"; diff --git a/OpenRA.Mods.Common/UtilityCommands/ExtractSpriteSequenceDocsCommand.cs b/OpenRA.Mods.Common/UtilityCommands/ExtractSpriteSequenceDocsCommand.cs index 86e220243d..684bb688ed 100644 --- a/OpenRA.Mods.Common/UtilityCommands/ExtractSpriteSequenceDocsCommand.cs +++ b/OpenRA.Mods.Common/UtilityCommands/ExtractSpriteSequenceDocsCommand.cs @@ -20,7 +20,7 @@ using OpenRA.Primitives; namespace OpenRA.Mods.Common.UtilityCommands { - class ExtractSpriteSequenceDocsCommand : IUtilityCommand + sealed class ExtractSpriteSequenceDocsCommand : IUtilityCommand { string IUtilityCommand.Name => "--sprite-sequence-docs"; diff --git a/OpenRA.Mods.Common/UtilityCommands/ExtractTraitDocsCommand.cs b/OpenRA.Mods.Common/UtilityCommands/ExtractTraitDocsCommand.cs index bf412a7108..c202c091d9 100644 --- a/OpenRA.Mods.Common/UtilityCommands/ExtractTraitDocsCommand.cs +++ b/OpenRA.Mods.Common/UtilityCommands/ExtractTraitDocsCommand.cs @@ -18,7 +18,7 @@ using OpenRA.Traits; namespace OpenRA.Mods.Common.UtilityCommands { - class ExtractTraitDocsCommand : IUtilityCommand + sealed class ExtractTraitDocsCommand : IUtilityCommand { string IUtilityCommand.Name => "--docs"; diff --git a/OpenRA.Mods.Common/UtilityCommands/ExtractWeaponDocsCommand.cs b/OpenRA.Mods.Common/UtilityCommands/ExtractWeaponDocsCommand.cs index 389b5fe9a7..0aeca3a737 100644 --- a/OpenRA.Mods.Common/UtilityCommands/ExtractWeaponDocsCommand.cs +++ b/OpenRA.Mods.Common/UtilityCommands/ExtractWeaponDocsCommand.cs @@ -19,7 +19,7 @@ using OpenRA.Traits; namespace OpenRA.Mods.Common.UtilityCommands { - class ExtractWeaponDocsCommand : IUtilityCommand + sealed class ExtractWeaponDocsCommand : IUtilityCommand { string IUtilityCommand.Name => "--weapon-docs"; diff --git a/OpenRA.Mods.Common/UtilityCommands/ExtractZeroBraneStudioLuaAPI.cs b/OpenRA.Mods.Common/UtilityCommands/ExtractZeroBraneStudioLuaAPI.cs index 266b57fcc1..6e4ad7143f 100644 --- a/OpenRA.Mods.Common/UtilityCommands/ExtractZeroBraneStudioLuaAPI.cs +++ b/OpenRA.Mods.Common/UtilityCommands/ExtractZeroBraneStudioLuaAPI.cs @@ -17,7 +17,7 @@ using OpenRA.Scripting; namespace OpenRA.Mods.Common.UtilityCommands { // See https://studio.zerobrane.com/doc-api-auto-complete for reference - class ExtractZeroBraneStudioLuaAPI : IUtilityCommand + sealed class ExtractZeroBraneStudioLuaAPI : IUtilityCommand { string IUtilityCommand.Name => "--zbstudio-lua-api"; diff --git a/OpenRA.Mods.Common/UtilityCommands/GetMapHashCommand.cs b/OpenRA.Mods.Common/UtilityCommands/GetMapHashCommand.cs index f2179ae545..24ac995a50 100644 --- a/OpenRA.Mods.Common/UtilityCommands/GetMapHashCommand.cs +++ b/OpenRA.Mods.Common/UtilityCommands/GetMapHashCommand.cs @@ -14,7 +14,7 @@ using OpenRA.FileSystem; namespace OpenRA.Mods.Common.UtilityCommands { - class GetMapHashCommand : IUtilityCommand + sealed class GetMapHashCommand : IUtilityCommand { string IUtilityCommand.Name => "--map-hash"; diff --git a/OpenRA.Mods.Common/UtilityCommands/ListInstallShieldCabContentsCommand.cs b/OpenRA.Mods.Common/UtilityCommands/ListInstallShieldCabContentsCommand.cs index 0453d4d3a9..f426f93b77 100644 --- a/OpenRA.Mods.Common/UtilityCommands/ListInstallShieldCabContentsCommand.cs +++ b/OpenRA.Mods.Common/UtilityCommands/ListInstallShieldCabContentsCommand.cs @@ -16,7 +16,7 @@ using OpenRA.Mods.Common.FileFormats; namespace OpenRA.Mods.Common.UtilityCommands { - class ListInstallShieldCabContentsCommand : IUtilityCommand + sealed class ListInstallShieldCabContentsCommand : IUtilityCommand { string IUtilityCommand.Name => "--list-installshield-cab"; diff --git a/OpenRA.Mods.Common/UtilityCommands/ListMSCabContentsCommand.cs b/OpenRA.Mods.Common/UtilityCommands/ListMSCabContentsCommand.cs index 8309e481c6..da54ccdd01 100644 --- a/OpenRA.Mods.Common/UtilityCommands/ListMSCabContentsCommand.cs +++ b/OpenRA.Mods.Common/UtilityCommands/ListMSCabContentsCommand.cs @@ -15,7 +15,7 @@ using OpenRA.Mods.Common.FileFormats; namespace OpenRA.Mods.Common.UtilityCommands { - class ListMSCabContentsCommand : IUtilityCommand + sealed class ListMSCabContentsCommand : IUtilityCommand { string IUtilityCommand.Name => "--list-mscab"; diff --git a/OpenRA.Mods.Common/UtilityCommands/RefreshMapCommand.cs b/OpenRA.Mods.Common/UtilityCommands/RefreshMapCommand.cs index 66c716dc00..140883a1f9 100644 --- a/OpenRA.Mods.Common/UtilityCommands/RefreshMapCommand.cs +++ b/OpenRA.Mods.Common/UtilityCommands/RefreshMapCommand.cs @@ -13,7 +13,7 @@ using OpenRA.FileSystem; namespace OpenRA.Mods.Common.UtilityCommands { - class RefreshMapCommand : IUtilityCommand + sealed class RefreshMapCommand : IUtilityCommand { string IUtilityCommand.Name => "--refresh-map"; diff --git a/OpenRA.Mods.Common/UtilityCommands/ReplayMetadataCommand.cs b/OpenRA.Mods.Common/UtilityCommands/ReplayMetadataCommand.cs index 52ecc67d4d..84c5b08121 100644 --- a/OpenRA.Mods.Common/UtilityCommands/ReplayMetadataCommand.cs +++ b/OpenRA.Mods.Common/UtilityCommands/ReplayMetadataCommand.cs @@ -15,7 +15,7 @@ using OpenRA.FileFormats; namespace OpenRA.Mods.Common.UtilityCommands { - class ReplayMetadataCommand : IUtilityCommand + sealed class ReplayMetadataCommand : IUtilityCommand { string IUtilityCommand.Name => "--replay-metadata"; diff --git a/OpenRA.Mods.Common/UtilityCommands/Rgba2Hex.cs b/OpenRA.Mods.Common/UtilityCommands/Rgba2Hex.cs index 984b800c30..007cfafad8 100644 --- a/OpenRA.Mods.Common/UtilityCommands/Rgba2Hex.cs +++ b/OpenRA.Mods.Common/UtilityCommands/Rgba2Hex.cs @@ -13,7 +13,7 @@ using System; namespace OpenRA.Mods.Common.UtilityCommands { - class Rgba2Hex : IUtilityCommand + sealed class Rgba2Hex : IUtilityCommand { string IUtilityCommand.Name => "--rgba2hex"; @@ -101,7 +101,7 @@ namespace OpenRA.Mods.Common.UtilityCommands } } - class Argb2Hex : IUtilityCommand + sealed class Argb2Hex : IUtilityCommand { string IUtilityCommand.Name => "--argb2hex"; diff --git a/OpenRA.Mods.Common/UtilityCommands/UpdateMapCommand.cs b/OpenRA.Mods.Common/UtilityCommands/UpdateMapCommand.cs index a9ccbd9963..c6e1b70ef7 100644 --- a/OpenRA.Mods.Common/UtilityCommands/UpdateMapCommand.cs +++ b/OpenRA.Mods.Common/UtilityCommands/UpdateMapCommand.cs @@ -18,7 +18,7 @@ using OpenRA.Mods.Common.UpdateRules; namespace OpenRA.Mods.Common.UtilityCommands { - class UpdateMapCommand : IUtilityCommand + sealed class UpdateMapCommand : IUtilityCommand { string IUtilityCommand.Name => "--update-map"; diff --git a/OpenRA.Mods.Common/UtilityCommands/UpdateModCommand.cs b/OpenRA.Mods.Common/UtilityCommands/UpdateModCommand.cs index 71961c8d46..b589540ce5 100644 --- a/OpenRA.Mods.Common/UtilityCommands/UpdateModCommand.cs +++ b/OpenRA.Mods.Common/UtilityCommands/UpdateModCommand.cs @@ -20,7 +20,7 @@ namespace OpenRA.Mods.Common.UtilityCommands { using YamlFileSet = List<(IReadWritePackage, string, List)>; - class UpdateModCommand : IUtilityCommand + sealed class UpdateModCommand : IUtilityCommand { string IUtilityCommand.Name => "--update-mod"; diff --git a/OpenRA.Mods.Common/Widgets/Logic/Editor/ActorEditLogic.cs b/OpenRA.Mods.Common/Widgets/Logic/Editor/ActorEditLogic.cs index e50f5f8986..e1e10ba14f 100644 --- a/OpenRA.Mods.Common/Widgets/Logic/Editor/ActorEditLogic.cs +++ b/OpenRA.Mods.Common/Widgets/Logic/Editor/ActorEditLogic.cs @@ -461,7 +461,7 @@ namespace OpenRA.Mods.Common.Widgets.Logic bool ShouldDoOnSave { get; } } - class EditActorEditorAction : IEditorAction + sealed class EditActorEditorAction : IEditorAction { [TranslationReference("name", "id")] const string EditedActor = "notification-edited-actor"; @@ -502,7 +502,7 @@ namespace OpenRA.Mods.Common.Widgets.Logic } } - class EditActorPreview + sealed class EditActorPreview { readonly EditorActorPreview actor; readonly SetActorIdAction setActorIdAction; diff --git a/OpenRA.Mods.Common/Widgets/Logic/Editor/ActorSelectorLogic.cs b/OpenRA.Mods.Common/Widgets/Logic/Editor/ActorSelectorLogic.cs index b2db0a1c78..f89ace6fdc 100644 --- a/OpenRA.Mods.Common/Widgets/Logic/Editor/ActorSelectorLogic.cs +++ b/OpenRA.Mods.Common/Widgets/Logic/Editor/ActorSelectorLogic.cs @@ -24,7 +24,7 @@ namespace OpenRA.Mods.Common.Widgets.Logic [TranslationReference("actorType")] const string ActorTypeTooltip = "label-actor-type"; - class ActorSelectorActor + sealed class ActorSelectorActor { public readonly ActorInfo Actor; public readonly string[] Categories; diff --git a/OpenRA.Mods.Common/Widgets/Logic/Editor/SaveMapLogic.cs b/OpenRA.Mods.Common/Widgets/Logic/Editor/SaveMapLogic.cs index 6887a44e06..332da27413 100644 --- a/OpenRA.Mods.Common/Widgets/Logic/Editor/SaveMapLogic.cs +++ b/OpenRA.Mods.Common/Widgets/Logic/Editor/SaveMapLogic.cs @@ -29,7 +29,7 @@ namespace OpenRA.Mods.Common.Widgets.Logic public string UiLabel; } - class SaveDirectory + sealed class SaveDirectory { public readonly Folder Folder; public readonly string DisplayName; diff --git a/OpenRA.Mods.Common/Widgets/Logic/Editor/TileSelectorLogic.cs b/OpenRA.Mods.Common/Widgets/Logic/Editor/TileSelectorLogic.cs index 0458871e74..cd9d0ec4df 100644 --- a/OpenRA.Mods.Common/Widgets/Logic/Editor/TileSelectorLogic.cs +++ b/OpenRA.Mods.Common/Widgets/Logic/Editor/TileSelectorLogic.cs @@ -21,7 +21,7 @@ namespace OpenRA.Mods.Common.Widgets.Logic { public class TileSelectorLogic : CommonSelectorLogic { - class TileSelectorTemplate + sealed class TileSelectorTemplate { public readonly TerrainTemplateInfo Template; public readonly string[] Categories; diff --git a/OpenRA.Mods.Common/Widgets/Logic/Ingame/GameInfoBriefingLogic.cs b/OpenRA.Mods.Common/Widgets/Logic/Ingame/GameInfoBriefingLogic.cs index bcd2480649..d9bd48fa4c 100644 --- a/OpenRA.Mods.Common/Widgets/Logic/Ingame/GameInfoBriefingLogic.cs +++ b/OpenRA.Mods.Common/Widgets/Logic/Ingame/GameInfoBriefingLogic.cs @@ -14,7 +14,7 @@ using OpenRA.Widgets; namespace OpenRA.Mods.Common.Widgets.Logic { - class GameInfoBriefingLogic : ChromeLogic + sealed class GameInfoBriefingLogic : ChromeLogic { [ObjectCreator.UseCtor] public GameInfoBriefingLogic(Widget widget, ModData modData, World world) diff --git a/OpenRA.Mods.Common/Widgets/Logic/Ingame/GameInfoLogic.cs b/OpenRA.Mods.Common/Widgets/Logic/Ingame/GameInfoLogic.cs index c3f74ab617..06ed02257d 100644 --- a/OpenRA.Mods.Common/Widgets/Logic/Ingame/GameInfoLogic.cs +++ b/OpenRA.Mods.Common/Widgets/Logic/Ingame/GameInfoLogic.cs @@ -20,7 +20,7 @@ namespace OpenRA.Mods.Common.Widgets.Logic { public enum IngameInfoPanel { AutoSelect, Map, Objectives, Debug, Chat, LobbbyOptions } - class GameInfoLogic : ChromeLogic + sealed class GameInfoLogic : ChromeLogic { [TranslationReference] const string Objectives = "menu-game-info.objectives"; diff --git a/OpenRA.Mods.Common/Widgets/Logic/Ingame/GameInfoObjectivesLogic.cs b/OpenRA.Mods.Common/Widgets/Logic/Ingame/GameInfoObjectivesLogic.cs index 5aa224ef7b..9ea3a8c756 100644 --- a/OpenRA.Mods.Common/Widgets/Logic/Ingame/GameInfoObjectivesLogic.cs +++ b/OpenRA.Mods.Common/Widgets/Logic/Ingame/GameInfoObjectivesLogic.cs @@ -16,7 +16,7 @@ using OpenRA.Widgets; namespace OpenRA.Mods.Common.Widgets.Logic { - class GameInfoObjectivesLogic : ChromeLogic + sealed class GameInfoObjectivesLogic : ChromeLogic { [TranslationReference] const string InProgress = "label-mission-in-progress"; diff --git a/OpenRA.Mods.Common/Widgets/Logic/Ingame/GameInfoStatsLogic.cs b/OpenRA.Mods.Common/Widgets/Logic/Ingame/GameInfoStatsLogic.cs index 8c0aacffd6..760a2df564 100644 --- a/OpenRA.Mods.Common/Widgets/Logic/Ingame/GameInfoStatsLogic.cs +++ b/OpenRA.Mods.Common/Widgets/Logic/Ingame/GameInfoStatsLogic.cs @@ -20,7 +20,7 @@ using OpenRA.Widgets; namespace OpenRA.Mods.Common.Widgets.Logic { - class GameInfoStatsLogic : ChromeLogic + sealed class GameInfoStatsLogic : ChromeLogic { [TranslationReference] const string Unmute = "label-unmute-player"; diff --git a/OpenRA.Mods.Common/Widgets/Logic/Ingame/ObserverShroudSelectorLogic.cs b/OpenRA.Mods.Common/Widgets/Logic/Ingame/ObserverShroudSelectorLogic.cs index be5a102e55..688b3fc58c 100644 --- a/OpenRA.Mods.Common/Widgets/Logic/Ingame/ObserverShroudSelectorLogic.cs +++ b/OpenRA.Mods.Common/Widgets/Logic/Ingame/ObserverShroudSelectorLogic.cs @@ -53,7 +53,7 @@ namespace OpenRA.Mods.Common.Widgets.Logic CameraOption selected; readonly LabelWidget shroudLabel; - class CameraOption + sealed class CameraOption { public readonly Player Player; public readonly string Label; diff --git a/OpenRA.Mods.Common/Widgets/Logic/Ingame/ObserverStatsLogic.cs b/OpenRA.Mods.Common/Widgets/Logic/Ingame/ObserverStatsLogic.cs index b05994c9a8..77b9569ecc 100644 --- a/OpenRA.Mods.Common/Widgets/Logic/Ingame/ObserverStatsLogic.cs +++ b/OpenRA.Mods.Common/Widgets/Logic/Ingame/ObserverStatsLogic.cs @@ -595,7 +595,7 @@ namespace OpenRA.Mods.Common.Widgets.Logic // HACK The height of the templates and the scrollpanel needs to be kept in synch bool ShowScrollBar => players.Count() + (hasTeams ? teams.Count() : 0) > 10; - class StatsDropDownOption + sealed class StatsDropDownOption { public string Title; public Func IsSelected; diff --git a/OpenRA.Mods.Common/Widgets/Logic/Ingame/ScriptErrorLogic.cs b/OpenRA.Mods.Common/Widgets/Logic/Ingame/ScriptErrorLogic.cs index e853f6b623..c49ba780c6 100644 --- a/OpenRA.Mods.Common/Widgets/Logic/Ingame/ScriptErrorLogic.cs +++ b/OpenRA.Mods.Common/Widgets/Logic/Ingame/ScriptErrorLogic.cs @@ -14,7 +14,7 @@ using OpenRA.Widgets; namespace OpenRA.Mods.Common.Widgets.Logic { - class ScriptErrorLogic : ChromeLogic + sealed class ScriptErrorLogic : ChromeLogic { [ObjectCreator.UseCtor] public ScriptErrorLogic(Widget widget, World world) diff --git a/OpenRA.Mods.Common/Widgets/Logic/Lobby/KickClientLogic.cs b/OpenRA.Mods.Common/Widgets/Logic/Lobby/KickClientLogic.cs index 2515b5b4bd..dac7975d1e 100644 --- a/OpenRA.Mods.Common/Widgets/Logic/Lobby/KickClientLogic.cs +++ b/OpenRA.Mods.Common/Widgets/Logic/Lobby/KickClientLogic.cs @@ -14,7 +14,7 @@ using OpenRA.Widgets; namespace OpenRA.Mods.Common.Widgets.Logic { - class KickClientLogic : ChromeLogic + sealed class KickClientLogic : ChromeLogic { [TranslationReference("player")] const string KickClient = "dialog-kick-client.prompt"; diff --git a/OpenRA.Mods.Common/Widgets/Logic/Lobby/KickSpectatorsLogic.cs b/OpenRA.Mods.Common/Widgets/Logic/Lobby/KickSpectatorsLogic.cs index 18a8e31ea6..02cab7baa0 100644 --- a/OpenRA.Mods.Common/Widgets/Logic/Lobby/KickSpectatorsLogic.cs +++ b/OpenRA.Mods.Common/Widgets/Logic/Lobby/KickSpectatorsLogic.cs @@ -14,7 +14,7 @@ using OpenRA.Widgets; namespace OpenRA.Mods.Common.Widgets.Logic { - class KickSpectatorsLogic : ChromeLogic + sealed class KickSpectatorsLogic : ChromeLogic { [TranslationReference("count")] const string KickSpectators = "dialog-kick-spectators.prompt"; diff --git a/OpenRA.Mods.Common/Widgets/Logic/Lobby/LobbyLogic.cs b/OpenRA.Mods.Common/Widgets/Logic/Lobby/LobbyLogic.cs index 4715faf206..0f7fe2e67e 100644 --- a/OpenRA.Mods.Common/Widgets/Logic/Lobby/LobbyLogic.cs +++ b/OpenRA.Mods.Common/Widgets/Logic/Lobby/LobbyLogic.cs @@ -895,7 +895,7 @@ namespace OpenRA.Mods.Common.Widgets.Logic public string Side; } - class DropDownOption + sealed class DropDownOption { public string Title; public Func IsSelected = () => false; diff --git a/OpenRA.Mods.Common/Widgets/Logic/Lobby/LobbyUtils.cs b/OpenRA.Mods.Common/Widgets/Logic/Lobby/LobbyUtils.cs index 3a48d95835..965eae64ad 100644 --- a/OpenRA.Mods.Common/Widgets/Logic/Lobby/LobbyUtils.cs +++ b/OpenRA.Mods.Common/Widgets/Logic/Lobby/LobbyUtils.cs @@ -38,7 +38,7 @@ namespace OpenRA.Mods.Common.Widgets.Logic [TranslationReference] const string Slot = "options-lobby-slot.slot"; - class SlotDropDownOption + sealed class SlotDropDownOption { public readonly string Title; public readonly string Order; @@ -677,7 +677,7 @@ namespace OpenRA.Mods.Common.Widgets.Logic } } - class ShowPlayerActionDropDownOption + sealed class ShowPlayerActionDropDownOption { public Action Click { get; set; } public string Title; diff --git a/OpenRA.Mods.Common/Widgets/Logic/MainMenuLogic.cs b/OpenRA.Mods.Common/Widgets/Logic/MainMenuLogic.cs index 53661dd605..2c8ad800da 100644 --- a/OpenRA.Mods.Common/Widgets/Logic/MainMenuLogic.cs +++ b/OpenRA.Mods.Common/Widgets/Logic/MainMenuLogic.cs @@ -378,7 +378,7 @@ namespace OpenRA.Mods.Common.Widgets.Logic newsStatus.GetText = () => message; } - class NewsItem + sealed class NewsItem { public string Title; public string Author; diff --git a/OpenRA.Mods.Common/Widgets/Logic/MissionBrowserLogic.cs b/OpenRA.Mods.Common/Widgets/Logic/MissionBrowserLogic.cs index b291a4a7b1..54082e8d42 100644 --- a/OpenRA.Mods.Common/Widgets/Logic/MissionBrowserLogic.cs +++ b/OpenRA.Mods.Common/Widgets/Logic/MissionBrowserLogic.cs @@ -446,7 +446,7 @@ namespace OpenRA.Mods.Common.Widgets.Logic Game.CreateAndStartLocalServer(selectedMap.Uid, orders); } - class DropDownOption + sealed class DropDownOption { public string Title; public Func IsSelected; diff --git a/OpenRA.Mods.Common/Widgets/Logic/ReplayBrowserLogic.cs b/OpenRA.Mods.Common/Widgets/Logic/ReplayBrowserLogic.cs index f5ece9bd8c..8233ff8841 100644 --- a/OpenRA.Mods.Common/Widgets/Logic/ReplayBrowserLogic.cs +++ b/OpenRA.Mods.Common/Widgets/Logic/ReplayBrowserLogic.cs @@ -819,13 +819,13 @@ namespace OpenRA.Mods.Common.Widgets.Logic base.Dispose(disposing); } - class ReplayState + sealed class ReplayState { public bool Visible; public ScrollItemWidget Item; } - class Filter + sealed class Filter { public GameType Type; public DateType Date; diff --git a/OpenRA.Mods.Common/Widgets/ObserverArmyIconsWidget.cs b/OpenRA.Mods.Common/Widgets/ObserverArmyIconsWidget.cs index 5a7d991cde..a53c0aa3e4 100644 --- a/OpenRA.Mods.Common/Widgets/ObserverArmyIconsWidget.cs +++ b/OpenRA.Mods.Common/Widgets/ObserverArmyIconsWidget.cs @@ -201,7 +201,7 @@ namespace OpenRA.Mods.Common.Widgets TooltipUnit = null; } - class ArmyIcon + sealed class ArmyIcon { public Rectangle Bounds { get; set; } public ArmyUnit Unit { get; set; } diff --git a/OpenRA.Mods.D2k/Activities/SwallowActor.cs b/OpenRA.Mods.D2k/Activities/SwallowActor.cs index 5f083af7c3..57325f920b 100644 --- a/OpenRA.Mods.D2k/Activities/SwallowActor.cs +++ b/OpenRA.Mods.D2k/Activities/SwallowActor.cs @@ -23,7 +23,7 @@ namespace OpenRA.Mods.D2k.Activities { enum AttackState { Uninitialized, Burrowed, Attacking } - class SwallowActor : Activity + sealed class SwallowActor : Activity { const int NearEnough = 1; diff --git a/OpenRA.Mods.D2k/SpriteLoaders/R8Loader.cs b/OpenRA.Mods.D2k/SpriteLoaders/R8Loader.cs index 3e8c7d1cc9..5b31febf54 100644 --- a/OpenRA.Mods.D2k/SpriteLoaders/R8Loader.cs +++ b/OpenRA.Mods.D2k/SpriteLoaders/R8Loader.cs @@ -19,7 +19,7 @@ namespace OpenRA.Mods.D2k.SpriteLoaders { public class R8Loader : ISpriteLoader { - class R8Frame : ISpriteFrame + sealed class R8Frame : ISpriteFrame { public SpriteFrameType Type => SpriteFrameType.Indexed8; public Size Size { get; } diff --git a/OpenRA.Mods.D2k/Traits/AttackSwallow.cs b/OpenRA.Mods.D2k/Traits/AttackSwallow.cs index 5e840577f5..bada7256a5 100644 --- a/OpenRA.Mods.D2k/Traits/AttackSwallow.cs +++ b/OpenRA.Mods.D2k/Traits/AttackSwallow.cs @@ -21,7 +21,7 @@ using OpenRA.Traits; namespace OpenRA.Mods.D2k.Traits { [Desc("Sandworms use this attack model.")] - class AttackSwallowInfo : AttackFrontalInfo + sealed class AttackSwallowInfo : AttackFrontalInfo { [Desc("The number of ticks it takes to return underground.")] public readonly int ReturnDelay = 60; @@ -43,7 +43,7 @@ namespace OpenRA.Mods.D2k.Traits public override object Create(ActorInitializer init) { return new AttackSwallow(init.Self, this); } } - class AttackSwallow : AttackFrontal + sealed class AttackSwallow : AttackFrontal { public new readonly AttackSwallowInfo Info; @@ -77,7 +77,7 @@ namespace OpenRA.Mods.D2k.Traits return new SwallowTarget(self, newTarget, allowMove, forceAttack); } - public class SwallowTarget : Attack + public sealed class SwallowTarget : Attack { public SwallowTarget(Actor self, in Target target, bool allowMovement, bool forceAttack) : base(self, target, allowMovement, forceAttack) { } diff --git a/OpenRA.Mods.D2k/Traits/Buildings/D2kActorPreviewPlaceBuildingPreview.cs b/OpenRA.Mods.D2k/Traits/Buildings/D2kActorPreviewPlaceBuildingPreview.cs index 8eb8b12c48..bb4fb54f12 100644 --- a/OpenRA.Mods.D2k/Traits/Buildings/D2kActorPreviewPlaceBuildingPreview.cs +++ b/OpenRA.Mods.D2k/Traits/Buildings/D2kActorPreviewPlaceBuildingPreview.cs @@ -58,7 +58,7 @@ namespace OpenRA.Mods.D2k.Traits public class D2kActorPreviewPlaceBuildingPreview { } - class D2kActorPreviewPlaceBuildingPreviewPreview : ActorPreviewPlaceBuildingPreviewPreview + sealed class D2kActorPreviewPlaceBuildingPreviewPreview : ActorPreviewPlaceBuildingPreviewPreview { readonly D2kActorPreviewPlaceBuildingPreviewInfo info; readonly bool checkUnsafeTiles; diff --git a/OpenRA.Mods.D2k/Traits/Sandworm.cs b/OpenRA.Mods.D2k/Traits/Sandworm.cs index 1a927cce98..e43ae3316f 100644 --- a/OpenRA.Mods.D2k/Traits/Sandworm.cs +++ b/OpenRA.Mods.D2k/Traits/Sandworm.cs @@ -16,7 +16,7 @@ using OpenRA.Traits; namespace OpenRA.Mods.D2k.Traits { - class SandwormInfo : WandersInfo, Requires, Requires + sealed class SandwormInfo : WandersInfo, Requires, Requires { [Desc("Time between rescanning for targets (in ticks).")] public readonly int TargetRescanInterval = 125; @@ -33,7 +33,7 @@ namespace OpenRA.Mods.D2k.Traits public override object Create(ActorInitializer init) { return new Sandworm(init.Self, this); } } - class Sandworm : Wanders, ITick, INotifyActorDisposing + sealed class Sandworm : Wanders, ITick, INotifyActorDisposing { public readonly SandwormInfo WormInfo; diff --git a/OpenRA.Mods.D2k/Traits/World/D2kFogPalette.cs b/OpenRA.Mods.D2k/Traits/World/D2kFogPalette.cs index 2d7be2e319..f0f5591f07 100644 --- a/OpenRA.Mods.D2k/Traits/World/D2kFogPalette.cs +++ b/OpenRA.Mods.D2k/Traits/World/D2kFogPalette.cs @@ -17,7 +17,7 @@ using OpenRA.Traits; namespace OpenRA.Mods.D2k.Traits { [TraitLocation(SystemActors.World | SystemActors.EditorWorld)] - class D2kFogPaletteInfo : TraitInfo + sealed class D2kFogPaletteInfo : TraitInfo { [PaletteDefinition] [FieldLoader.Require] @@ -35,7 +35,7 @@ namespace OpenRA.Mods.D2k.Traits public override object Create(ActorInitializer init) { return new D2kFogPalette(this); } } - class D2kFogPalette : ILoadsPalettes, IProvidesAssetBrowserPalettes + sealed class D2kFogPalette : ILoadsPalettes, IProvidesAssetBrowserPalettes { readonly D2kFogPaletteInfo info; public D2kFogPalette(D2kFogPaletteInfo info) { this.info = info; } diff --git a/OpenRA.Mods.D2k/Traits/World/PaletteFromScaledPalette.cs b/OpenRA.Mods.D2k/Traits/World/PaletteFromScaledPalette.cs index 5570ccf6b1..e056c68827 100644 --- a/OpenRA.Mods.D2k/Traits/World/PaletteFromScaledPalette.cs +++ b/OpenRA.Mods.D2k/Traits/World/PaletteFromScaledPalette.cs @@ -19,7 +19,7 @@ namespace OpenRA.Mods.D2k.Traits { [TraitLocation(SystemActors.World | SystemActors.EditorWorld)] [Desc("Create a palette by applying a scale and offset to the colors in another palette.")] - class PaletteFromScaledPaletteInfo : TraitInfo + sealed class PaletteFromScaledPaletteInfo : TraitInfo { [PaletteDefinition] [FieldLoader.Require] @@ -43,7 +43,7 @@ namespace OpenRA.Mods.D2k.Traits public override object Create(ActorInitializer init) { return new PaletteFromScaledPalette(this); } } - class PaletteFromScaledPalette : ILoadsPalettes, IProvidesAssetBrowserPalettes + sealed class PaletteFromScaledPalette : ILoadsPalettes, IProvidesAssetBrowserPalettes { readonly PaletteFromScaledPaletteInfo info; public PaletteFromScaledPalette(PaletteFromScaledPaletteInfo info) { this.info = info; } @@ -57,7 +57,7 @@ namespace OpenRA.Mods.D2k.Traits public IEnumerable PaletteNames { get { yield return info.Name; } } } - class ScaledPaletteRemap : IPaletteRemap + sealed class ScaledPaletteRemap : IPaletteRemap { readonly float scale; readonly int offset; diff --git a/OpenRA.Mods.D2k/UtilityCommands/ImportD2kMapCommand.cs b/OpenRA.Mods.D2k/UtilityCommands/ImportD2kMapCommand.cs index 5f6a704990..d78cbe52cb 100644 --- a/OpenRA.Mods.D2k/UtilityCommands/ImportD2kMapCommand.cs +++ b/OpenRA.Mods.D2k/UtilityCommands/ImportD2kMapCommand.cs @@ -15,7 +15,7 @@ using OpenRA.FileSystem; namespace OpenRA.Mods.D2k.UtilityCommands { - class ImportD2kMapCommand : IUtilityCommand + sealed class ImportD2kMapCommand : IUtilityCommand { string IUtilityCommand.Name => "--import-d2k-map"; diff --git a/OpenRA.Platforms.Default/DummySoundEngine.cs b/OpenRA.Platforms.Default/DummySoundEngine.cs index 70b3c2499b..f3a9d0cb40 100644 --- a/OpenRA.Platforms.Default/DummySoundEngine.cs +++ b/OpenRA.Platforms.Default/DummySoundEngine.cs @@ -61,12 +61,12 @@ namespace OpenRA.Platforms.Default public void Dispose() { } } - class NullSoundSource : ISoundSource + sealed class NullSoundSource : ISoundSource { public void Dispose() { } } - class NullSound : ISound + sealed class NullSound : ISound { public float Volume { get; set; } public float SeekPosition => 0; diff --git a/OpenRA.Platforms.Default/MultiTapDetection.cs b/OpenRA.Platforms.Default/MultiTapDetection.cs index b3fa586fdb..c93bed3200 100644 --- a/OpenRA.Platforms.Default/MultiTapDetection.cs +++ b/OpenRA.Platforms.Default/MultiTapDetection.cs @@ -42,7 +42,7 @@ namespace OpenRA.Platforms.Default } } - class TapHistory + sealed class TapHistory { public (DateTime Time, int2 Location) FirstRelease, SecondRelease, ThirdRelease; diff --git a/OpenRA.Platforms.Default/OpenAlSoundEngine.cs b/OpenRA.Platforms.Default/OpenAlSoundEngine.cs index 18f2a079db..13c4db3649 100644 --- a/OpenRA.Platforms.Default/OpenAlSoundEngine.cs +++ b/OpenRA.Platforms.Default/OpenAlSoundEngine.cs @@ -36,7 +36,7 @@ namespace OpenRA.Platforms.Default return defaultDevices.Concat(physicalDevices).ToArray(); } - class PoolSlot + sealed class PoolSlot { public bool IsActive; public int FrameStarted; @@ -386,7 +386,7 @@ namespace OpenRA.Platforms.Default } } - class OpenAlSoundSource : ISoundSource + sealed class OpenAlSoundSource : ISoundSource { uint buffer; bool disposed; @@ -401,7 +401,7 @@ namespace OpenRA.Platforms.Default AL10.alBufferData(buffer, OpenAlSoundEngine.MakeALFormat(channels, sampleBits), data, byteCount, sampleRate); } - protected virtual void Dispose(bool disposing) + void Dispose(bool _) { if (!disposed) { @@ -538,7 +538,7 @@ namespace OpenRA.Platforms.Default } } - class OpenAlAsyncLoadSound : OpenAlSound + sealed class OpenAlAsyncLoadSound : OpenAlSound { static readonly byte[] SilentData = new byte[2]; readonly CancellationTokenSource cts = new(); diff --git a/OpenRA.Platforms.Default/Sdl2Input.cs b/OpenRA.Platforms.Default/Sdl2Input.cs index c0f11f04b8..ba555fbd67 100644 --- a/OpenRA.Platforms.Default/Sdl2Input.cs +++ b/OpenRA.Platforms.Default/Sdl2Input.cs @@ -16,7 +16,7 @@ using SDL2; namespace OpenRA.Platforms.Default { - class Sdl2Input + sealed class Sdl2Input { MouseButton lastButtonBits = MouseButton.None; diff --git a/OpenRA.Platforms.Default/Shader.cs b/OpenRA.Platforms.Default/Shader.cs index dced6d5775..fafd6e2a41 100644 --- a/OpenRA.Platforms.Default/Shader.cs +++ b/OpenRA.Platforms.Default/Shader.cs @@ -16,7 +16,7 @@ using System.Text; namespace OpenRA.Platforms.Default { - class Shader : ThreadAffine, IShader + sealed class Shader : ThreadAffine, IShader { public const int VertexPosAttributeIndex = 0; public const int TexCoordAttributeIndex = 1; @@ -29,7 +29,7 @@ namespace OpenRA.Platforms.Default readonly Queue unbindTextures = new(); readonly uint program; - protected static uint CompileShaderObject(int type, string name) + static uint CompileShaderObject(int type, string name) { var ext = type == OpenGL.GL_VERTEX_SHADER ? "vert" : "frag"; var filename = Path.Combine(Platform.EngineDir, "glsl", name + "." + ext); diff --git a/OpenRA.Platforms.Default/ThreadedGraphicsContext.cs b/OpenRA.Platforms.Default/ThreadedGraphicsContext.cs index 563515c4e4..0f90049c1c 100644 --- a/OpenRA.Platforms.Default/ThreadedGraphicsContext.cs +++ b/OpenRA.Platforms.Default/ThreadedGraphicsContext.cs @@ -155,7 +155,7 @@ namespace OpenRA.Platforms.Default verticesPool.Push(vertices); } - class Message + sealed class Message { public Message(ThreadedGraphicsContext device) { @@ -450,7 +450,7 @@ namespace OpenRA.Platforms.Default } } - class ThreadedFrameBuffer : IFrameBuffer + sealed class ThreadedFrameBuffer : IFrameBuffer { readonly ThreadedGraphicsContext device; readonly Func getTexture; @@ -500,7 +500,7 @@ namespace OpenRA.Platforms.Default } } - class ThreadedVertexBuffer : IVertexBuffer + sealed class ThreadedVertexBuffer : IVertexBuffer { readonly ThreadedGraphicsContext device; readonly Action bind; @@ -563,7 +563,7 @@ namespace OpenRA.Platforms.Default } } - class ThreadedTexture : ITextureInternal + sealed class ThreadedTexture : ITextureInternal { readonly ThreadedGraphicsContext device; readonly Func getScaleFilter; @@ -658,7 +658,7 @@ namespace OpenRA.Platforms.Default } } - class ThreadedShader : IShader + sealed class ThreadedShader : IShader { readonly ThreadedGraphicsContext device; readonly Action prepareRender; diff --git a/OpenRA.Server/Program.cs b/OpenRA.Server/Program.cs index 98d4115ce2..b8bee06f0b 100644 --- a/OpenRA.Server/Program.cs +++ b/OpenRA.Server/Program.cs @@ -19,7 +19,7 @@ using OpenRA.Support; namespace OpenRA.Server { - class Program + sealed class Program { static void Main(string[] args) { diff --git a/OpenRA.Test/OpenRA.Game/ActionQueueTest.cs b/OpenRA.Test/OpenRA.Game/ActionQueueTest.cs index c238e9324a..09c7e01cbc 100644 --- a/OpenRA.Test/OpenRA.Game/ActionQueueTest.cs +++ b/OpenRA.Test/OpenRA.Game/ActionQueueTest.cs @@ -17,7 +17,7 @@ using OpenRA.Primitives; namespace OpenRA.Test { [TestFixture] - class ActionQueueTest + sealed class ActionQueueTest { [TestCase(TestName = "ActionQueue performs actions in order of time, then insertion order.")] public void ActionsArePerformedOrderedByTimeThenByInsertionOrder() diff --git a/OpenRA.Test/OpenRA.Game/ActorInfoTest.cs b/OpenRA.Test/OpenRA.Game/ActorInfoTest.cs index c6e3a18021..a3c409c18e 100644 --- a/OpenRA.Test/OpenRA.Game/ActorInfoTest.cs +++ b/OpenRA.Test/OpenRA.Game/ActorInfoTest.cs @@ -19,21 +19,21 @@ namespace OpenRA.Test class MockTraitInfo : TraitInfo { public override object Create(ActorInitializer init) { return null; } } class MockInheritInfo : MockTraitInfo { } - class MockAInfo : MockInheritInfo, IMock { } - class MockBInfo : MockTraitInfo, Requires, Requires { } - class MockCInfo : MockTraitInfo, Requires { } + sealed class MockAInfo : MockInheritInfo, IMock { } + sealed class MockBInfo : MockTraitInfo, Requires, Requires { } + sealed class MockCInfo : MockTraitInfo, Requires { } - class MockDInfo : MockTraitInfo, Requires { } - class MockEInfo : MockTraitInfo, Requires { } - class MockFInfo : MockTraitInfo, Requires { } + sealed class MockDInfo : MockTraitInfo, Requires { } + sealed class MockEInfo : MockTraitInfo, Requires { } + sealed class MockFInfo : MockTraitInfo, Requires { } - class MockGInfo : MockInheritInfo, IMock, NotBefore { } - class MockHInfo : MockTraitInfo, NotBefore, NotBefore, NotBefore { } - class MockIInfo : MockTraitInfo, NotBefore, NotBefore { } + sealed class MockGInfo : MockInheritInfo, IMock, NotBefore { } + sealed class MockHInfo : MockTraitInfo, NotBefore, NotBefore, NotBefore { } + sealed class MockIInfo : MockTraitInfo, NotBefore, NotBefore { } - class MockJInfo : MockTraitInfo, NotBefore { } - class MockKInfo : MockTraitInfo, NotBefore { } - class MockLInfo : MockTraitInfo, NotBefore { } + sealed class MockJInfo : MockTraitInfo, NotBefore { } + sealed class MockKInfo : MockTraitInfo, NotBefore { } + sealed class MockLInfo : MockTraitInfo, NotBefore { } [TestFixture] public class ActorInfoTest diff --git a/OpenRA.Test/OpenRA.Game/PriorityQueueTest.cs b/OpenRA.Test/OpenRA.Game/PriorityQueueTest.cs index 7cbfa78409..e28fc536f1 100644 --- a/OpenRA.Test/OpenRA.Game/PriorityQueueTest.cs +++ b/OpenRA.Test/OpenRA.Game/PriorityQueueTest.cs @@ -19,7 +19,7 @@ using OpenRA.Support; namespace OpenRA.Test { [TestFixture] - class PriorityQueueTest + sealed class PriorityQueueTest { readonly struct Int32Comparer : IComparer { diff --git a/OpenRA.Test/OpenRA.Game/SpatiallyPartitionedTest.cs b/OpenRA.Test/OpenRA.Game/SpatiallyPartitionedTest.cs index 999959e373..4542f3e8cf 100644 --- a/OpenRA.Test/OpenRA.Game/SpatiallyPartitionedTest.cs +++ b/OpenRA.Test/OpenRA.Game/SpatiallyPartitionedTest.cs @@ -15,7 +15,7 @@ using OpenRA.Primitives; namespace OpenRA.Test { [TestFixture] - class SpatiallyPartitionedTest + sealed class SpatiallyPartitionedTest { [TestCase(TestName = "SpatiallyPartitioned.At works")] public void SpatiallyPartitionedAtTest() diff --git a/OpenRA.Test/OpenRA.Game/StreamExtsTests.cs b/OpenRA.Test/OpenRA.Game/StreamExtsTests.cs index ba51e8b9b0..dfb424aaa9 100644 --- a/OpenRA.Test/OpenRA.Game/StreamExtsTests.cs +++ b/OpenRA.Test/OpenRA.Game/StreamExtsTests.cs @@ -17,7 +17,7 @@ using NUnit.Framework; namespace OpenRA.Test { [TestFixture] - class StreamExtsTests + sealed class StreamExtsTests { [TestCase(TestName = "ReadAllLines is equivalent to ReadAllLinesAsMemory")] public void ReadAllLines() diff --git a/OpenRA.Utility/Program.cs b/OpenRA.Utility/Program.cs index 57004bfa1f..588ee941af 100644 --- a/OpenRA.Utility/Program.cs +++ b/OpenRA.Utility/Program.cs @@ -36,7 +36,7 @@ namespace OpenRA } } - class Program + sealed class Program { static void Main(string[] args) { diff --git a/OpenRA.WindowsLauncher/Program.cs b/OpenRA.WindowsLauncher/Program.cs index 56a73c5072..db09a75849 100644 --- a/OpenRA.WindowsLauncher/Program.cs +++ b/OpenRA.WindowsLauncher/Program.cs @@ -21,7 +21,7 @@ using SDL2; namespace OpenRA.WindowsLauncher { - class WindowsLauncher + sealed class WindowsLauncher { [DllImport("user32.dll")] static extern bool SetForegroundWindow(IntPtr hWnd);