Fix CA1852

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

View File

@@ -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;

View File

@@ -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;

View File

@@ -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;

View File

@@ -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;

View File

@@ -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;

View File

@@ -14,7 +14,7 @@ using OpenRA.Traits;
namespace OpenRA.Mods.Common.Activities
{
class InstantRepair : Enter
sealed class InstantRepair : Enter
{
readonly InstantlyRepairsInfo info;

View File

@@ -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)

View File

@@ -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;

View File

@@ -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;

View File

@@ -15,7 +15,7 @@ using OpenRA.Traits;
namespace OpenRA.Mods.Common.Activities
{
class RideTransport : Enter
sealed class RideTransport : Enter
{
readonly Passenger passenger;

View File

@@ -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;

View File

@@ -162,7 +162,7 @@ namespace OpenRA.Mods.Common.Activities
}
}
class IssueOrderAfterTransform : Activity
sealed class IssueOrderAfterTransform : Activity
{
readonly string orderString;
readonly Target target;

View File

@@ -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)
{

View File

@@ -77,7 +77,7 @@ namespace OpenRA.Mods.Common.Widgets
}
}
class AddActorAction : IEditorAction
sealed class AddActorAction : IEditorAction
{
public string Text { get; private set; }

View File

@@ -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; }

View File

@@ -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";

View File

@@ -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";

View File

@@ -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; }

View File

@@ -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;

View File

@@ -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

View File

