diff --git a/.editorconfig b/.editorconfig index f4dbfb1d55..4e7022ac73 100644 --- a/.editorconfig +++ b/.editorconfig @@ -1061,6 +1061,9 @@ dotnet_diagnostic.RCS1159.severity = warning # Unused type parameter. dotnet_diagnostic.RCS1164.severity = warning +# Use read-only auto-implemented property. +dotnet_diagnostic.RCS1170.severity = warning + # Use 'is' operator instead of 'as' operator. dotnet_diagnostic.RCS1172.severity = warning diff --git a/OpenRA.Game/Actor.cs b/OpenRA.Game/Actor.cs index 0b55fc30a9..8133bde68d 100644 --- a/OpenRA.Game/Actor.cs +++ b/OpenRA.Game/Actor.cs @@ -71,7 +71,7 @@ namespace OpenRA public IEffectiveOwner EffectiveOwner { get; } public IOccupySpace OccupiesSpace { get; } public ITargetable[] Targetables { get; } - public IEnumerable EnabledTargetablePositions { get; private set; } + public IEnumerable EnabledTargetablePositions { get; } public bool IsIdle => CurrentActivity == null; public bool IsDead => Disposed || (health != null && health.IsDead); diff --git a/OpenRA.Mods.Common/Widgets/RadarWidget.cs b/OpenRA.Mods.Common/Widgets/RadarWidget.cs index 9ab1306d5d..e459b14c2e 100644 --- a/OpenRA.Mods.Common/Widgets/RadarWidget.cs +++ b/OpenRA.Mods.Common/Widgets/RadarWidget.cs @@ -29,6 +29,8 @@ namespace OpenRA.Mods.Common.Widgets public int AnimationLength = 5; public string RadarOnlineSound = null; public string RadarOfflineSound = null; + public string SoundUp; + public string SoundDown; public Func IsEnabled = () => true; public Action AfterOpen = () => { }; public Action AfterClose = () => { }; @@ -63,9 +65,6 @@ namespace OpenRA.Mods.Common.Widgets PlayerRadarTerrain playerRadarTerrain; Player currentPlayer; - public string SoundUp { get; private set; } - public string SoundDown { get; private set; } - [ObjectCreator.UseCtor] public RadarWidget(World world, WorldRenderer worldRenderer) { diff --git a/OpenRA.Mods.Common/Widgets/ResourcePreviewWidget.cs b/OpenRA.Mods.Common/Widgets/ResourcePreviewWidget.cs index e02d369e01..5a36e78c06 100644 --- a/OpenRA.Mods.Common/Widgets/ResourcePreviewWidget.cs +++ b/OpenRA.Mods.Common/Widgets/ResourcePreviewWidget.cs @@ -44,7 +44,7 @@ namespace OpenRA.Mods.Common.Widgets } } - public Size IdealPreviewSize { get; private set; } + public Size IdealPreviewSize { get; } [ObjectCreator.UseCtor] public ResourcePreviewWidget(ModData modData, WorldRenderer worldRenderer, World world)