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.Spells
public abstract class SpecialMove
{
private static readonly Dictionary<Mobile, SpecialMoveContext> m_PlayersTable =
new Dictionary<Mobile, SpecialMoveContext>();
new();
public virtual int BaseMana => 0;
@ -24,7 +24,7 @@ namespace Server.Spells
public virtual bool BlockedByAnimalForm => true;
public virtual bool DelayedContext => false;
public static Dictionary<Mobile, SpecialMove> Table { get; } = new Dictionary<Mobile, SpecialMove>();
public static Dictionary<Mobile, SpecialMove> Table { get; } = new();
public virtual bool ValidatesDuringHit => true;

View file

@ -25,7 +25,7 @@ namespace Server.Spells
// of course, two MA's won't.
private static readonly Dictionary<Type, DelayedDamageContextWrapper> m_ContextTable =
new Dictionary<Type, DelayedDamageContextWrapper>();
new();
private AnimTimer m_AnimTimer;
@ -834,7 +834,7 @@ namespace Server.Spells
private class DelayedDamageContextWrapper
{
private readonly Dictionary<Mobile, Timer> m_Contexts = new Dictionary<Mobile, Timer>();
private readonly Dictionary<Mobile, Timer> m_Contexts = new();
public void Add(Mobile m, Timer t)
{

View file

@ -1225,7 +1225,7 @@ namespace Server.Spells
public static class TransformationSpellHelper
{
private static readonly Dictionary<Mobile, TransformContext> m_Table = new Dictionary<Mobile, TransformContext>();
private static readonly Dictionary<Mobile, TransformContext> m_Table = new();
public static bool CheckCast(Mobile caster, Spell spell)
{

View file

@ -9,7 +9,7 @@ namespace Server.Spells
private static readonly Type[] m_Types = new Type[700];
private static int m_Count;
private static readonly Dictionary<Type, int> m_IDsFromTypes = new Dictionary<Type, int>(m_Types.Length);
private static readonly Dictionary<Type, int> m_IDsFromTypes = new(m_Types.Length);
private static readonly object[] m_Params = new object[2];
@ -61,7 +61,7 @@ namespace Server.Spells
}
}
public static Dictionary<int, SpecialMove> SpecialMoves { get; } = new Dictionary<int, SpecialMove>();
public static Dictionary<int, SpecialMove> SpecialMoves { get; } = new();
public static int GetRegistryNumber(ISpell s) => GetRegistryNumber(s.GetType());