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

@ -5,7 +5,7 @@ namespace Server.Engines.MLQuests.Items
{
public class BedlamTeleporter : Item
{
private static readonly Point3D PointDest = new Point3D(120, 1682, 0);
private static readonly Point3D PointDest = new(120, 1682, 0);
private static readonly Map MapDest = Map.Malas;
public BedlamTeleporter()

View file

@ -19,15 +19,15 @@ namespace Server.Engines.MLQuests
{
public static readonly TextDefinition
CompletionNoticeDefault =
new TextDefinition(1072273); // You've completed a quest! Don't forget to collect your reward.
new(1072273); // You've completed a quest! Don't forget to collect your reward.
public static readonly TextDefinition CompletionNoticeShort = new TextDefinition(1046258); // Your quest is complete.
public static readonly TextDefinition CompletionNoticeShort = new(1046258); // Your quest is complete.
public static readonly TextDefinition
CompletionNoticeShortReturn = new TextDefinition(1073775); // Your quest is complete. Return for your reward.
CompletionNoticeShortReturn = new(1073775); // Your quest is complete. Return for your reward.
public static readonly TextDefinition
CompletionNoticeCraft = new TextDefinition(1073967); // You obtained what you seek, now receive your reward.
CompletionNoticeCraft = new(1073967); // You obtained what you seek, now receive your reward.
public MLQuest()
{
@ -109,7 +109,7 @@ namespace Server.Engines.MLQuests
}
public MLQuestInstance CreateInstance(IQuestGiver quester, PlayerMobile pm) =>
new MLQuestInstance(this, quester, pm);
new(this, quester, pm);
public bool CanOffer(IQuestGiver quester, PlayerMobile pm, bool message) =>
CanOffer(quester, pm, MLQuestSystem.GetContext(pm), message);

View file

@ -563,7 +563,7 @@ namespace Server.Engines.MLQuests
BaseObjectiveInstance.Deserialize(
reader,
version,
instance != null && i < instance.Objectives.Length ? instance.Objectives[i] : null
i < instance?.Objectives.Length ? instance.Objectives[i] : null
);
}

View file

@ -21,8 +21,8 @@ namespace Server.Engines.MLQuests
public static readonly bool AutoGenerateNew = true;
public static readonly bool Debug = false;
public static readonly List<MLQuest> EmptyList = new List<MLQuest>();
private static readonly List<MLQuest> m_EligiblePool = new List<MLQuest>();
public static readonly List<MLQuest> EmptyList = new();
private static readonly List<MLQuest> m_EligiblePool = new();
static MLQuestSystem()
{

View file

@ -7,7 +7,7 @@ namespace Server.Engines.MLQuests
public class QuesterNameAttribute : Attribute
{
private static readonly Type m_Type = typeof(QuesterNameAttribute);
private static readonly Dictionary<Type, string> m_Cache = new Dictionary<Type, string>();
private static readonly Dictionary<Type, string> m_Cache = new();
public QuesterNameAttribute(string questerName) => QuesterName = questerName;

View file

@ -9,33 +9,33 @@ namespace Server.Engines.MLQuests.Rewards
public class ItemReward : BaseReward
{
public static readonly ItemReward
SmallBagOfTrinkets = new ItemReward(1072268, typeof(SmallBagOfTrinkets)); // A small bag of trinkets.
SmallBagOfTrinkets = new(1072268, typeof(SmallBagOfTrinkets)); // A small bag of trinkets.
public static readonly ItemReward
BagOfTrinkets = new ItemReward(1072341, typeof(BagOfTrinkets)); // A bag of trinkets.
BagOfTrinkets = new(1072341, typeof(BagOfTrinkets)); // A bag of trinkets.
public static readonly ItemReward
BagOfTreasure = new ItemReward(1072583, typeof(BagOfTreasure)); // A bag of treasure.
BagOfTreasure = new(1072583, typeof(BagOfTreasure)); // A bag of treasure.
public static readonly ItemReward
LargeBagOfTreasure = new ItemReward(1072706, typeof(LargeBagOfTreasure)); // A large bag of treasure.
LargeBagOfTreasure = new(1072706, typeof(LargeBagOfTreasure)); // A large bag of treasure.
public static readonly ItemReward Strongbox = new ItemReward(1072584, typeof(RewardStrongbox)); // A strongbox.
public static readonly ItemReward Strongbox = new(1072584, typeof(RewardStrongbox)); // A strongbox.
public static readonly ItemReward
TailorSatchel = new ItemReward(1074282, typeof(TailorSatchel)); // Craftsman's Satchel
TailorSatchel = new(1074282, typeof(TailorSatchel)); // Craftsman's Satchel
public static readonly ItemReward
BlacksmithSatchel = new ItemReward(1074282, typeof(BlacksmithSatchel)); // Craftsman's Satchel
BlacksmithSatchel = new(1074282, typeof(BlacksmithSatchel)); // Craftsman's Satchel
public static readonly ItemReward
FletchingSatchel = new ItemReward(1074282, typeof(FletchingSatchel)); // Craftsman's Satchel
FletchingSatchel = new(1074282, typeof(FletchingSatchel)); // Craftsman's Satchel
public static readonly ItemReward
CarpentrySatchel = new ItemReward(1074282, typeof(CarpentrySatchel)); // Craftsman's Satchel
CarpentrySatchel = new(1074282, typeof(CarpentrySatchel)); // Craftsman's Satchel
public static readonly ItemReward
TinkerSatchel = new ItemReward(1074282, typeof(TinkerSatchel)); // Craftsman's Satchel
TinkerSatchel = new(1074282, typeof(TinkerSatchel)); // Craftsman's Satchel
private readonly int m_Amount;