Fix CA1822

This commit is contained in:
RoosterDragon
2023-03-12 16:24:19 +00:00
committed by Pavel Penev
parent e4cac1fffc
commit 277699cbd5
77 changed files with 109 additions and 105 deletions

View File

@@ -257,7 +257,7 @@ namespace OpenRA
}
}
IEnumerable<string> GetSupportDirs(ModRegistration registration)
static IEnumerable<string> GetSupportDirs(ModRegistration registration)
{
var sources = new HashSet<string>(4);
if (registration.HasFlag(ModRegistration.System))

View File

@@ -271,7 +271,7 @@ namespace OpenRA.FileFormats
throw new InvalidDataException("Unknown pixel format");
}
void WritePngChunk(Stream output, string type, Stream input)
static void WritePngChunk(Stream output, string type, Stream input)
{
input.Position = 0;

View File

@@ -302,7 +302,7 @@ namespace OpenRA.Graphics
return fbo;
}
void DisableFrameBuffer(IFrameBuffer fbo)
static void DisableFrameBuffer(IFrameBuffer fbo)
{
Game.Renderer.Flush();
Game.Renderer.Context.DisableDepthBuffer();

View File

@@ -80,7 +80,7 @@ namespace OpenRA.Graphics
/// Will behave badly if the lines are parallel.
/// Z position is the average of a and b (ignores actual intersection point if it exists).
/// </summary>
float3 IntersectionOf(in float3 a, in float3 da, in float3 b, in float3 db)
static float3 IntersectionOf(in float3 a, in float3 da, in float3 b, in float3 db)
{
var crossA = a.X * (a.Y + da.Y) - a.Y * (a.X + da.X);
var crossB = b.X * (b.Y + db.Y) - b.Y * (b.X + db.X);

View File

@@ -123,7 +123,7 @@ namespace OpenRA.Graphics
}
}
float2 Rotate(float2 v, float sina, float cosa, float2 offset)
static float2 Rotate(float2 v, float sina, float cosa, float2 offset)
{
return new float2(
v.X * cosa - v.Y * sina + offset.X,

View File

@@ -114,7 +114,7 @@ namespace OpenRA.Graphics
return new int2(sheetIndex, secondarySheetIndex);
}
float ResolveTextureIndex(Sprite s, PaletteReference pal)
static float ResolveTextureIndex(Sprite s, PaletteReference pal)
{
if (pal == null)
return 0;

View File

@@ -172,7 +172,7 @@ namespace OpenRA.Graphics
UpdateViewportZooms();
}
float CalculateMinimumZoom(float minHeight, float maxHeight)
static float CalculateMinimumZoom(float minHeight, float maxHeight)
{
var h = Game.Renderer.NativeResolution.Height;

View File

@@ -54,7 +54,7 @@ namespace OpenRA
return mods;
}
Manifest LoadMod(string id, string path)
static Manifest LoadMod(string id, string path)
{
IReadOnlyPackage package = null;
try
@@ -79,7 +79,7 @@ namespace OpenRA
return null;
}
Dictionary<string, Manifest> GetInstalledMods(IEnumerable<string> searchPaths, IEnumerable<string> explicitPaths)
static Dictionary<string, Manifest> GetInstalledMods(IEnumerable<string> searchPaths, IEnumerable<string> explicitPaths)
{
var ret = new Dictionary<string, Manifest>();
var candidates = GetCandidateMods(searchPaths)

View File

@@ -49,7 +49,7 @@ namespace OpenRA
assemblies = assemblyList.SelectMany(asm => asm.GetNamespaces().Select(ns => (asm, ns))).ToArray();
}
void LoadAssembly(List<Assembly> assemblyList, string resolvedPath)
static void LoadAssembly(List<Assembly> assemblyList, string resolvedPath)
{
// .NET doesn't provide any way of querying the metadata of an assembly without either:
// (a) loading duplicate data into the application domain, breaking the world.

View File

@@ -30,7 +30,7 @@ namespace OpenRA.Primitives
itemBoundsBins = Exts.MakeArray(rows * cols, _ => new Dictionary<T, Rectangle>());
}
void ValidateBounds(T actor, Rectangle bounds)
static void ValidateBounds(T actor, Rectangle bounds)
{
if (bounds.Width == 0 || bounds.Height == 0)
throw new ArgumentException($"Bounds of actor {actor} are empty.", nameof(bounds));

View File

@@ -112,7 +112,7 @@ namespace OpenRA.Server
}
}
long Median(long[] a)
static long Median(long[] a)
{
Array.Sort(a);
var n = a.Length;

View File

@@ -702,7 +702,7 @@ namespace OpenRA.Server
}
}
byte[] CreateFrame(int client, int frame, byte[] data)
static byte[] CreateFrame(int client, int frame, byte[] data)
{
var ms = new MemoryStream(data.Length + 12);
ms.WriteArray(BitConverter.GetBytes(data.Length + 4));
@@ -712,7 +712,7 @@ namespace OpenRA.Server
return ms.GetBuffer();
}
byte[] CreateAckFrame(int frame, byte count)
static byte[] CreateAckFrame(int frame, byte count)
{
var ms = new MemoryStream(14);
ms.WriteArray(BitConverter.GetBytes(6));
@@ -723,7 +723,7 @@ namespace OpenRA.Server
return ms.GetBuffer();
}
byte[] CreateTickScaleFrame(float scale)
static byte[] CreateTickScaleFrame(float scale)
{
var ms = new MemoryStream(17);
ms.WriteArray(BitConverter.GetBytes(9));

View File

@@ -278,7 +278,7 @@ namespace OpenRA.Traits
frozenActorsById.Remove(fa.ID);
}
Rectangle FootprintBounds(FrozenActor fa)
static Rectangle FootprintBounds(FrozenActor fa)
{
var p1 = fa.Footprint[0];
var minU = p1.U;