@@ -242,7 +242,7 @@ namespace OpenRA.Mods.Common.FileFormats
}
}
class CabExtracter
sealed class CabExtracter
{
readonly FileDescriptor file;
readonly Dictionary<int, Stream> volumes;

View File

@@ -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;

View File

@@ -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;

View File

@@ -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;

View File

@@ -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<string> emitError, Action<string> emitWarning, ModData modData, Ruleset rules)
{

View File

@@ -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<string> emitError, Action<string> emitWarning, ModData modData)
{

View File

@@ -15,7 +15,7 @@ using OpenRA.Widgets;
namespace OpenRA.Mods.Common.Lint
{
class CheckChromeLogic : ILintPass
sealed class CheckChromeLogic : ILintPass
{
public void Run(Action<string> emitError, Action<string> emitWarning, ModData modData)
{

View File

@@ -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<string> emitError, Action<string> emitWarning, ModData modData, Ruleset rules)
{

View File

@@ -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<string> emitError, Action<string> emitWarning, ModData modData, Ruleset rules)
{

View File

@@ -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<string> emitError, Action<string> emitWarning, ModData modData, Ruleset rules)
{

View File

@@ -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<string> emitError, Action<string> emitWarning, ModData modData, Ruleset rules)
{

View File

@@ -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<string> emitError, Action<string> emitWarning, ModData modData, Ruleset rules)
{

View File

@@ -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<string> emitError, Action<string> emitWarning, ModData modData, Ruleset rules)
{

View File

@@ -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<string> emitError, Action<string> emitWarning, ModData modData, Ruleset rules)
{

View File

@@ -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<string> emitError, Action<string> emitWarning, ModData modData, Ruleset rules)
{

View File

@@ -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<string> emitError, Action<string> emitWarning, ModData modData, MapPreview map, Ruleset mapRules)
{

View File

@@ -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<string> emitError, Action<string> emitWarning, ModData modData, Ruleset rules)
{

View File

@@ -16,7 +16,7 @@ using System.Reflection;
namespace OpenRA.Mods.Common.Lint
{
class CheckSyncAnnotations : ILintPass
sealed class CheckSyncAnnotations : ILintPass
{
public void Run(Action<string> emitError, Action<string> emitWarning, ModData modData)
{

View File

@@ -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<string> emitError, Action<string> emitWarning, ModData modData, Ruleset rules)
{

View File

@@ -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;

View File

@@ -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<string> emitError, Action<string> emitWarning, ModData modData, Map map)
{

View File

@@ -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<string> emitError, Action<string> emitWarning, ModData modData)
{

View File

@@ -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<string> emitError, Action<string> emitWarning, ModData modData)
{

View File

@@ -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<string> emitError, Action<string> emitWarning, ModData modData, Ruleset rules)
{

View File

@@ -42,7 +42,7 @@ namespace OpenRA.Mods.Common.Orders
{
readonly string worldDefaultCursor = ChromeMetrics.Get<string>("WorldDefaultCursor");
class VariantWrapper
sealed class VariantWrapper
{
public readonly ActorInfo ActorInfo;
public readonly BuildingInfo BuildingInfo;

View File

@@ -193,7 +193,7 @@ namespace OpenRA.Mods.Common.Orders
return order;
}
class UnitOrderResult
sealed class UnitOrderResult
{
public readonly Actor Actor;
public readonly IOrderTargeter Order;

View File

@@ -55,7 +55,7 @@ namespace OpenRA.Mods.Common.Pathfinder
pool.Push(layer);
}
public class PooledCellInfoLayer : IDisposable
public sealed class PooledCellInfoLayer : IDisposable
{
CellInfoLayerPool layerPool;
List<CellLayer<CellInfo>> layers = new();

View File

@@ -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; }

View File

@@ -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; }

View File

@@ -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; }

View File

@@ -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;

View File

@@ -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; }
}
}
}

View File

@@ -226,7 +226,7 @@ namespace OpenRA.Mods.Common.Traits
}
}
class AttackActivity : Activity, IActivityNotifyStanceChanged
sealed class AttackActivity : Activity, IActivityNotifyStanceChanged
{
readonly AttackFollow attack;
readonly RevealsShroud[] revealsShroud;

View File

@@ -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<IMoveInfo>
sealed class AttackMoveInfo : TraitInfo, Requires<IMoveInfo>
{
[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;

View File

@@ -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<AttackMoveInfo>
sealed class AttackWanderInfo : WandersInfo, Requires<AttackMoveInfo>
{
public override object Create(ActorInitializer init) { return new AttackWander(init.Self, this); }
}
class AttackWander : Wanders
sealed class AttackWander : Wanders
{
readonly AttackMove attackMove;

View File

@@ -102,7 +102,7 @@ namespace OpenRA.Mods.Common.Traits
}
}
class FerryUnit : Activity
sealed class FerryUnit : Activity
{
readonly Actor cargo;
readonly Carryable carryable;

View File

@@ -16,7 +16,7 @@ using OpenRA.Traits;
namespace OpenRA.Mods.Common.Traits
{
class AutoCrusherInfo : PausableConditionalTraitInfo, Requires<IMoveInfo>
sealed class AutoCrusherInfo : PausableConditionalTraitInfo, Requires<IMoveInfo>
{
[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<AutoCrusherInfo>, INotifyIdle
sealed class AutoCrusher : PausableConditionalTrait<AutoCrusherInfo>, 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<IMove>();
move = self.Trait<IMove>();
moveInfo = self.Info.TraitInfo<IMoveInfo>();
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);
}

View File

@@ -16,7 +16,7 @@ using OpenRA.Traits;
namespace OpenRA.Mods.Common.Traits
{
class BaseBuilderQueueManager
sealed class BaseBuilderQueueManager
{
readonly string category;

View File

@@ -38,7 +38,7 @@ namespace OpenRA.Mods.Common.Traits
public class HarvesterBotModule : ConditionalTrait<HarvesterBotModuleInfo>, IBotTick
{
class HarvesterTraitWrapper
sealed class HarvesterTraitWrapper
{
public readonly Actor Actor;
public readonly Harvester Harvester;

View File

@@ -11,7 +11,7 @@
namespace OpenRA.Mods.Common.Traits.BotModules.Squads
{
class StateMachine
sealed class StateMachine
{
IState currentState;
IState previousState;

View File

@@ -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) { }

View File

@@ -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) { }

View File

@@ -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) { }

View File

@@ -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) { }

View File

@@ -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;

View File

@@ -23,7 +23,7 @@ namespace OpenRA.Mods.Common.Traits
public class BuildingInfluence
{
class InfluenceNode
sealed class InfluenceNode
{
public InfluenceNode Next;
public Actor Actor;

View File

@@ -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<BuildingInfo>, Requires<IHealthInfo>
sealed class GroundLevelBridgeInfo : TraitInfo, IRulesetLoaded, Requires<BuildingInfo>, Requires<IHealthInfo>
{
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;

View File

@@ -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) { }

View File

@@ -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<Actor> 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)
{

View File

@@ -17,7 +17,7 @@ using OpenRA.Traits;
namespace OpenRA.Mods.Common.Traits
{
[Desc("Reserve landing places for aircraft.")]
class ReservableInfo : TraitInfo<Reservable> { }
sealed class ReservableInfo : TraitInfo<Reservable> { }
public class Reservable : ITick, INotifyOwnerChanged, INotifySold, INotifyActorDisposing, INotifyCreated
{

View File

@@ -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;

View File

@@ -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)
{

View File

@@ -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)
{

View File

@@ -17,14 +17,14 @@ using OpenRA.Traits;
namespace OpenRA.Mods.Common.Traits
{
[Desc("Visualize capture progress.")]
class CapturableProgressBarInfo : ConditionalTraitInfo, Requires<CapturableInfo>
sealed class CapturableProgressBarInfo : ConditionalTraitInfo, Requires<CapturableInfo>
{
public readonly Color Color = Color.Orange;
public override object Create(ActorInitializer init) { return new CapturableProgressBar(this); }
}
class CapturableProgressBar : ConditionalTrait<CapturableProgressBarInfo>, ISelectionBar, ICaptureProgressWatcher
sealed class CapturableProgressBar : ConditionalTrait<CapturableProgressBarInfo>, ISelectionBar, ICaptureProgressWatcher
{
readonly Dictionary<Actor, (int Current, int Total)> progress = new();

View File

@@ -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<CapturableInfo>
sealed class CapturableProgressBlinkInfo : ConditionalTraitInfo, Requires<CapturableInfo>
{
[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<CapturableProgressBlinkInfo>, ITick, ICaptureProgressWatcher
sealed class CapturableProgressBlink : ConditionalTrait<CapturableProgressBlinkInfo>, ITick, ICaptureProgressWatcher
{
readonly List<Player> captorOwners = new();
readonly HashSet<Actor> captors = new();

View File

@@ -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<CapturesInfo>
sealed class CaptureProgressBarInfo : ConditionalTraitInfo, Requires<CapturesInfo>
{
public readonly Color Color = Color.Orange;
public override object Create(ActorInitializer init) { return new CaptureProgressBar(this); }
}
class CaptureProgressBar : ConditionalTrait<CaptureProgressBarInfo>, ISelectionBar, ICaptureProgressWatcher
sealed class CaptureProgressBar : ConditionalTrait<CaptureProgressBarInfo>, ISelectionBar, ICaptureProgressWatcher
{
int current;
int total;

View File

@@ -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;

View File

@@ -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<Actor> actorsAt, CPos xy, TargetModifiers modifiers) { return true; }
public CarryallDeliverUnitTargeter(AircraftInfo aircraftInfo, CarryallInfo info)

View File

@@ -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<IHealthInfo>
sealed class ChangesHealthInfo : ConditionalTraitInfo, Requires<IHealthInfo>
{
[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<ChangesHealthInfo>, ITick, INotifyDamage, ISync
sealed class ChangesHealth : ConditionalTrait<ChangesHealthInfo>, ITick, INotifyDamage, ISync
{
readonly IHealth health;

View File

@@ -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<ImmobileInfo>
sealed class ChangesTerrainInfo : TraitInfo, Requires<ImmobileInfo>
{
[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;

View File

@@ -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<GrantConditionInfo>
sealed class GrantCondition : ConditionalTrait<GrantConditionInfo>
{
int conditionToken = Actor.InvalidConditionToken;

View File

@@ -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<GrantConditionOnFactionInfo>, INotifyOwnerChanged
sealed class GrantConditionOnFaction : ConditionalTrait<GrantConditionOnFactionInfo>, INotifyOwnerChanged
{
int conditionToken = Actor.InvalidConditionToken;
string faction;

View File

@@ -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;

View File

@@ -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;

View File

@@ -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)

View File

@@ -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)

View File

@@ -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<TargetableType> 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;

View File

@@ -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;

View File

@@ -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;

View File

@@ -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;

View File

@@ -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)

View File

@@ -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<CrushableInfo>, ICrushable, INotifyCrushed
sealed class Crushable : ConditionalTrait<CrushableInfo>, ICrushable, INotifyCrushed
{
readonly Actor self;

View File

@@ -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) { }

View File

@@ -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<GainsExperienceInfo>
sealed class DeliversExperienceInfo : TraitInfo, Requires<GainsExperienceInfo>
{
[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) { }

View File

@@ -30,7 +30,7 @@ namespace OpenRA.Mods.Common.Traits
public class Demolishable : ConditionalTrait<DemolishableInfo>, IDemolishable, ITick, INotifyOwnerChanged
{
class DemolishAction
sealed class DemolishAction
{
public readonly Actor Saboteur;
public readonly int Token;

View File

@@ -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<DemolitionInfo>, IIssueOrder, IResolveOrder, IOrderVoice
sealed class Demolition : ConditionalTrait<DemolitionInfo>, 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;

View File

@@ -150,7 +150,7 @@ namespace OpenRA.Mods.Common.Traits
}
}
class ExperienceInit : ValueActorInit<int>
sealed class ExperienceInit : ValueActorInit<int>
{
public ExperienceInit(TraitInfo info, int value)
: base(info, value) { }

View File

@@ -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<GivesBountyInfo>, INotifyKilled, INotifyPassengerEntered, INotifyPassengerExited
sealed class GivesBounty : ConditionalTrait<GivesBountyInfo>, INotifyKilled, INotifyPassengerEntered, INotifyPassengerExited
{
readonly Dictionary<Actor, GivesBounty[]> passengerBounties = new();

View File

@@ -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;

View File

@@ -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<Actor> actorsAt, CPos xy, TargetModifiers modifiers) { return true; }
public bool CanTarget(Actor self, in Target target, ref TargetModifiers modifiers, ref string cursor)

Some files were not shown because too many files have changed in this diff Show More