C# 9 Cleanup (#325)

- [X] Removes EventArgs - not needed
- [X] Merges sequential checks
- [X] Removes redundant type declarations
This commit is contained in:
Kamron Batman 2020-11-27 00:29:21 -08:00 • committed by GitHub
parent 351611a23a
commit 3551d962f7
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
417 changed files with 2209 additions and 2213 deletions

View file

@ -12,7 +12,7 @@ namespace Server.Engines.ConPVP
private const int BlackColor32 = 0x000008;
private static readonly Dictionary<Mobile, List<IgnoreEntry>> m_IgnoreLists =
new Dictionary<Mobile, List<IgnoreEntry>>();
new();
private readonly Mobile m_Challenged;
private readonly Mobile m_Challenger;

View file

@ -31,7 +31,7 @@ namespace Server.Engines.ConPVP
public override string DefaultName => "arena controller";
public static List<ArenaController> Instances { get; set; } = new List<ArenaController>();
public static List<ArenaController> Instances { get; set; } = new();
public override void OnDelete()
{
@ -184,16 +184,16 @@ namespace Server.Engines.ConPVP
* \/\/\
* \/\/
*/
new Point2D(0, 0),
new Point2D(0, -1),
new Point2D(0, +1),
new Point2D(1, 0),
new Point2D(1, -1),
new Point2D(1, +1),
new Point2D(2, 0),
new Point2D(2, -1),
new Point2D(2, +1),
new Point2D(3, 0)
new(0, 0),
new(0, -1),
new(0, +1),
new(1, 0),
new(1, -1),
new(1, +1),
new(2, 0),
new(2, -1),
new(2, +1),
new(3, 0)
};
// nw corner
@ -206,16 +206,16 @@ namespace Server.Engines.ConPVP
* /\/\/\/\
* \/\/\/\/
*/
new Point2D(0, 0),
new Point2D(0, 1),
new Point2D(1, 0),
new Point2D(1, 1),
new Point2D(0, 2),
new Point2D(2, 0),
new Point2D(2, 1),
new Point2D(1, 2),
new Point2D(0, 3),
new Point2D(3, 0)
new(0, 0),
new(0, 1),
new(1, 0),
new(1, 1),
new(0, 2),
new(2, 0),
new(2, 1),
new(1, 2),
new(0, 3),
new(3, 0)
};
private static readonly int[][,] m_Rotate =
@ -520,7 +520,7 @@ namespace Server.Engines.ConPVP
}
}
public static List<Arena> Arenas { get; } = new List<Arena>();
public static List<Arena> Arenas { get; } = new();
public int CompareTo(Arena c) => string.CompareOrdinal(m_Name, c?.m_Name);

View file

@ -29,7 +29,7 @@ namespace Server.Engines.ConPVP
private static readonly TimeSpan CombatDelay = TimeSpan.FromSeconds(30.0);
private static readonly TimeSpan AutoTieDelay = TimeSpan.FromMinutes(15.0);
private readonly List<Item> m_Walls = new List<Item>();
private readonly List<Item> m_Walls = new();
private Timer m_AutoTieTimer;

View file

@ -16,7 +16,7 @@ namespace Server.Engines.ConPVP
private readonly List<Mobile> m_Helpers;
private readonly Point3DList m_Path = new Point3DList();
private readonly Point3DList m_Path = new();
private readonly EffectTimer m_Timer;
private bool m_Flying;
private int m_PathIdx;
@ -449,7 +449,7 @@ namespace Server.Engines.ConPVP
MoveToWorld(m_Path[m_PathIdx - 1]);
}
Point3D pTop = new Point3D(GetWorldLocation()), pBottom = new Point3D(m_Path[pathCheckEnd - 1]);
Point3D pTop = new(GetWorldLocation()), pBottom = new(m_Path[pathCheckEnd - 1]);
Utility.FixPoints(ref pTop, ref pBottom);
for (var i = m_PathIdx; i < pathCheckEnd; i++)

View file

@ -164,7 +164,7 @@ namespace Server.Engines.ConPVP
}
}
public List<LadderEntry> Entries { get; } = new List<LadderEntry>();
public List<LadderEntry> Entries { get; } = new();
public static Ladder Instance { get; set; }

View file

@ -19,7 +19,7 @@ namespace Server.Engines.ConPVP
public Ruleset Base { get; private set; }
public List<Ruleset> Flavors { get; } = new List<Ruleset>();
public List<Ruleset> Flavors { get; } = new();
public bool Changed { get; set; }

View file

@ -66,7 +66,7 @@ namespace Server.Engines.ConPVP
var entries = new List<RulesetLayout>
{
new RulesetLayout(
new(
"Spells",
new[]
{

View file

@ -7,7 +7,7 @@ namespace Server.Engines.ConPVP
{
public class TournamentController : Item
{
private static readonly List<TournamentController> m_Instances = new List<TournamentController>();
private static readonly List<TournamentController> m_Instances = new();
[Constructible]
public TournamentController() : base(0x1B7A)

View file

@ -209,7 +209,7 @@ namespace Server.Engines.ConPVP
public class PyramidLevel
{
public List<TourneyMatch> Matches { get; set; } = new List<TourneyMatch>();
public List<TourneyMatch> Matches { get; set; } = new();
public TourneyParticipant FreeAdvance { get; set; }
}
}

View file

@ -41,8 +41,7 @@ namespace Server.Engines.ConPVP
var tourney = Tournament?.Tournament;
if (InRange(m, 4) && !InRange(oldLocation, 4) && tourney != null && tourney.Stage == TournamentStage.Signup &&
m.CanBeginAction(this))
if (InRange(m, 4) && !InRange(oldLocation, 4) && tourney?.Stage == TournamentStage.Signup && m.CanBeginAction(this))
{
var ladder = Ladder.Instance;