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

@@ -81,7 +81,7 @@ namespace OpenRA
/// <summary>Value used to represent an invalid token.</summary>
public static readonly int InvalidConditionToken = -1;
class ConditionState
sealed class ConditionState
{
/// <summary>Delegates that have registered to be notified when this condition changes.</summary>
public readonly List<VariableObserverNotifier> Notifiers = new();

View File

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

View File

@@ -17,7 +17,7 @@ namespace OpenRA.Graphics
{
public sealed class CursorManager
{
class Cursor
sealed class Cursor
{
public string Name;
public int2 PaddedSize;

View File

@@ -62,7 +62,7 @@ namespace OpenRA.Graphics
{
public Action<string> OnMissingModelError { get; set; }
class PlaceholderModelCache : IModelCache
sealed class PlaceholderModelCache : IModelCache
{
public IVertexBuffer<Vertex> VertexBuffer => throw new NotImplementedException();

View File

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

View File

@@ -427,7 +427,7 @@ namespace OpenRA.Graphics
}
}
class GlyphInfo
sealed class GlyphInfo
{
public float Advance;
public int2 Offset;

View File

@@ -65,7 +65,7 @@ namespace OpenRA
MissionSelector = 4
}
class MapField
sealed class MapField
{
enum Type { Normal, NodeList, MiniYaml }
readonly FieldInfo field;

View File

@@ -64,7 +64,7 @@ namespace OpenRA
public class MapPreview : IDisposable, IReadOnlyFileSystem
{
/// <summary>Wrapper that enables map data to be replaced in an atomic fashion.</summary>
class InnerData
sealed class InnerData
{
public int MapFormat;
public string Title;

View File

@@ -21,7 +21,7 @@ namespace OpenRA.Network
{
public class GeoIP
{
class IP2LocationReader
sealed class IP2LocationReader
{
public readonly DateTime Date;
readonly Stream stream;

View File

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

View File

@@ -19,7 +19,7 @@ using OpenRA.Primitives;
namespace OpenRA.Network
{
class SyncReport
sealed class SyncReport
{
const int NumSyncReports = 7;
static readonly Cache<Type, TypeInfo> 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;

View File

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

View File

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

View File

@@ -97,7 +97,7 @@ namespace OpenRA.Support
}
}
class ManagedLoadContext : AssemblyLoadContext
sealed class ManagedLoadContext : AssemblyLoadContext
{
readonly string basePath;
readonly Dictionary<string, ManagedLibrary> managedAssemblies;

View File

@@ -14,7 +14,7 @@ using System.Globalization;
namespace OpenRA.Support
{
class Benchmark
sealed class Benchmark
{
readonly string prefix;
readonly Dictionary<string, List<BenchmarkPoint>> 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; }

View File

@@ -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<Expression> expressions = new();
readonly List<ExpressionType> types = new();
@@ -772,7 +772,7 @@ namespace OpenRA.Support
}
}
class Compiler
sealed class Compiler
{
readonly AstStack ast = new();

View File

@@ -39,7 +39,7 @@ namespace OpenRA
/// <summary>
/// Provides efficient ways to query a set of actors by their traits.
/// </summary>
class TraitDictionary
sealed class TraitDictionary
{
static readonly Func<Type, ITraitContainer> CreateTraitContainer = t =>
(ITraitContainer)typeof(TraitContainer<>).MakeGenericType(t).GetConstructor(Type.EmptyTypes).Invoke(null);
@@ -141,7 +141,7 @@ namespace OpenRA
int Queries { get; }
}
class TraitContainer<T> : ITraitContainer
sealed class TraitContainer<T> : ITraitContainer
{
readonly List<Actor> actors = new();
readonly List<T> traits = new();
@@ -185,7 +185,7 @@ namespace OpenRA
return new MultipleEnumerable(this, actor);
}
class MultipleEnumerable : IEnumerable<T>
sealed class MultipleEnumerable : IEnumerable<T>
{
readonly TraitContainer<T> container;
readonly uint actor;

View File

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

View File

@@ -13,7 +13,7 @@ using System.Linq;
namespace OpenRA.UtilityCommands
{
class ClearInvalidModRegistrationsCommand : IUtilityCommand
sealed class ClearInvalidModRegistrationsCommand : IUtilityCommand
{
string IUtilityCommand.Name => "--clear-invalid-mod-registrations";

View File

@@ -13,7 +13,7 @@ using System.Linq;
namespace OpenRA.UtilityCommands
{
class RegisterModCommand : IUtilityCommand
sealed class RegisterModCommand : IUtilityCommand
{
string IUtilityCommand.Name => "--register-mod";

View File

@@ -13,7 +13,7 @@ using System.Linq;
namespace OpenRA.UtilityCommands
{
class UnregisterModCommand : IUtilityCommand
sealed class UnregisterModCommand : IUtilityCommand
{
string IUtilityCommand.Name => "--unregister-mod";