Rider static analysis (#433)

* Non-accessed local variable

* Merge cast and type checks.

* StringComparison.Ordinal added for better culture support

* Supposed code improvement in launcher. Remove unused code.

* Update ExplosionHelper.cs

Unintentional change.

* Optimized Import

* Add Robust.Shared.Utility import where it was deleted

* Other random suggestion

* Improve my comment
This commit is contained in:
ZelteHonor
2019-11-13 17:37:46 -05:00
committed by Pieter-Jan Briers
parent 62b31eee00
commit b2e2aef78d
138 changed files with 190 additions and 400 deletions

View File

@@ -3,16 +3,15 @@ using System.Collections.Generic;
using System.Diagnostics;
using System.Globalization;
using Nett;
using SixLabors.ImageSharp;
using SixLabors.ImageSharp.PixelFormats;
using SixLabors.Primitives;
using Robust.Client.Utility;
using Robust.Shared.Interfaces.Log;
using Robust.Shared.Maths;
using Robust.Shared.Noise;
using Robust.Shared.Random;
using SixLabors.ImageSharp;
using SixLabors.ImageSharp.Advanced;
using BlendFactor = Robust.Shared.Maths.Color.BlendFactor;
using SixLabors.ImageSharp.PixelFormats;
using SixLabors.Primitives;
namespace Content.Client.Parallax
{
@@ -84,8 +83,8 @@ namespace Content.Client.Parallax
private readonly uint Octaves = 3;
private readonly float Threshold;
private readonly float Power = 1;
private readonly BlendFactor SrcFactor = BlendFactor.One;
private readonly BlendFactor DstFactor = BlendFactor.One;
private readonly Color.BlendFactor SrcFactor = Color.BlendFactor.One;
private readonly Color.BlendFactor DstFactor = Color.BlendFactor.One;
public LayerNoise(TomlTable table)
{
@@ -131,12 +130,12 @@ namespace Content.Client.Parallax
if (table.TryGetValue("sourcefactor", out tomlObject))
{
SrcFactor = (BlendFactor) Enum.Parse(typeof(BlendFactor), tomlObject.Get<string>());
SrcFactor = (Color.BlendFactor) Enum.Parse(typeof(Color.BlendFactor), tomlObject.Get<string>());
}
if (table.TryGetValue("destfactor", out tomlObject))
{
DstFactor = (BlendFactor) Enum.Parse(typeof(BlendFactor), tomlObject.Get<string>());
DstFactor = (Color.BlendFactor) Enum.Parse(typeof(Color.BlendFactor), tomlObject.Get<string>());
}
if (table.TryGetValue("power", out tomlObject))
@@ -208,8 +207,8 @@ namespace Content.Client.Parallax
private readonly Color CloseColor = Color.White;
private readonly Color FarColor = Color.Black;
private readonly BlendFactor SrcFactor = BlendFactor.One;
private readonly BlendFactor DstFactor = BlendFactor.One;
private readonly Color.BlendFactor SrcFactor = Color.BlendFactor.One;
private readonly Color.BlendFactor DstFactor = Color.BlendFactor.One;
// Noise mask stuff.
private readonly bool Masked;
@@ -238,12 +237,12 @@ namespace Content.Client.Parallax
if (table.TryGetValue("sourcefactor", out tomlObject))
{
SrcFactor = (BlendFactor) Enum.Parse(typeof(BlendFactor), tomlObject.Get<string>());
SrcFactor = (Color.BlendFactor) Enum.Parse(typeof(Color.BlendFactor), tomlObject.Get<string>());
}
if (table.TryGetValue("destfactor", out tomlObject))
{
DstFactor = (BlendFactor) Enum.Parse(typeof(BlendFactor), tomlObject.Get<string>());
DstFactor = (Color.BlendFactor) Enum.Parse(typeof(Color.BlendFactor), tomlObject.Get<string>());
}
if (table.TryGetValue("farcolor", out tomlObject))