Silence IDE0290.

This rule recommends use of primary constructors. Apply the suggestions on simple POCOs, adjusting some to readonly/structs/records at the same time. For more complex classes, the use of primary constructors is more distracting than helpful, so silence the rule. IDEs can still offer fixes for using primary constructors, but it will not show up as a build issue.
This commit is contained in:
RoosterDragon
2025-04-01 19:26:19 +01:00
committed by Gustas Kažukauskas
parent 3de6a5fd5a
commit 36660b89e9
52 changed files with 161 additions and 707 deletions

View File

@@ -216,10 +216,8 @@ namespace OpenRA
}
}
public class LocationInit : ValueActorInit<CPos>, ISingleInstanceInit
public class LocationInit(CPos value) : ValueActorInit<CPos>(value), ISingleInstanceInit
{
public LocationInit(CPos value)
: base(value) { }
}
public class OwnerInit : ActorInit, ISingleInstanceInit

View File

@@ -11,16 +11,10 @@
namespace OpenRA
{
public readonly struct TerrainTile
public readonly struct TerrainTile(ushort type, byte index)
{
public readonly ushort Type;
public readonly byte Index;
public TerrainTile(ushort type, byte index)
{
Type = type;
Index = index;
}
public readonly ushort Type = type;
public readonly byte Index = index;
public override int GetHashCode() { return Type.GetHashCode() ^ Index.GetHashCode(); }
@@ -42,16 +36,10 @@ namespace OpenRA
}
}
public readonly struct ResourceTile
public readonly struct ResourceTile(byte type, byte index)
{
public readonly byte Type;
public readonly byte Index;
public ResourceTile(byte type, byte index)
{
Type = type;
Index = index;
}
public readonly byte Type = type;
public readonly byte Index = index;
public override int GetHashCode() { return Type.GetHashCode() ^ Index.GetHashCode(); }
}