Remove unread private member (IDE0052)
This commit is contained in:
committed by
Gustas
parent
43e0cca663
commit
d3a8b07f05
@@ -144,6 +144,9 @@ dotnet_diagnostic.IDE0040.severity = warning
|
|||||||
# Make field readonly.
|
# Make field readonly.
|
||||||
dotnet_diagnostic.IDE0044.severity = warning
|
dotnet_diagnostic.IDE0044.severity = warning
|
||||||
|
|
||||||
|
# Unused private member.
|
||||||
|
dotnet_diagnostic.IDE0052.severity = warning
|
||||||
|
|
||||||
# Unused parameter.
|
# Unused parameter.
|
||||||
dotnet_diagnostic.IDE0060.severity = warning
|
dotnet_diagnostic.IDE0060.severity = warning
|
||||||
|
|
||||||
|
|||||||
@@ -15,21 +15,18 @@ using System.Collections.Generic;
|
|||||||
using System.IO;
|
using System.IO;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using OpenRA.FileSystem;
|
using OpenRA.FileSystem;
|
||||||
using OpenRA.Graphics;
|
|
||||||
|
|
||||||
namespace OpenRA
|
namespace OpenRA
|
||||||
{
|
{
|
||||||
public class InstalledMods : IReadOnlyDictionary<string, Manifest>
|
public class InstalledMods : IReadOnlyDictionary<string, Manifest>
|
||||||
{
|
{
|
||||||
readonly Dictionary<string, Manifest> mods;
|
readonly Dictionary<string, Manifest> mods;
|
||||||
readonly SheetBuilder sheetBuilder;
|
|
||||||
|
|
||||||
/// <summary>Initializes the collection of locally installed mods.</summary>
|
/// <summary>Initializes the collection of locally installed mods.</summary>
|
||||||
/// <param name="searchPaths">Filesystem paths to search for mod packages.</param>
|
/// <param name="searchPaths">Filesystem paths to search for mod packages.</param>
|
||||||
/// <param name="explicitPaths">Filesystem paths to additional mod packages.</param>
|
/// <param name="explicitPaths">Filesystem paths to additional mod packages.</param>
|
||||||
public InstalledMods(IEnumerable<string> searchPaths, IEnumerable<string> explicitPaths)
|
public InstalledMods(IEnumerable<string> searchPaths, IEnumerable<string> explicitPaths)
|
||||||
{
|
{
|
||||||
sheetBuilder = new SheetBuilder(SheetType.BGRA, 256);
|
|
||||||
mods = GetInstalledMods(searchPaths, explicitPaths);
|
mods = GetInstalledMods(searchPaths, explicitPaths);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1479,7 +1479,11 @@ namespace OpenRA.Server
|
|||||||
{
|
{
|
||||||
readonly Connection connection;
|
readonly Connection connection;
|
||||||
readonly int[] pingHistory;
|
readonly int[] pingHistory;
|
||||||
|
|
||||||
|
// TODO: future net code changes
|
||||||
|
#pragma warning disable IDE0052
|
||||||
readonly byte queueLength;
|
readonly byte queueLength;
|
||||||
|
#pragma warning restore IDE0052
|
||||||
|
|
||||||
public ConnectionPingEvent(Connection connection, int[] pingHistory, byte queueLength)
|
public ConnectionPingEvent(Connection connection, int[] pingHistory, byte queueLength)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -87,7 +87,6 @@ namespace OpenRA.Traits
|
|||||||
[Flags]
|
[Flags]
|
||||||
public enum CellVisibility : byte { Hidden = 0x0, Explored = 0x1, Visible = 0x2 }
|
public enum CellVisibility : byte { Hidden = 0x0, Explored = 0x1, Visible = 0x2 }
|
||||||
|
|
||||||
readonly Actor self;
|
|
||||||
readonly ShroudInfo info;
|
readonly ShroudInfo info;
|
||||||
readonly Map map;
|
readonly Map map;
|
||||||
|
|
||||||
@@ -134,7 +133,6 @@ namespace OpenRA.Traits
|
|||||||
|
|
||||||
public Shroud(Actor self, ShroudInfo info)
|
public Shroud(Actor self, ShroudInfo info)
|
||||||
{
|
{
|
||||||
this.self = self;
|
|
||||||
this.info = info;
|
this.info = info;
|
||||||
map = self.World.Map;
|
map = self.World.Map;
|
||||||
|
|
||||||
|
|||||||
@@ -26,7 +26,6 @@ namespace OpenRA.Mods.Cnc.Effects
|
|||||||
readonly Animation anim;
|
readonly Animation anim;
|
||||||
|
|
||||||
readonly PlayerDictionary<DotState> dotStates;
|
readonly PlayerDictionary<DotState> dotStates;
|
||||||
readonly IDefaultVisibility visibility;
|
|
||||||
readonly IVisibilityModifier[] visibilityModifiers;
|
readonly IVisibilityModifier[] visibilityModifiers;
|
||||||
|
|
||||||
class DotState
|
class DotState
|
||||||
@@ -52,7 +51,6 @@ namespace OpenRA.Mods.Cnc.Effects
|
|||||||
anim = new Animation(actor.World, info.Image);
|
anim = new Animation(actor.World, info.Image);
|
||||||
anim.PlayRepeating(info.String);
|
anim.PlayRepeating(info.String);
|
||||||
|
|
||||||
visibility = actor.Trait<IDefaultVisibility>();
|
|
||||||
visibilityModifiers = actor.TraitsImplementing<IVisibilityModifier>().ToArray();
|
visibilityModifiers = actor.TraitsImplementing<IVisibilityModifier>().ToArray();
|
||||||
|
|
||||||
dotStates = new PlayerDictionary<DotState>(actor.World,
|
dotStates = new PlayerDictionary<DotState>(actor.World,
|
||||||
|
|||||||
@@ -239,9 +239,6 @@ namespace OpenRA.Mods.Cnc.UtilityCommands
|
|||||||
{ 0x03, new byte[] { 0x7E } }
|
{ 0x03, new byte[] { 0x7E } }
|
||||||
};
|
};
|
||||||
|
|
||||||
// Veins and vein holes
|
|
||||||
static readonly int[] ValidVeinNeighbours = { 0x7E, 0xA7, 0xB2 };
|
|
||||||
|
|
||||||
static readonly Dictionary<string, string> DeployableActors = new Dictionary<string, string>()
|
static readonly Dictionary<string, string> DeployableActors = new Dictionary<string, string>()
|
||||||
{
|
{
|
||||||
{ "gadpsa", "lpst" },
|
{ "gadpsa", "lpst" },
|
||||||
|
|||||||
@@ -20,7 +20,6 @@ namespace OpenRA.Mods.Common.Activities
|
|||||||
public class DeliverUnit : Activity
|
public class DeliverUnit : Activity
|
||||||
{
|
{
|
||||||
readonly Carryall carryall;
|
readonly Carryall carryall;
|
||||||
readonly BodyOrientation body;
|
|
||||||
readonly bool assignTargetOnFirstRun;
|
readonly bool assignTargetOnFirstRun;
|
||||||
readonly WDist deliverRange;
|
readonly WDist deliverRange;
|
||||||
readonly Color? targetLineColor;
|
readonly Color? targetLineColor;
|
||||||
@@ -40,7 +39,6 @@ namespace OpenRA.Mods.Common.Activities
|
|||||||
this.targetLineColor = targetLineColor;
|
this.targetLineColor = targetLineColor;
|
||||||
|
|
||||||
carryall = self.Trait<Carryall>();
|
carryall = self.Trait<Carryall>();
|
||||||
body = self.Trait<BodyOrientation>();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
protected override void OnFirstRun(Actor self)
|
protected override void OnFirstRun(Actor self)
|
||||||
|
|||||||
@@ -39,7 +39,7 @@ namespace OpenRA.Mods.Common.Widgets
|
|||||||
editorActionManager = world.WorldActor.Trait<EditorActionManager>();
|
editorActionManager = world.WorldActor.Trait<EditorActionManager>();
|
||||||
editorCursor = world.WorldActor.Trait<EditorCursorLayer>();
|
editorCursor = world.WorldActor.Trait<EditorCursorLayer>();
|
||||||
resourceLayer = world.WorldActor.Trait<IResourceLayer>();
|
resourceLayer = world.WorldActor.Trait<IResourceLayer>();
|
||||||
action = new AddResourcesEditorAction(world.Map, resourceType, resourceLayer);
|
action = new AddResourcesEditorAction(resourceType, resourceLayer);
|
||||||
|
|
||||||
cursorToken = editorCursor.SetResource(wr, resourceType);
|
cursorToken = editorCursor.SetResource(wr, resourceType);
|
||||||
}
|
}
|
||||||
@@ -74,7 +74,7 @@ namespace OpenRA.Mods.Common.Widgets
|
|||||||
else if (resourceAdded && mi.Button == MouseButton.Left && mi.Event == MouseInputEvent.Up)
|
else if (resourceAdded && mi.Button == MouseButton.Left && mi.Event == MouseInputEvent.Up)
|
||||||
{
|
{
|
||||||
editorActionManager.Add(action);
|
editorActionManager.Add(action);
|
||||||
action = new AddResourcesEditorAction(world.Map, ResourceType, resourceLayer);
|
action = new AddResourcesEditorAction(ResourceType, resourceLayer);
|
||||||
resourceAdded = false;
|
resourceAdded = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -107,14 +107,12 @@ namespace OpenRA.Mods.Common.Widgets
|
|||||||
{
|
{
|
||||||
public string Text { get; private set; }
|
public string Text { get; private set; }
|
||||||
|
|
||||||
readonly Map map;
|
|
||||||
readonly IResourceLayer resourceLayer;
|
readonly IResourceLayer resourceLayer;
|
||||||
readonly string resourceType;
|
readonly string resourceType;
|
||||||
readonly List<CellResource> cellResources = new List<CellResource>();
|
readonly List<CellResource> cellResources = new List<CellResource>();
|
||||||
|
|
||||||
public AddResourcesEditorAction(Map map, string resourceType, IResourceLayer resourceLayer)
|
public AddResourcesEditorAction(string resourceType, IResourceLayer resourceLayer)
|
||||||
{
|
{
|
||||||
this.map = map;
|
|
||||||
this.resourceType = resourceType;
|
this.resourceType = resourceType;
|
||||||
this.resourceLayer = resourceLayer;
|
this.resourceLayer = resourceLayer;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1231,13 +1231,11 @@ namespace OpenRA.Mods.Common.Traits
|
|||||||
|
|
||||||
class AssociateWithAirfieldActivity : Activity
|
class AssociateWithAirfieldActivity : Activity
|
||||||
{
|
{
|
||||||
readonly Actor self;
|
|
||||||
readonly Aircraft aircraft;
|
readonly Aircraft aircraft;
|
||||||
readonly int delay;
|
readonly int delay;
|
||||||
|
|
||||||
public AssociateWithAirfieldActivity(Actor self, int delay = 0)
|
public AssociateWithAirfieldActivity(Actor self, int delay = 0)
|
||||||
{
|
{
|
||||||
this.self = self;
|
|
||||||
aircraft = self.Trait<Aircraft>();
|
aircraft = self.Trait<Aircraft>();
|
||||||
IsInterruptible = false;
|
IsInterruptible = false;
|
||||||
this.delay = delay;
|
this.delay = delay;
|
||||||
|
|||||||
@@ -61,8 +61,6 @@ namespace OpenRA.Mods.Common.Traits
|
|||||||
readonly World world;
|
readonly World world;
|
||||||
readonly Player player;
|
readonly Player player;
|
||||||
|
|
||||||
readonly Predicate<Actor> unitCannotBeOrdered;
|
|
||||||
|
|
||||||
IBotPositionsUpdated[] notifyPositionsUpdated;
|
IBotPositionsUpdated[] notifyPositionsUpdated;
|
||||||
IBotRequestUnitProduction[] requestUnitProduction;
|
IBotRequestUnitProduction[] requestUnitProduction;
|
||||||
|
|
||||||
@@ -75,7 +73,6 @@ namespace OpenRA.Mods.Common.Traits
|
|||||||
{
|
{
|
||||||
world = self.World;
|
world = self.World;
|
||||||
player = self.Owner;
|
player = self.Owner;
|
||||||
unitCannotBeOrdered = a => a.Owner != player || a.IsDead || !a.IsInWorld;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
protected override void Created(Actor self)
|
protected override void Created(Actor self)
|
||||||
|
|||||||
@@ -40,14 +40,11 @@ namespace OpenRA.Mods.Common.Traits.Render
|
|||||||
public class WithSpriteControlGroupDecoration : IDecoration
|
public class WithSpriteControlGroupDecoration : IDecoration
|
||||||
{
|
{
|
||||||
public readonly WithSpriteControlGroupDecorationInfo Info;
|
public readonly WithSpriteControlGroupDecorationInfo Info;
|
||||||
readonly Actor self;
|
|
||||||
readonly Animation anim;
|
readonly Animation anim;
|
||||||
|
|
||||||
public WithSpriteControlGroupDecoration(Actor self, WithSpriteControlGroupDecorationInfo info)
|
public WithSpriteControlGroupDecoration(Actor self, WithSpriteControlGroupDecorationInfo info)
|
||||||
{
|
{
|
||||||
Info = info;
|
Info = info;
|
||||||
this.self = self;
|
|
||||||
|
|
||||||
anim = new Animation(self.World, Info.Image);
|
anim = new Animation(self.World, Info.Image);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -49,7 +49,6 @@ namespace OpenRA.Mods.Common.Traits.Render
|
|||||||
{
|
{
|
||||||
readonly WithTextControlGroupDecorationInfo info;
|
readonly WithTextControlGroupDecorationInfo info;
|
||||||
readonly SpriteFont font;
|
readonly SpriteFont font;
|
||||||
readonly Actor self;
|
|
||||||
readonly CachedTransform<int, string> label;
|
readonly CachedTransform<int, string> label;
|
||||||
|
|
||||||
Color color;
|
Color color;
|
||||||
@@ -57,7 +56,6 @@ namespace OpenRA.Mods.Common.Traits.Render
|
|||||||
public WithTextControlGroupDecoration(Actor self, WithTextControlGroupDecorationInfo info)
|
public WithTextControlGroupDecoration(Actor self, WithTextControlGroupDecorationInfo info)
|
||||||
{
|
{
|
||||||
this.info = info;
|
this.info = info;
|
||||||
this.self = self;
|
|
||||||
font = Game.Renderer.Fonts[info.Font];
|
font = Game.Renderer.Fonts[info.Font];
|
||||||
color = info.UsePlayerColor ? self.Owner.Color : info.Color;
|
color = info.UsePlayerColor ? self.Owner.Color : info.Color;
|
||||||
|
|
||||||
|
|||||||
@@ -49,15 +49,11 @@ namespace OpenRA.Mods.Common.Traits.Render
|
|||||||
|
|
||||||
public class WithVoxelTurret : ConditionalTrait<WithVoxelTurretInfo>
|
public class WithVoxelTurret : ConditionalTrait<WithVoxelTurretInfo>
|
||||||
{
|
{
|
||||||
readonly Actor self;
|
|
||||||
readonly Turreted turreted;
|
readonly Turreted turreted;
|
||||||
readonly BodyOrientation body;
|
|
||||||
|
|
||||||
public WithVoxelTurret(Actor self, WithVoxelTurretInfo info)
|
public WithVoxelTurret(Actor self, WithVoxelTurretInfo info)
|
||||||
: base(info)
|
: base(info)
|
||||||
{
|
{
|
||||||
this.self = self;
|
|
||||||
body = self.Trait<BodyOrientation>();
|
|
||||||
turreted = self.TraitsImplementing<Turreted>()
|
turreted = self.TraitsImplementing<Turreted>()
|
||||||
.First(tt => tt.Name == Info.Turret);
|
.First(tt => tt.Name == Info.Turret);
|
||||||
|
|
||||||
|
|||||||
@@ -95,7 +95,6 @@ namespace OpenRA.Mods.Common.Traits
|
|||||||
{
|
{
|
||||||
readonly TimeLimitManagerInfo info;
|
readonly TimeLimitManagerInfo info;
|
||||||
readonly int ticksPerSecond;
|
readonly int ticksPerSecond;
|
||||||
MapOptions mapOptions;
|
|
||||||
LabelWidget countdownLabel;
|
LabelWidget countdownLabel;
|
||||||
CachedTransform<int, string> countdown;
|
CachedTransform<int, string> countdown;
|
||||||
int ticksRemaining;
|
int ticksRemaining;
|
||||||
@@ -119,7 +118,6 @@ namespace OpenRA.Mods.Common.Traits
|
|||||||
|
|
||||||
void IWorldLoaded.WorldLoaded(World w, OpenRA.Graphics.WorldRenderer wr)
|
void IWorldLoaded.WorldLoaded(World w, OpenRA.Graphics.WorldRenderer wr)
|
||||||
{
|
{
|
||||||
mapOptions = w.WorldActor.Trait<MapOptions>();
|
|
||||||
if (string.IsNullOrWhiteSpace(info.CountdownLabel) || string.IsNullOrWhiteSpace(info.CountdownText))
|
if (string.IsNullOrWhiteSpace(info.CountdownLabel) || string.IsNullOrWhiteSpace(info.CountdownText))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user