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

@ -9,14 +9,14 @@ namespace Server.Items
{
public static readonly CrystalRechargeInfo[] Table =
{
new CrystalRechargeInfo(typeof(Citrine), 500),
new CrystalRechargeInfo(typeof(Amber), 500),
new CrystalRechargeInfo(typeof(Tourmaline), 750),
new CrystalRechargeInfo(typeof(Emerald), 1000),
new CrystalRechargeInfo(typeof(Sapphire), 1000),
new CrystalRechargeInfo(typeof(Amethyst), 1000),
new CrystalRechargeInfo(typeof(StarSapphire), 1250),
new CrystalRechargeInfo(typeof(Diamond), 2000)
new(typeof(Citrine), 500),
new(typeof(Amber), 500),
new(typeof(Tourmaline), 750),
new(typeof(Emerald), 1000),
new(typeof(Sapphire), 1000),
new(typeof(Amethyst), 1000),
new(typeof(StarSapphire), 1250),
new(typeof(Diamond), 2000)
};
private CrystalRechargeInfo(Type type, int amount)

View file

@ -64,7 +64,7 @@ namespace Server.Network
count++;
}
if (beheld.FacialHair != null && beheld.FacialHair.ItemID > 0)
if (beheld.FacialHair?.ItemID > 0)
{
count++;
}
@ -110,7 +110,7 @@ namespace Server.Network
++written;
}
if (beheld.FacialHair != null && beheld.FacialHair.ItemID > 0)
if (beheld.FacialHair?.ItemID > 0)
{
Stream.Write(FacialHairInfo.FakeSerial(beheld.Owner) - 2);
Stream.Write((ushort)beheld.FacialHair.ItemID);

View file

@ -5,7 +5,7 @@ namespace Server.Items
{
public class EffectItem : Item
{
private static readonly List<EffectItem> m_Free = new List<EffectItem>(); // List of available EffectItems
private static readonly List<EffectItem> m_Free = new(); // List of available EffectItems
public static readonly TimeSpan DefaultDuration = TimeSpan.FromSeconds(5.0);

View file

@ -46,18 +46,18 @@ namespace Server.Items
{
private static readonly HairDyeEntry[] m_Entries =
{
new HairDyeEntry("*****", 1602, 26),
new HairDyeEntry("*****", 1628, 27),
new HairDyeEntry("*****", 1502, 32),
new HairDyeEntry("*****", 1302, 32),
new HairDyeEntry("*****", 1402, 32),
new HairDyeEntry("*****", 1202, 24),
new HairDyeEntry("*****", 2402, 29),
new HairDyeEntry("*****", 2213, 6),
new HairDyeEntry("*****", 1102, 8),
new HairDyeEntry("*****", 1110, 8),
new HairDyeEntry("*****", 1118, 16),
new HairDyeEntry("*****", 1134, 16)
new("*****", 1602, 26),
new("*****", 1628, 27),
new("*****", 1502, 32),
new("*****", 1302, 32),
new("*****", 1402, 32),
new("*****", 1202, 24),
new("*****", 2402, 29),
new("*****", 2213, 6),
new("*****", 1102, 8),
new("*****", 1110, 8),
new("*****", 1118, 16),
new("*****", 1134, 16)
};
private readonly HairDye m_HairDye;

View file

@ -57,7 +57,7 @@ namespace Server.Items
{
private static readonly TimeSpan m_UseTimeout = TimeSpan.FromMinutes(2.0);
private readonly HashSet<Mobile> m_DamageTable = new HashSet<Mobile>();
private readonly HashSet<Mobile> m_DamageTable = new();
private DateTime m_LastUse;
private int m_SideLength;

View file

@ -187,7 +187,7 @@ namespace Server.Items
public class PMList
{
public static readonly PMList Trammel =
new PMList(
new(
1012000,
1012012,
Map.Trammel,
@ -207,7 +207,7 @@ namespace Server.Items
);
public static readonly PMList Felucca =
new PMList(
new(
1012001,
1012013,
Map.Felucca,
@ -227,7 +227,7 @@ namespace Server.Items
);
public static readonly PMList Ilshenar =
new PMList(
new(
1012002,
1012014,
Map.Ilshenar,
@ -246,7 +246,7 @@ namespace Server.Items
);
public static readonly PMList Malas =
new PMList(
new(
1060643,
1062039,
Map.Malas,
@ -258,7 +258,7 @@ namespace Server.Items
);
public static readonly PMList Tokuno =
new PMList(
new(
1063258,
1063415,
Map.Tokuno,

View file

@ -50,14 +50,14 @@ namespace Server.Items
{
private static readonly SpecialBeardDyeEntry[] m_Entries =
{
new SpecialBeardDyeEntry("*****", 12, 10),
new SpecialBeardDyeEntry("*****", 32, 5),
new SpecialBeardDyeEntry("*****", 38, 8),
new SpecialBeardDyeEntry("*****", 54, 3),
new SpecialBeardDyeEntry("*****", 62, 10),
new SpecialBeardDyeEntry("*****", 81, 2),
new SpecialBeardDyeEntry("*****", 89, 2),
new SpecialBeardDyeEntry("*****", 1153, 2)
new("*****", 12, 10),
new("*****", 32, 5),
new("*****", 38, 8),
new("*****", 54, 3),
new("*****", 62, 10),
new("*****", 81, 2),
new("*****", 89, 2),
new("*****", 1153, 2)
};
private readonly SpecialBeardDye m_SpecialBeardDye;

View file

@ -50,14 +50,14 @@ namespace Server.Items
{
private static readonly SpecialHairDyeEntry[] m_Entries =
{
new SpecialHairDyeEntry("*****", 12, 10),
new SpecialHairDyeEntry("*****", 32, 5),
new SpecialHairDyeEntry("*****", 38, 8),
new SpecialHairDyeEntry("*****", 54, 3),
new SpecialHairDyeEntry("*****", 62, 10),
new SpecialHairDyeEntry("*****", 81, 2),
new SpecialHairDyeEntry("*****", 89, 2),
new SpecialHairDyeEntry("*****", 1153, 2)
new("*****", 12, 10),
new("*****", 32, 5),
new("*****", 38, 8),
new("*****", 54, 3),
new("*****", 62, 10),
new("*****", 81, 2),
new("*****", 89, 2),
new("*****", 1153, 2)
};
private readonly SpecialHairDye m_SpecialHairDye;