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

@ -22,12 +22,12 @@ namespace Server.Items
{
}
public static DawnsMusicGear RandomCommon => new DawnsMusicGear(DawnsMusicBox.RandomTrack(DawnsMusicRarity.Common));
public static DawnsMusicGear RandomCommon => new(DawnsMusicBox.RandomTrack(DawnsMusicRarity.Common));
public static DawnsMusicGear RandomUncommon =>
new DawnsMusicGear(DawnsMusicBox.RandomTrack(DawnsMusicRarity.Uncommon));
new(DawnsMusicBox.RandomTrack(DawnsMusicRarity.Uncommon));
public static DawnsMusicGear RandomRare => new DawnsMusicGear(DawnsMusicBox.RandomTrack(DawnsMusicRarity.Rare));
public static DawnsMusicGear RandomRare => new(DawnsMusicBox.RandomTrack(DawnsMusicRarity.Rare));
[CommandProperty(AccessLevel.GameMaster)]
public MusicName Music { get; set; }

View file

@ -5,7 +5,7 @@ namespace Server.Items
{
public class CandyCane : Food
{
private static readonly Dictionary<Mobile, CandyCaneTimer> m_ToothAches = new Dictionary<Mobile, CandyCaneTimer>();
private static readonly Dictionary<Mobile, CandyCaneTimer> m_ToothAches = new();
[Constructible]
public CandyCane()

View file

@ -77,7 +77,7 @@ namespace Server.Items
public static readonly TimeSpan DefaultDuration = TimeSpan.FromDays(7.0);
public static readonly TimeSpan ExpirationTime = TimeSpan.FromDays(30.0);
private static readonly List<HouseRaffleStone> m_AllStones = new List<HouseRaffleStone>();
private static readonly List<HouseRaffleStone> m_AllStones = new();
private Rectangle2D m_Bounds;
private TimeSpan m_Duration;
private Map m_Facet;

View file

@ -183,19 +183,19 @@ namespace Server.Items
{
private static readonly MiniHouseInfo[] m_Info =
{
/* Stone and plaster house */ new MiniHouseInfo(0x22C4, 1, 1011303),
/* Field stone house */ new MiniHouseInfo(0x22DE, 1, 1011304),
/* Small brick house */ new MiniHouseInfo(0x22DF, 1, 1011305),
/* Wooden house */ new MiniHouseInfo(0x22C9, 1, 1011306),
/* Wood and plaster house */ new MiniHouseInfo(0x22E0, 1, 1011307),
/* Thatched-roof cottage */ new MiniHouseInfo(0x22E1, 1, 1011308),
/* Brick house */ new MiniHouseInfo(1011309, 0x22CD, 0x22CB, 0x22CC, 0x22CA),
/* Two-story wood and plaster house */ new MiniHouseInfo(1011310, 0x2301, 0x2302, 0x2304, 0x2303),
/* Two-story stone and plaster house */ new MiniHouseInfo(1011311, 0x22FC, 0x22FD, 0x22FF, 0x22FE),
/* Tower */ new MiniHouseInfo(1011312, 0x22F7, 0x22F8, 0x22FA, 0x22F9),
/* Small stone keep */ new MiniHouseInfo(0x22E6, 9, 1011313),
/* Stone and plaster house */ new(0x22C4, 1, 1011303),
/* Field stone house */ new(0x22DE, 1, 1011304),
/* Small brick house */ new(0x22DF, 1, 1011305),
/* Wooden house */ new(0x22C9, 1, 1011306),
/* Wood and plaster house */ new(0x22E0, 1, 1011307),
/* Thatched-roof cottage */ new(0x22E1, 1, 1011308),
/* Brick house */ new(1011309, 0x22CD, 0x22CB, 0x22CC, 0x22CA),
/* Two-story wood and plaster house */ new(1011310, 0x2301, 0x2302, 0x2304, 0x2303),
/* Two-story stone and plaster house */ new(1011311, 0x22FC, 0x22FD, 0x22FF, 0x22FE),
/* Tower */ new(1011312, 0x22F7, 0x22F8, 0x22FA, 0x22F9),
/* Small stone keep */ new(0x22E6, 9, 1011313),
/* Castle */
new MiniHouseInfo(
new(
1011314,
0x22CE,
0x22D0,
@ -214,16 +214,16 @@ namespace Server.Items
0x22DC,
0x22DD
),
/* Large house with patio */ new MiniHouseInfo(0x22E2, 4, 1011315),
/* Marble house with patio */ new MiniHouseInfo(0x22EF, 4, 1011316),
/* Small stone tower */ new MiniHouseInfo(0x22F5, 1, 1011317),
/* Two-story log cabin */ new MiniHouseInfo(0x22FB, 1, 1011318),
/* Two-story villa */ new MiniHouseInfo(0x2300, 1, 1011319),
/* Sandstone house with patio */ new MiniHouseInfo(0x22F3, 1, 1011320),
/* Small stone workshop */ new MiniHouseInfo(0x22F6, 1, 1011321),
/* Small marble workshop */ new MiniHouseInfo(0x22F4, 1, 1011322),
/* Malas Mountain Pass */ new MiniHouseInfo(1062692, 0x2316, 0x2315, 0x2314, 0x2313),
/* Church At Night */ new MiniHouseInfo(1072215, 0x2318, 0x2317, 0x2319, 0x1)
/* Large house with patio */ new(0x22E2, 4, 1011315),
/* Marble house with patio */ new(0x22EF, 4, 1011316),
/* Small stone tower */ new(0x22F5, 1, 1011317),
/* Two-story log cabin */ new(0x22FB, 1, 1011318),
/* Two-story villa */ new(0x2300, 1, 1011319),
/* Sandstone house with patio */ new(0x22F3, 1, 1011320),
/* Small stone workshop */ new(0x22F6, 1, 1011321),
/* Small marble workshop */ new(0x22F4, 1, 1011322),
/* Malas Mountain Pass */ new(1062692, 0x2316, 0x2315, 0x2314, 0x2313),
/* Church At Night */ new(1072215, 0x2318, 0x2317, 0x2319, 0x1)
};
public MiniHouseInfo(int start, int count, int labelNumber)

View file

@ -54,46 +54,46 @@ namespace Server.Items
{
private static readonly MonsterStatuetteInfo[] m_Table =
{
/* Crocodile */ new MonsterStatuetteInfo(1041249, 0x20DA, 660),
/* Daemon */ new MonsterStatuetteInfo(1041250, 0x20D3, 357),
/* Dragon */ new MonsterStatuetteInfo(1041251, 0x20D6, 362),
/* EarthElemental */ new MonsterStatuetteInfo(1041252, 0x20D7, 268),
/* Ettin */ new MonsterStatuetteInfo(1041253, 0x20D8, 367),
/* Gargoyle */ new MonsterStatuetteInfo(1041254, 0x20D9, 372),
/* Gorilla */ new MonsterStatuetteInfo(1041255, 0x20F5, 158),
/* Lich */ new MonsterStatuetteInfo(1041256, 0x20F8, 1001),
/* Lizardman */ new MonsterStatuetteInfo(1041257, 0x20DE, 417),
/* Ogre */ new MonsterStatuetteInfo(1041258, 0x20DF, 427),
/* Orc */ new MonsterStatuetteInfo(1041259, 0x20E0, 1114),
/* Ratman */ new MonsterStatuetteInfo(1041260, 0x20E3, 437),
/* Skeleton */ new MonsterStatuetteInfo(1041261, 0x20E7, 1165),
/* Troll */ new MonsterStatuetteInfo(1041262, 0x20E9, 461),
/* Cow */ new MonsterStatuetteInfo(1041263, 0x2103, 120),
/* Zombie */ new MonsterStatuetteInfo(1041264, 0x20EC, 471),
/* Llama */ new MonsterStatuetteInfo(1041265, 0x20F6, 1011),
/* Ophidian */ new MonsterStatuetteInfo(1049742, 0x2133, 634),
/* Reaper */ new MonsterStatuetteInfo(1049743, 0x20FA, 442),
/* Mongbat */ new MonsterStatuetteInfo(1049744, 0x20F9, 422),
/* Gazer */ new MonsterStatuetteInfo(1049768, 0x20F4, 377),
/* FireElemental */ new MonsterStatuetteInfo(1049769, 0x20F3, 838),
/* Wolf */ new MonsterStatuetteInfo(1049770, 0x2122, 229),
/* Phillip's Steed */ new MonsterStatuetteInfo(1063488, 0x3FFE, 168),
/* Seahorse */ new MonsterStatuetteInfo(1070819, 0x25BA, 138),
/* Harrower */ new MonsterStatuetteInfo(1080520, 0x25BB, new[] { 0x289, 0x28A, 0x28B }),
/* Efreet */ new MonsterStatuetteInfo(1080521, 0x2590, 0x300),
/* Slime */ new MonsterStatuetteInfo(1015246, 0x20E8, 456),
/* PlagueBeast */ new MonsterStatuetteInfo(1029747, 0x2613, 0x1BF),
/* RedDeath */ new MonsterStatuetteInfo(1094932, 0x2617, Array.Empty<int>()),
/* Spider */ new MonsterStatuetteInfo(1029668, 0x25C4, 1170),
/* OphidianArchMage */ new MonsterStatuetteInfo(1029641, 0x25A9, 639),
/* OphidianWarrior */ new MonsterStatuetteInfo(1029645, 0x25AD, 634),
/* OphidianKnight */ new MonsterStatuetteInfo(1029642, 0x25aa, 634),
/* OphidianMage */ new MonsterStatuetteInfo(1029643, 0x25ab, 639),
/* DreadHorn */ new MonsterStatuetteInfo(1031651, 0x2D83, 0xA8),
/* Minotaur */ new MonsterStatuetteInfo(1031657, 0x2D89, 0x596),
/* Black Cat */ new MonsterStatuetteInfo(1096928, 0x4688, 0x69),
/* HalloweenGhoul */ new MonsterStatuetteInfo(1076782, 0x2109, 0x482),
/* Santa */ new MonsterStatuetteInfo(1097968, 0x4A98, 0x669)
/* Crocodile */ new(1041249, 0x20DA, 660),
/* Daemon */ new(1041250, 0x20D3, 357),
/* Dragon */ new(1041251, 0x20D6, 362),
/* EarthElemental */ new(1041252, 0x20D7, 268),
/* Ettin */ new(1041253, 0x20D8, 367),
/* Gargoyle */ new(1041254, 0x20D9, 372),
/* Gorilla */ new(1041255, 0x20F5, 158),
/* Lich */ new(1041256, 0x20F8, 1001),
/* Lizardman */ new(1041257, 0x20DE, 417),
/* Ogre */ new(1041258, 0x20DF, 427),
/* Orc */ new(1041259, 0x20E0, 1114),
/* Ratman */ new(1041260, 0x20E3, 437),
/* Skeleton */ new(1041261, 0x20E7, 1165),
/* Troll */ new(1041262, 0x20E9, 461),
/* Cow */ new(1041263, 0x2103, 120),
/* Zombie */ new(1041264, 0x20EC, 471),
/* Llama */ new(1041265, 0x20F6, 1011),
/* Ophidian */ new(1049742, 0x2133, 634),
/* Reaper */ new(1049743, 0x20FA, 442),
/* Mongbat */ new(1049744, 0x20F9, 422),
/* Gazer */ new(1049768, 0x20F4, 377),
/* FireElemental */ new(1049769, 0x20F3, 838),
/* Wolf */ new(1049770, 0x2122, 229),
/* Phillip's Steed */ new(1063488, 0x3FFE, 168),
/* Seahorse */ new(1070819, 0x25BA, 138),
/* Harrower */ new(1080520, 0x25BB, new[] { 0x289, 0x28A, 0x28B }),
/* Efreet */ new(1080521, 0x2590, 0x300),
/* Slime */ new(1015246, 0x20E8, 456),
/* PlagueBeast */ new(1029747, 0x2613, 0x1BF),
/* RedDeath */ new(1094932, 0x2617, Array.Empty<int>()),
/* Spider */ new(1029668, 0x25C4, 1170),
/* OphidianArchMage */ new(1029641, 0x25A9, 639),
/* OphidianWarrior */ new(1029645, 0x25AD, 634),
/* OphidianKnight */ new(1029642, 0x25aa, 634),
/* OphidianMage */ new(1029643, 0x25ab, 639),
/* DreadHorn */ new(1031651, 0x2D83, 0xA8),
/* Minotaur */ new(1031657, 0x2D89, 0x596),
/* Black Cat */ new(1096928, 0x4688, 0x69),
/* HalloweenGhoul */ new(1076782, 0x2109, 0x482),
/* Santa */ new(1097968, 0x4A98, 0x669)
};
public MonsterStatuetteInfo(int labelNumber, int itemID, int baseSoundID)

View file

@ -460,7 +460,7 @@ namespace Server.Items
private class PetSummoningSpell : Spell
{
private static readonly SpellInfo m_Info = new SpellInfo("Ball Of Summoning", "", 230);
private static readonly SpellInfo m_Info = new("Ball Of Summoning", "", 230);
private readonly BallOfSummoning m_Ball;
private readonly Mobile m_Caster;

View file

@ -65,7 +65,7 @@ namespace Server.Items
};
*/
private static readonly List<SkillName> _Skills = new List<SkillName>();
private static readonly List<SkillName> _Skills = new();
[Constructible]
public PowerScroll(SkillName skill = SkillName.Alchemy, double value = 0.0) : base(skill, value)

View file

@ -31,7 +31,7 @@ namespace Server.Items
$"<basefont color=#FFFFFF>Scroll of Transcendence ({Value} Skill):</basefont>";
public static ScrollofTranscendence CreateRandom(int min, int max) =>
new ScrollofTranscendence(Utility.RandomSkill(), Utility.RandomMinMax(min, max) * 0.1);
new(Utility.RandomSkill(), Utility.RandomMinMax(min, max) * 0.1);
public override void GetProperties(ObjectPropertyList list)
{

View file

@ -89,7 +89,7 @@ namespace Server.Items
{
if (!Deleted)
{
if (targeted != null && targeted is Mobile to)
if (targeted is Mobile to)
{
if (to is PlayerMobile)
{