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

@ -14,7 +14,7 @@ namespace Server.Items
/// </summary>
public class BleedAttack : WeaponAbility
{
private static readonly Dictionary<Mobile, Timer> m_Table = new Dictionary<Mobile, Timer>();
private static readonly Dictionary<Mobile, Timer> m_Table = new();
public override int BaseMana => 30;

View file

@ -8,7 +8,7 @@ namespace Server.Items
/// </summary>
public class Block : WeaponAbility
{
private static readonly Dictionary<Mobile, BlockInfo> m_Table = new Dictionary<Mobile, BlockInfo>();
private static readonly Dictionary<Mobile, BlockInfo> m_Table = new();
public override int BaseMana => 30;

View file

@ -10,7 +10,7 @@ namespace Server.Items
public class DefenseMastery : WeaponAbility
{
private static readonly Dictionary<Mobile, DefenseMasteryInfo>
m_Table = new Dictionary<Mobile, DefenseMasteryInfo>();
m_Table = new();
public override int BaseMana => 30;

View file

@ -8,7 +8,7 @@ namespace Server.Items
/// </summary>
public class DualWield : WeaponAbility
{
public static Dictionary<Mobile, DualWieldTimer> Registry { get; } = new Dictionary<Mobile, DualWieldTimer>();
public static Dictionary<Mobile, DualWieldTimer> Registry { get; } = new();
public override int BaseMana => 30;

View file

@ -8,7 +8,7 @@ namespace Server.Items
/// </summary>
public class Feint : WeaponAbility
{
public static Dictionary<Mobile, FeintTimer> Registry { get; } = new Dictionary<Mobile, FeintTimer>();
public static Dictionary<Mobile, FeintTimer> Registry { get; } = new();
public override int BaseMana => 30;

View file

@ -13,7 +13,7 @@ namespace Server.Items
public override int BaseMana => 30;
public static Dictionary<Mobile, FrenziedWirlwindTimer> Registry { get; } =
new Dictionary<Mobile, FrenziedWirlwindTimer>();
new();
public override bool CheckSkills(Mobile from)
{

View file

@ -13,7 +13,7 @@ namespace Server.Items
public static readonly TimeSpan PlayerDuration = TimeSpan.FromSeconds(6.0);
public static readonly TimeSpan NPCDuration = TimeSpan.FromSeconds(12.0);
private static readonly Dictionary<Mobile, InternalTimer> m_Table = new Dictionary<Mobile, InternalTimer>();
private static readonly Dictionary<Mobile, InternalTimer> m_Table = new();
public override int BaseMana => 30;

View file

@ -13,7 +13,7 @@ namespace Server.Items
public static readonly TimeSpan FreezeDelayDuration = TimeSpan.FromSeconds(8.0);
private static readonly Dictionary<Mobile, InternalTimer> m_Table = new Dictionary<Mobile, InternalTimer>();
private static readonly Dictionary<Mobile, InternalTimer> m_Table = new();
public override int BaseMana => 30;

View file

@ -8,7 +8,7 @@ namespace Server.Items
/// </summary>
public class TalonStrike : WeaponAbility
{
private static readonly HashSet<Mobile> m_Table = new HashSet<Mobile>();
private static readonly HashSet<Mobile> m_Table = new();
public override int BaseMana => 30;
public override double DamageScalar => 1.2;

View file

@ -83,7 +83,7 @@ namespace Server.Items
public static readonly WeaponAbility Disrobe = Abilities[30];
private static readonly Dictionary<Mobile, WeaponAbilityContext> m_PlayersTable =
new Dictionary<Mobile, WeaponAbilityContext>();
new();
public virtual int BaseMana => 0;
@ -92,7 +92,7 @@ namespace Server.Items
public virtual bool RequiresSE => false;
public static Dictionary<Mobile, WeaponAbility> Table { get; } = new Dictionary<Mobile, WeaponAbility>();
public static Dictionary<Mobile, WeaponAbility> Table { get; } = new();
public virtual bool ValidatesDuringHit => true;

View file

@ -8,8 +8,8 @@ namespace Server.Items
public static readonly TimeSpan AttackEffectDuration = TimeSpan.FromSeconds(10.0);
public static readonly TimeSpan DefenseEffectDuration = TimeSpan.FromSeconds(8.0);
private static readonly HashSet<Mobile> m_AttackTable = new HashSet<Mobile>();
private static readonly HashSet<Mobile> m_DefenseTable = new HashSet<Mobile>();
private static readonly HashSet<Mobile> m_AttackTable = new();
private static readonly HashSet<Mobile> m_DefenseTable = new();
public static bool IsUnderAttackEffect(Mobile m) => m_AttackTable.Contains(m);