diff --git a/.editorconfig b/.editorconfig index 5e6d3f6649..09d93dcfed 100644 --- a/.editorconfig +++ b/.editorconfig @@ -63,7 +63,7 @@ dotnet_diagnostic.IDE0044.severity = warning # IDE0062 Make local function static #csharp_prefer_static_local_function = true -dotnet_diagnostic.IDE0062.severity = silent # Requires C# 8 - TODO Consider enabling +dotnet_diagnostic.IDE0062.severity = warning # IDE0064 Make struct fields writable # No options diff --git a/OpenRA.Game/GameRules/ActorInfo.cs b/OpenRA.Game/GameRules/ActorInfo.cs index bd3c379e21..41d34fb36f 100644 --- a/OpenRA.Game/GameRules/ActorInfo.cs +++ b/OpenRA.Game/GameRules/ActorInfo.cs @@ -118,7 +118,7 @@ namespace OpenRA var unresolved = source.ToHashSet(); unresolved.ExceptWith(resolved); - bool AreResolvable(Type a, Type b) => a.IsAssignableFrom(b); + static bool AreResolvable(Type a, Type b) => a.IsAssignableFrom(b); // This query detects which unresolved traits can be immediately resolved as all their direct dependencies are met. var more = unresolved.Where(u => diff --git a/OpenRA.Mods.Cnc/Traits/World/TSShroudPalette.cs b/OpenRA.Mods.Cnc/Traits/World/TSShroudPalette.cs index 0c3592479b..fd399a71f3 100644 --- a/OpenRA.Mods.Cnc/Traits/World/TSShroudPalette.cs +++ b/OpenRA.Mods.Cnc/Traits/World/TSShroudPalette.cs @@ -37,7 +37,7 @@ namespace OpenRA.Mods.Cnc.Traits public void LoadPalettes(WorldRenderer wr) { - uint MakeColor(int i) + static uint MakeColor(int i) { if (i < 128) return (uint)(int2.Lerp(255, 0, i, 127) << 24); diff --git a/OpenRA.Mods.Common/Pathfinder/HierarchicalPathFinder.cs b/OpenRA.Mods.Common/Pathfinder/HierarchicalPathFinder.cs index 416d54d7ea..d794f674a9 100644 --- a/OpenRA.Mods.Common/Pathfinder/HierarchicalPathFinder.cs +++ b/OpenRA.Mods.Common/Pathfinder/HierarchicalPathFinder.cs @@ -307,7 +307,7 @@ namespace OpenRA.Mods.Common.Pathfinder /// void BuildGrids() { - Grid GetCPosBounds(Map map) + static Grid GetCPosBounds(Map map) { if (map.Grid.Type == MapGridType.RectangularIsometric) { @@ -369,7 +369,7 @@ namespace OpenRA.Mods.Common.Pathfinder } } - CPos AbstractCellForLocalCells(List cells, byte layer) + static CPos AbstractCellForLocalCells(List cells, byte layer) { var minX = int.MaxValue; var minY = int.MaxValue; diff --git a/OpenRA.Mods.Common/Widgets/Logic/ServerListLogic.cs b/OpenRA.Mods.Common/Widgets/Logic/ServerListLogic.cs index c7a7f3a428..119bdeb5fe 100644 --- a/OpenRA.Mods.Common/Widgets/Logic/ServerListLogic.cs +++ b/OpenRA.Mods.Common/Widgets/Logic/ServerListLogic.cs @@ -692,7 +692,7 @@ namespace OpenRA.Mods.Common.Widgets.Logic header.Get("LABEL").GetText = () => headerTitle; rows.Add(header); - int ListOrder(GameServer g) + static int ListOrder(GameServer g) { // Servers waiting for players are always first if (g.State == (int)ServerState.WaitingPlayers && g.Players > 0)