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

@ -19,36 +19,36 @@ namespace Benchmarks
{ {
m_States = new List<BuyItemState> m_States = new List<BuyItemState>
{ {
new BuyItemState("Name 1", 0x1000, 0x2000, 1000, 1, 10, 1024), new("Name 1", 0x1000, 0x2000, 1000, 1, 10, 1024),
new BuyItemState("Name 2", 0x1001, 0x2001, 1001, 1, 10, 1024), new("Name 2", 0x1001, 0x2001, 1001, 1, 10, 1024),
new BuyItemState("Name 3", 0x1002, 0x2002, 1002, 1, 10, 1024), new("Name 3", 0x1002, 0x2002, 1002, 1, 10, 1024),
new BuyItemState("Name 4", 0x1003, 0x2003, 1003, 1, 10, 1024), new("Name 4", 0x1003, 0x2003, 1003, 1, 10, 1024),
new BuyItemState("Name 5", 0x1004, 0x2004, 1004, 1, 10, 1024), new("Name 5", 0x1004, 0x2004, 1004, 1, 10, 1024),
new BuyItemState("Name 6", 0x1005, 0x2005, 1005, 1, 10, 1024), new("Name 6", 0x1005, 0x2005, 1005, 1, 10, 1024),
new BuyItemState("Name 7", 0x1006, 0x2006, 1006, 1, 10, 1024), new("Name 7", 0x1006, 0x2006, 1006, 1, 10, 1024),
new BuyItemState("Name 8", 0x1007, 0x2007, 1007, 1, 10, 1024), new("Name 8", 0x1007, 0x2007, 1007, 1, 10, 1024),
new BuyItemState("Name 9", 0x1008, 0x2008, 1008, 1, 10, 1024), new("Name 9", 0x1008, 0x2008, 1008, 1, 10, 1024),
new BuyItemState("Name A", 0x1009, 0x2009, 1009, 1, 10, 1024), new("Name A", 0x1009, 0x2009, 1009, 1, 10, 1024),
new BuyItemState("Name 10", 0x1000, 0x2000, 1000, 1, 10, 1024), new("Name 10", 0x1000, 0x2000, 1000, 1, 10, 1024),
new BuyItemState("Name 20", 0x1001, 0x2001, 1001, 1, 10, 1024), new("Name 20", 0x1001, 0x2001, 1001, 1, 10, 1024),
new BuyItemState("Name 30", 0x1002, 0x2002, 1002, 1, 10, 1024), new("Name 30", 0x1002, 0x2002, 1002, 1, 10, 1024),
new BuyItemState("Name 40", 0x1003, 0x2003, 1003, 1, 10, 1024), new("Name 40", 0x1003, 0x2003, 1003, 1, 10, 1024),
new BuyItemState("Name 50", 0x1004, 0x2004, 1004, 1, 10, 1024), new("Name 50", 0x1004, 0x2004, 1004, 1, 10, 1024),
new BuyItemState("Name 60", 0x1005, 0x2005, 1005, 1, 10, 1024), new("Name 60", 0x1005, 0x2005, 1005, 1, 10, 1024),
new BuyItemState("Name 70", 0x1006, 0x2006, 1006, 1, 10, 1024), new("Name 70", 0x1006, 0x2006, 1006, 1, 10, 1024),
new BuyItemState("Name 80", 0x1007, 0x2007, 1007, 1, 10, 1024), new("Name 80", 0x1007, 0x2007, 1007, 1, 10, 1024),
new BuyItemState("Name 90", 0x1008, 0x2008, 1008, 1, 10, 1024), new("Name 90", 0x1008, 0x2008, 1008, 1, 10, 1024),
new BuyItemState("Name A0", 0x1009, 0x2009, 1009, 1, 10, 1024), new("Name A0", 0x1009, 0x2009, 1009, 1, 10, 1024),
new BuyItemState("Name 11", 0x1000, 0x2000, 1000, 1, 10, 1024), new("Name 11", 0x1000, 0x2000, 1000, 1, 10, 1024),
new BuyItemState("Name 21", 0x1001, 0x2001, 1001, 1, 10, 1024), new("Name 21", 0x1001, 0x2001, 1001, 1, 10, 1024),
new BuyItemState("Name 31", 0x1002, 0x2002, 1002, 1, 10, 1024), new("Name 31", 0x1002, 0x2002, 1002, 1, 10, 1024),
new BuyItemState("Name 41", 0x1003, 0x2003, 1003, 1, 10, 1024), new("Name 41", 0x1003, 0x2003, 1003, 1, 10, 1024),
new BuyItemState("Name 51", 0x1004, 0x2004, 1004, 1, 10, 1024), new("Name 51", 0x1004, 0x2004, 1004, 1, 10, 1024),
new BuyItemState("Name 61", 0x1005, 0x2005, 1005, 1, 10, 1024), new("Name 61", 0x1005, 0x2005, 1005, 1, 10, 1024),
new BuyItemState("Name 71", 0x1006, 0x2006, 1006, 1, 10, 1024), new("Name 71", 0x1006, 0x2006, 1006, 1, 10, 1024),
new BuyItemState("Name 81", 0x1007, 0x2007, 1007, 1, 10, 1024), new("Name 81", 0x1007, 0x2007, 1007, 1, 10, 1024),
new BuyItemState("Name 91", 0x1008, 0x2008, 1008, 1, 10, 1024), new("Name 91", 0x1008, 0x2008, 1008, 1, 10, 1024),
new BuyItemState("Name A1", 0x1009, 0x2009, 1009, 1, 10, 1024) new("Name A1", 0x1009, 0x2009, 1009, 1, 10, 1024)
}; };
} }

View file

@ -17,9 +17,9 @@ namespace Server.Tests.Network
var buyStates = new List<BuyItemState> var buyStates = new List<BuyItemState>
{ {
new BuyItemState("First Item", cont.Serial, World.NewItem, 10, 1, 0x01, 0), new("First Item", cont.Serial, World.NewItem, 10, 1, 0x01, 0),
new BuyItemState("Second Item", cont.Serial, World.NewItem, 20, 2, 0x0A, 0), new("Second Item", cont.Serial, World.NewItem, 20, 2, 0x0A, 0),
new BuyItemState("Third Item", cont.Serial, World.NewItem, 30, 10, 0x0F, 0) new("Third Item", cont.Serial, World.NewItem, 30, 10, 0x0F, 0)
}; };
var data = new VendorBuyContent(buyStates).Compile(); var data = new VendorBuyContent(buyStates).Compile();
@ -56,9 +56,9 @@ namespace Server.Tests.Network
var buyStates = new List<BuyItemState> var buyStates = new List<BuyItemState>
{ {
new BuyItemState("First Item", cont.Serial, World.NewItem, 10, 1, 0x01, 0), new("First Item", cont.Serial, World.NewItem, 10, 1, 0x01, 0),
new BuyItemState("Second Item", cont.Serial, World.NewItem, 20, 2, 0x0A, 0), new("Second Item", cont.Serial, World.NewItem, 20, 2, 0x0A, 0),
new BuyItemState("Third Item", cont.Serial, World.NewItem, 30, 10, 0x0F, 0) new("Third Item", cont.Serial, World.NewItem, 30, 10, 0x0F, 0)
}; };
var data = new VendorBuyContent6017(buyStates).Compile(); var data = new VendorBuyContent6017(buyStates).Compile();
@ -143,9 +143,9 @@ namespace Server.Tests.Network
var buyStates = new List<BuyItemState> var buyStates = new List<BuyItemState>
{ {
new BuyItemState("First Item", cont.Serial, World.NewItem, 10, 1, 0x01, 0), new("First Item", cont.Serial, World.NewItem, 10, 1, 0x01, 0),
new BuyItemState("Second Item", cont.Serial, World.NewItem, 20, 2, 0x0A, 0), new("Second Item", cont.Serial, World.NewItem, 20, 2, 0x0A, 0),
new BuyItemState("Third Item", cont.Serial, World.NewItem, 30, 10, 0x0F, 0) new("Third Item", cont.Serial, World.NewItem, 30, 10, 0x0F, 0)
}; };
var data = new VendorBuyList(vendor, buyStates).Compile(); var data = new VendorBuyList(vendor, buyStates).Compile();

View file

@ -21,9 +21,9 @@ namespace Server.Tests.Network
var sellStates = new List<SellItemState> var sellStates = new List<SellItemState>
{ {
new SellItemState(item1, 100, "Item 1"), new(item1, 100, "Item 1"),
new SellItemState(item2, 100000, "Item 2"), new(item2, 100000, "Item 2"),
new SellItemState(item3, 1, "Item 3") new(item3, 1, "Item 3")
}; };
var data = new VendorSellList(vendor, sellStates).Compile(); var data = new VendorSellList(vendor, sellStates).Compile();

View file

@ -9,6 +9,6 @@ namespace Server.Tests.Network
p.Compile(false, out var length).AsSpan(0, length); p.Compile(false, out var length).AsSpan(0, length);
public static NetState CreateTestNetState() => public static NetState CreateTestNetState() =>
new NetState(new MockSocket()); new(new MockSocket());
} }
} }

View file

@ -24,7 +24,7 @@ namespace Server
{ {
public static class AssemblyHandler public static class AssemblyHandler
{ {
private static readonly Dictionary<Assembly, TypeCache> m_TypeCaches = new Dictionary<Assembly, TypeCache>(); private static readonly Dictionary<Assembly, TypeCache> m_TypeCaches = new();
private static TypeCache m_NullCache; private static TypeCache m_NullCache;
public static Assembly[] Assemblies { get; set; } public static Assembly[] Assemblies { get; set; }
@ -158,7 +158,7 @@ namespace Server
public class TypeCache public class TypeCache
{ {
private readonly Dictionary<string, int[]> m_NameMap = new Dictionary<string, int[]>(); private readonly Dictionary<string, int[]> m_NameMap = new();
private readonly Type[] m_Types; private readonly Type[] m_Types;
public TypeCache(Assembly asm) public TypeCache(Assembly asm)

View file

@ -21,7 +21,7 @@ namespace Server.Collections
{ {
public class ArraySet<T> : IList<T> public class ArraySet<T> : IList<T>
{ {
private readonly List<T> m_List = new List<T>(); private readonly List<T> m_List = new();
public T this[int index] public T this[int index]
{ {

View file

@ -6,7 +6,7 @@ namespace Server
{ {
public delegate void CommandEventHandler(CommandEventArgs e); public delegate void CommandEventHandler(CommandEventArgs e);
public class CommandEventArgs : EventArgs public class CommandEventArgs
{ {
public CommandEventArgs(Mobile mobile, string command, string argString, string[] arguments) public CommandEventArgs(Mobile mobile, string command, string argString, string[] arguments)
{ {
@ -116,7 +116,7 @@ namespace Server
public static string Prefix { get; set; } = "["; public static string Prefix { get; set; } = "[";
public static Dictionary<string, CommandEntry> Entries { get; } = public static Dictionary<string, CommandEntry> Entries { get; } =
new Dictionary<string, CommandEntry>(StringComparer.OrdinalIgnoreCase); new(StringComparer.OrdinalIgnoreCase);
public static AccessLevel BadCommandIgnoreLevel { get; set; } = AccessLevel.Player; public static AccessLevel BadCommandIgnoreLevel { get; set; } = AccessLevel.Player;

View file

@ -303,13 +303,13 @@ namespace Server
internal class ServerSettings internal class ServerSettings
{ {
[JsonPropertyName("dataDirectories")] [JsonPropertyName("dataDirectories")]
public List<string> dataDirectories { get; set; } = new List<string>(); public List<string> dataDirectories { get; set; } = new();
[JsonPropertyName("listeners")] [JsonPropertyName("listeners")]
public List<IPEndPoint> listeners { get; set; } = new List<IPEndPoint>(); public List<IPEndPoint> listeners { get; set; } = new();
[JsonPropertyName("settings")] [JsonPropertyName("settings")]
public SortedDictionary<string, string> settings { get; set; } = new SortedDictionary<string, string>(); public SortedDictionary<string, string> settings { get; set; } = new();
} }
} }
} }

View file

@ -5,7 +5,7 @@ namespace Server.Diagnostics
{ {
public class GumpProfile : BaseProfile public class GumpProfile : BaseProfile
{ {
private static readonly Dictionary<Type, GumpProfile> _profiles = new Dictionary<Type, GumpProfile>(); private static readonly Dictionary<Type, GumpProfile> _profiles = new();
public GumpProfile(Type type) : base(type.FullName) public GumpProfile(Type type) : base(type.FullName)
{ {

View file

@ -33,7 +33,7 @@ namespace Server.Diagnostics
public class PacketSendProfile : BasePacketProfile public class PacketSendProfile : BasePacketProfile
{ {
private static readonly Dictionary<Type, PacketSendProfile> _profiles = new Dictionary<Type, PacketSendProfile>(); private static readonly Dictionary<Type, PacketSendProfile> _profiles = new();
private long _created; private long _created;
@ -70,7 +70,7 @@ namespace Server.Diagnostics
public class PacketReceiveProfile : BasePacketProfile public class PacketReceiveProfile : BasePacketProfile
{ {
private static readonly Dictionary<int, PacketReceiveProfile> private static readonly Dictionary<int, PacketReceiveProfile>
_profiles = new Dictionary<int, PacketReceiveProfile>(); _profiles = new();
public PacketReceiveProfile(int packetId) public PacketReceiveProfile(int packetId)
: base($"0x{packetId:X2}") : base($"0x{packetId:X2}")

View file

@ -5,7 +5,7 @@ namespace Server.Diagnostics
{ {
public class TargetProfile : BaseProfile public class TargetProfile : BaseProfile
{ {
private static readonly Dictionary<Type, TargetProfile> _profiles = new Dictionary<Type, TargetProfile>(); private static readonly Dictionary<Type, TargetProfile> _profiles = new();
public TargetProfile(Type type) public TargetProfile(Type type)
: base(type.FullName) : base(type.FullName)

View file

@ -5,7 +5,7 @@ namespace Server.Diagnostics
{ {
public class TimerProfile : BaseProfile public class TimerProfile : BaseProfile
{ {
private static readonly Dictionary<string, TimerProfile> _profiles = new Dictionary<string, TimerProfile>(); private static readonly Dictionary<string, TimerProfile> _profiles = new();
public TimerProfile(string name) public TimerProfile(string name)
: base(name) : base(name)

View file

@ -18,7 +18,7 @@ using Server.Network;
namespace Server namespace Server
{ {
public class AccountLoginEventArgs : EventArgs public class AccountLoginEventArgs
{ {
public AccountLoginEventArgs(NetState state, string username, string password) public AccountLoginEventArgs(NetState state, string username, string password)
{ {

View file

@ -20,7 +20,7 @@ namespace Server
{ {
public class AggressiveActionEventArgs : EventArgs public class AggressiveActionEventArgs : EventArgs
{ {
private static readonly Queue<AggressiveActionEventArgs> m_Pool = new Queue<AggressiveActionEventArgs>(); private static readonly Queue<AggressiveActionEventArgs> m_Pool = new();
private AggressiveActionEventArgs(Mobile aggressed, Mobile aggressor, bool criminal) private AggressiveActionEventArgs(Mobile aggressed, Mobile aggressor, bool criminal)
{ {

View file

@ -19,7 +19,7 @@ using Server.Network;
namespace Server namespace Server
{ {
public class CharacterCreatedEventArgs : EventArgs public class CharacterCreatedEventArgs
{ {
public CharacterCreatedEventArgs( public CharacterCreatedEventArgs(
NetState state, IAccount a, string name, bool female, int hue, int str, int dex, NetState state, IAccount a, string name, bool female, int hue, int str, int dex,

View file

@ -18,7 +18,7 @@ using Server.Network;
namespace Server namespace Server
{ {
public class GameLoginEventArgs : EventArgs public class GameLoginEventArgs
{ {
public GameLoginEventArgs(NetState state, string un, string pw) public GameLoginEventArgs(NetState state, string un, string pw)
{ {

View file

@ -20,7 +20,7 @@ namespace Server
{ {
public class MovementEventArgs : EventArgs public class MovementEventArgs : EventArgs
{ {
private static readonly Queue<MovementEventArgs> m_Pool = new Queue<MovementEventArgs>(); private static readonly Queue<MovementEventArgs> m_Pool = new();
public MovementEventArgs(Mobile mobile, Direction dir) public MovementEventArgs(Mobile mobile, Direction dir)
{ {

View file

@ -17,7 +17,7 @@ using System;
namespace Server namespace Server
{ {
public class ServerCrashedEventArgs : EventArgs public class ServerCrashedEventArgs
{ {
public ServerCrashedEventArgs(Exception e) => Exception = e; public ServerCrashedEventArgs(Exception e) => Exception = e;

View file

@ -21,7 +21,7 @@ using Server.Network;
namespace Server namespace Server
{ {
public class ServerListEventArgs : EventArgs public class ServerListEventArgs
{ {
public ServerListEventArgs(NetState state, IAccount account) public ServerListEventArgs(NetState state, IAccount account)
{ {

View file

@ -18,7 +18,7 @@ using System.Net.Sockets;
namespace Server namespace Server
{ {
public class SocketConnectEventArgs : EventArgs public class SocketConnectEventArgs
{ {
public SocketConnectEventArgs(Socket c) public SocketConnectEventArgs(Socket c)
{ {

View file

@ -18,7 +18,7 @@ using Server.Network;
namespace Server namespace Server
{ {
public class SpeechEventArgs : EventArgs public class SpeechEventArgs
{ {
public SpeechEventArgs(Mobile mobile, string speech, MessageType type, int hue, int[] keywords) public SpeechEventArgs(Mobile mobile, string speech, MessageType type, int hue, int[] keywords)
{ {

View file

@ -25,7 +25,7 @@ namespace Server
internal int m_X; internal int m_X;
internal int m_Y; internal int m_Y;
public static readonly Point2D Zero = new Point2D(0, 0); public static readonly Point2D Zero = new(0, 0);
[CommandProperty(AccessLevel.Counselor)] [CommandProperty(AccessLevel.Counselor)]
public int X public int X
@ -71,7 +71,7 @@ namespace Server
public bool Equals(Point2D other) => m_X == other.m_X && m_Y == other.m_Y; public bool Equals(Point2D other) => m_X == other.m_X && m_Y == other.m_Y;
public bool Equals(IPoint2D other) => public bool Equals(IPoint2D other) =>
!ReferenceEquals(other, null) && m_X == other.X && m_Y == other.Y; m_X == other?.X && m_Y == other.Y;
public override bool Equals(object obj) => obj is Point2D other && Equals(other); public override bool Equals(object obj) => obj is Point2D other && Equals(other);

View file

@ -26,7 +26,7 @@ namespace Server
internal int m_Y; internal int m_Y;
internal int m_Z; internal int m_Z;
public static readonly Point3D Zero = new Point3D(0, 0, 0); public static readonly Point3D Zero = new(0, 0, 0);
[CommandProperty(AccessLevel.Counselor)] [CommandProperty(AccessLevel.Counselor)]
public int X public int X
@ -69,7 +69,7 @@ namespace Server
public bool Equals(Point3D other) => m_X == other.m_X && m_Y == other.m_Y && m_Z == other.m_Z; public bool Equals(Point3D other) => m_X == other.m_X && m_Y == other.m_Y && m_Z == other.m_Z;
public bool Equals(IPoint3D other) => public bool Equals(IPoint3D other) =>
!ReferenceEquals(other, null) && m_X == other.X && m_Y == other.Y && m_Z == other.Z; m_X == other?.X && m_Y == other.Y && m_Z == other.Z;
public override bool Equals(object obj) => obj is Point3D other && Equals(other); public override bool Equals(object obj) => obj is Point3D other && Equals(other);

View file

@ -25,7 +25,7 @@ namespace Server
internal Point3D m_Loc; internal Point3D m_Loc;
internal Map m_Map; internal Map m_Map;
public static readonly WorldLocation Zero = new WorldLocation(0, 0, 0, Map.Internal); public static readonly WorldLocation Zero = new(0, 0, 0, Map.Internal);
[CommandProperty(AccessLevel.Counselor)] [CommandProperty(AccessLevel.Counselor)]
public Point3D Location public Point3D Location

View file

@ -16,8 +16,8 @@ namespace Server.Items
public class Container : Item public class Container : Item
{ {
private static readonly QueuePool m_QueuePool = new QueuePool(QueueRef<Container>.Generate, 2, 5); private static readonly QueuePool m_QueuePool = new(QueueRef<Container>.Generate, 2, 5);
private static readonly List<Item> m_FindItemsList = new List<Item>(); private static readonly List<Item> m_FindItemsList = new();
private ContainerData m_ContainerData; private ContainerData m_ContainerData;

View file

@ -194,9 +194,9 @@ namespace Server
public class Item : IHued, IComparable<Item>, ISpawnable, IPropertyListObject public class Item : IHued, IComparable<Item>, ISpawnable, IPropertyListObject
{ {
public const int QuestItemHue = 0x4EA; // Hmmmm... "for EA"? public const int QuestItemHue = 0x4EA; // Hmmmm... "for EA"?
public static readonly List<Item> EmptyItems = new List<Item>(); public static readonly List<Item> EmptyItems = new();
private static readonly List<Item> m_DeltaQueue = new List<Item>(); private static readonly List<Item> m_DeltaQueue = new();
private static bool _processing; private static bool _processing;
@ -923,7 +923,7 @@ namespace Server
flags |= SaveFlag.Parent; flags |= SaveFlag.Parent;
} }
if (items != null && items.Count > 0) if (items?.Count > 0)
{ {
flags |= SaveFlag.Items; flags |= SaveFlag.Items;
} }

View file

@ -95,9 +95,7 @@ namespace Server
public static Assembly Assembly { get; set; } public static Assembly Assembly { get; set; }
// Assembly file version // Assembly file version
public static Version Version => Version.Parse( public static Version Version => new(ThisAssembly.AssemblyFileVersion);
FileVersionInfo.GetVersionInfo(Assembly.Location).FileVersion
);
public static Process Process { get; private set; } public static Process Process { get; private set; }
@ -135,7 +133,7 @@ namespace Server
} }
} }
public static CancellationTokenSource ClosingTokenSource { get; } = new CancellationTokenSource(); public static CancellationTokenSource ClosingTokenSource { get; } = new();
public static bool Closing => ClosingTokenSource.IsCancellationRequested; public static bool Closing => ClosingTokenSource.IsCancellationRequested;

View file

@ -270,9 +270,9 @@ namespace Server
public const int SectorShift = 4; public const int SectorShift = 4;
public static readonly int SectorActiveRange = 2; public static readonly int SectorActiveRange = 2;
private static readonly Queue<List<Item>> m_FixPool = new Queue<List<Item>>(128); private static readonly Queue<List<Item>> m_FixPool = new(128);
private static readonly List<Item> m_EmptyFixItems = new List<Item>(); private static readonly List<Item> m_EmptyFixItems = new();
private readonly int m_FileIndex; private readonly int m_FileIndex;
private readonly Sector[][] m_Sectors; private readonly Sector[][] m_Sectors;
@ -280,7 +280,7 @@ namespace Server
private readonly int m_SectorsWidth; private readonly int m_SectorsWidth;
private readonly object tileLock = new object(); private readonly object tileLock = new();
private Region m_DefaultRegion; private Region m_DefaultRegion;
private string m_Name; private string m_Name;
@ -314,7 +314,7 @@ namespace Server
public static Map TerMur => Maps[5]; public static Map TerMur => Maps[5];
public static Map Internal => Maps[0x7F]; public static Map Internal => Maps[0x7F];
public static List<Map> AllMaps { get; } = new List<Map>(); public static List<Map> AllMaps { get; } = new();
public int Season { get; set; } public int Season { get; set; }
@ -1546,7 +1546,7 @@ namespace Server
public class NullEnumerable<T> : IPooledEnumerable<T> public class NullEnumerable<T> : IPooledEnumerable<T>
{ {
public static readonly NullEnumerable<T> Instance = new NullEnumerable<T>(); public static readonly NullEnumerable<T> Instance = new();
private readonly IEnumerable<T> m_Empty; private readonly IEnumerable<T> m_Empty;
@ -1563,11 +1563,11 @@ namespace Server
public sealed class PooledEnumerable<T> : IPooledEnumerable<T>, IDisposable public sealed class PooledEnumerable<T> : IPooledEnumerable<T>, IDisposable
{ {
private static readonly Queue<PooledEnumerable<T>> _Buffer = new Queue<PooledEnumerable<T>>(0x400); private static readonly Queue<PooledEnumerable<T>> _Buffer = new(0x400);
private bool m_IsDisposed; private bool m_IsDisposed;
private List<T> m_Pool = new List<T>(0x40); private List<T> m_Pool = new(0x40);
public PooledEnumerable(IEnumerable<T> pool) public PooledEnumerable(IEnumerable<T> pool)
{ {

View file

@ -7,7 +7,7 @@ namespace Server
{ {
public class AggressorInfo public class AggressorInfo
{ {
private static readonly Queue<AggressorInfo> m_Pool = new Queue<AggressorInfo>(); private static readonly Queue<AggressorInfo> m_Pool = new();
private Mobile m_Attacker, m_Defender; private Mobile m_Attacker, m_Defender;
private bool m_CanReportMurder; private bool m_CanReportMurder;
private bool m_CriminalAggression; private bool m_CriminalAggression;

View file

@ -126,7 +126,7 @@ namespace Server
public static implicit operator int(Body a) => a.BodyID; public static implicit operator int(Body a) => a.BodyID;
public static implicit operator Body(int a) => new Body(a); public static implicit operator Body(int a) => new(a);
public override string ToString() => $"0x{BodyID:X}"; public override string ToString() => $"0x{BodyID:X}";

View file

@ -3611,7 +3611,7 @@ namespace Server
Resistances[3] += BasePoisonResistance; Resistances[3] += BasePoisonResistance;
Resistances[4] += BaseEnergyResistance; Resistances[4] += BaseEnergyResistance;
for (var i = 0; ResistanceMods != null && i < ResistanceMods.Count; ++i) for (var i = 0; i < ResistanceMods?.Count; ++i)
{ {
var mod = ResistanceMods[i]; var mod = ResistanceMods[i];
var v = (int)mod.Type; var v = (int)mod.Type;

View file

@ -66,7 +66,7 @@ namespace Server
bin.Close(); bin.Close();
} }
public static Dictionary<int, MultiComponentList> Components { get; } = new Dictionary<int, MultiComponentList>(); public static Dictionary<int, MultiComponentList> Components { get; } = new();
public static MultiComponentList GetComponents(int multiID) public static MultiComponentList GetComponents(int multiID)
{ {
@ -251,7 +251,7 @@ namespace Server
public sealed class MultiComponentList public sealed class MultiComponentList
{ {
public static readonly MultiComponentList Empty = new MultiComponentList(); public static readonly MultiComponentList Empty = new();
private Point2D m_Min, m_Max; private Point2D m_Min, m_Max;

View file

@ -19,22 +19,22 @@ namespace Server.Network
{ {
public partial class NetState public partial class NetState
{ {
private static readonly ClientVersion m_Version400a = new ClientVersion("4.0.0a"); private static readonly ClientVersion m_Version400a = new("4.0.0a");
private static readonly ClientVersion m_Version407a = new ClientVersion("4.0.7a"); private static readonly ClientVersion m_Version407a = new("4.0.7a");
private static readonly ClientVersion m_Version500a = new ClientVersion("5.0.0a"); private static readonly ClientVersion m_Version500a = new("5.0.0a");
private static readonly ClientVersion m_Version502b = new ClientVersion("5.0.2b"); private static readonly ClientVersion m_Version502b = new("5.0.2b");
private static readonly ClientVersion m_Version6000 = new ClientVersion("6.0.0.0"); private static readonly ClientVersion m_Version6000 = new("6.0.0.0");
private static readonly ClientVersion m_Version6017 = new ClientVersion("6.0.1.7"); private static readonly ClientVersion m_Version6017 = new("6.0.1.7");
private static readonly ClientVersion m_Version60142 = new ClientVersion("6.0.14.2"); private static readonly ClientVersion m_Version60142 = new("6.0.14.2");
private static readonly ClientVersion m_Version7000 = new ClientVersion("7.0.0.0"); private static readonly ClientVersion m_Version7000 = new("7.0.0.0");
private static readonly ClientVersion m_Version7090 = new ClientVersion("7.0.9.0"); private static readonly ClientVersion m_Version7090 = new("7.0.9.0");
private static readonly ClientVersion m_Version70130 = new ClientVersion("7.0.13.0"); private static readonly ClientVersion m_Version70130 = new("7.0.13.0");
private static readonly ClientVersion m_Version70160 = new ClientVersion("7.0.16.0"); private static readonly ClientVersion m_Version70160 = new("7.0.16.0");
private static readonly ClientVersion m_Version70300 = new ClientVersion("7.0.30.0"); private static readonly ClientVersion m_Version70300 = new("7.0.30.0");
private static readonly ClientVersion m_Version70331 = new ClientVersion("7.0.33.1"); private static readonly ClientVersion m_Version70331 = new("7.0.33.1");
private static readonly ClientVersion m_Version704565 = new ClientVersion("7.0.45.65"); private static readonly ClientVersion m_Version704565 = new("7.0.45.65");
private static readonly ClientVersion m_Version70500 = new ClientVersion("7.0.50.0"); private static readonly ClientVersion m_Version70500 = new("7.0.50.0");
private static readonly ClientVersion m_Version70610 = new ClientVersion("7.0.61.0"); private static readonly ClientVersion m_Version70610 = new("7.0.61.0");
public ProtocolChanges ProtocolChanges { get; set; } public ProtocolChanges ProtocolChanges { get; set; }
public ClientFlags Flags { get; set; } public ClientFlags Flags { get; set; }

View file

@ -42,7 +42,7 @@ namespace Server.Network
private static int HuePickerCap = 512; private static int HuePickerCap = 512;
private static int MenuCap = 512; private static int MenuCap = 512;
private static readonly ConcurrentQueue<NetState> m_Disposed = new ConcurrentQueue<NetState>(); private static readonly ConcurrentQueue<NetState> m_Disposed = new();
private static NetworkState m_NetworkState = NetworkState.ResumeState; private static NetworkState m_NetworkState = NetworkState.ResumeState;
public static NetStateCreatedCallback CreatedCallback { get; set; } public static NetStateCreatedCallback CreatedCallback { get; set; }

View file

@ -20,8 +20,8 @@ namespace Server.Network
{ {
public class NetworkState public class NetworkState
{ {
public static readonly NetworkState PauseState = new NetworkState(true); public static readonly NetworkState PauseState = new(true);
public static readonly NetworkState ResumeState = new NetworkState(false); public static readonly NetworkState ResumeState = new(false);
public bool Paused { get; } public bool Paused { get; }

View file

@ -119,7 +119,7 @@ namespace Server.Network
} }
} }
private readonly object _object = new object(); private readonly object _object = new();
public byte[] Compile(bool compress, out int length) public byte[] Compile(bool compress, out int length)
{ {

View file

@ -10,7 +10,7 @@ namespace Server.Network
/// </summary> /// </summary>
public class PacketWriter public class PacketWriter
{ {
private static readonly ConcurrentQueue<PacketWriter> m_Pool = new ConcurrentQueue<PacketWriter>(); private static readonly ConcurrentQueue<PacketWriter> m_Pool = new();
/// <summary> /// <summary>
/// Internal format buffer. /// Internal format buffer.

View file

@ -24,7 +24,7 @@ namespace Server.Network
{ {
private const int m_AuthIDWindowSize = 128; private const int m_AuthIDWindowSize = 128;
private static readonly Dictionary<int, AuthIDPersistence> m_AuthIDWindow = private static readonly Dictionary<int, AuthIDPersistence> m_AuthIDWindow =
new Dictionary<int, AuthIDPersistence>(m_AuthIDWindowSize); new(m_AuthIDWindowSize);
internal struct AuthIDPersistence internal struct AuthIDPersistence
{ {

View file

@ -21,7 +21,7 @@ namespace Server.Network
public static class IncomingExtendedCommandPackets public static class IncomingExtendedCommandPackets
{ {
private static readonly PacketHandler[] m_ExtendedHandlersLow = new PacketHandler[0x100]; private static readonly PacketHandler[] m_ExtendedHandlersLow = new PacketHandler[0x100];
private static readonly Dictionary<int, PacketHandler> m_ExtendedHandlersHigh = new Dictionary<int, PacketHandler>(); private static readonly Dictionary<int, PacketHandler> m_ExtendedHandlersHigh = new();
// TODO: Change to outside configuration // TODO: Change to outside configuration
public static int[] ValidAnimations { get; set; } = public static int[] ValidAnimations { get; set; } =

View file

@ -38,7 +38,7 @@ namespace Server.Network
public static class IncomingMessagePackets public static class IncomingMessagePackets
{ {
private static readonly KeywordList m_KeywordList = new KeywordList(); private static readonly KeywordList m_KeywordList = new();
public static void Configure() public static void Configure()
{ {

View file

@ -25,7 +25,7 @@ namespace Server.Network
private static readonly EncodedPacketHandler[] m_EncodedHandlersLow = new EncodedPacketHandler[0x100]; private static readonly EncodedPacketHandler[] m_EncodedHandlersLow = new EncodedPacketHandler[0x100];
private static readonly Dictionary<int, EncodedPacketHandler> m_EncodedHandlersHigh = private static readonly Dictionary<int, EncodedPacketHandler> m_EncodedHandlersHigh =
new Dictionary<int, EncodedPacketHandler>(); new();
public static PacketHandler[] Handlers { get; } = new PacketHandler[0x100]; public static PacketHandler[] Handlers { get; } = new PacketHandler[0x100];

View file

@ -230,7 +230,7 @@ namespace Server.Network
var p = from.Prompt; var p = from.Prompt;
if (p != null && p.Serial == serial && p.Serial == prompt) if (p?.Serial == serial && p.Serial == prompt)
{ {
from.Prompt = null; from.Prompt = null;
@ -267,7 +267,7 @@ namespace Server.Network
var p = from.Prompt; var p = from.Prompt;
if (p != null && p.Serial == serial && p.Serial == prompt) if (p?.Serial == serial && p.Serial == prompt)
{ {
from.Prompt = null; from.Prompt = null;

View file

@ -541,8 +541,8 @@ namespace Server.Network
public sealed class MobileIncoming : Packet public sealed class MobileIncoming : Packet
{ {
private static readonly ThreadLocal<int[]> m_DupedLayersTL = new ThreadLocal<int[]>(() => new int[256]); private static readonly ThreadLocal<int[]> m_DupedLayersTL = new(() => new int[256]);
private static readonly ThreadLocal<int> m_VersionTL = new ThreadLocal<int>(); private static readonly ThreadLocal<int> m_VersionTL = new();
public MobileIncoming(Mobile beholder, Mobile beheld) : base(0x78) public MobileIncoming(Mobile beholder, Mobile beheld) : base(0x78)
{ {
@ -673,8 +673,8 @@ namespace Server.Network
public sealed class MobileIncomingSA : Packet public sealed class MobileIncomingSA : Packet
{ {
private static readonly ThreadLocal<int[]> m_DupedLayersTL = new ThreadLocal<int[]>(() => new int[256]); private static readonly ThreadLocal<int[]> m_DupedLayersTL = new(() => new int[256]);
private static readonly ThreadLocal<int> m_VersionTL = new ThreadLocal<int>(); private static readonly ThreadLocal<int> m_VersionTL = new();
public MobileIncomingSA(Mobile beholder, Mobile beheld) : base(0x78) public MobileIncomingSA(Mobile beholder, Mobile beheld) : base(0x78)
{ {
@ -820,8 +820,8 @@ namespace Server.Network
// Pre-7.0.0.0 Mobile Incoming // Pre-7.0.0.0 Mobile Incoming
public sealed class MobileIncomingOld : Packet public sealed class MobileIncomingOld : Packet
{ {
private static readonly ThreadLocal<int[]> m_DupedLayersTL = new ThreadLocal<int[]>(() => new int[256]); private static readonly ThreadLocal<int[]> m_DupedLayersTL = new(() => new int[256]);
private static readonly ThreadLocal<int> m_VersionTL = new ThreadLocal<int>(); private static readonly ThreadLocal<int> m_VersionTL = new();
public MobileIncomingOld(Mobile beholder, Mobile beheld) : base(0x78) public MobileIncomingOld(Mobile beholder, Mobile beheld) : base(0x78)
{ {

View file

@ -88,7 +88,7 @@ namespace Server.Network
{ {
private readonly Pipe<T> _pipe; private readonly Pipe<T> _pipe;
private Result _result = new Result(2); private Result _result = new(2);
internal PipeWriter(Pipe<T> pipe) => _pipe = pipe; internal PipeWriter(Pipe<T> pipe) => _pipe = pipe;
@ -273,7 +273,7 @@ namespace Server.Network
{ {
private readonly Pipe<T> _pipe; private readonly Pipe<T> _pipe;
private Result _result = new Result(2); private Result _result = new(2);
internal PipeReader(Pipe<T> pipe) => _pipe = pipe; internal PipeReader(Pipe<T> pipe) => _pipe = pipe;

View file

@ -20,19 +20,19 @@ namespace Server.Network
public static class StaticPacketHandlers public static class StaticPacketHandlers
{ {
private static readonly ConcurrentDictionary<IPropertyListObject, OPLInfo> OPLInfoPackets = private static readonly ConcurrentDictionary<IPropertyListObject, OPLInfo> OPLInfoPackets =
new ConcurrentDictionary<IPropertyListObject, OPLInfo>(); new();
private static readonly ConcurrentDictionary<IEntity, RemoveEntity> RemoveEntityPackets = private static readonly ConcurrentDictionary<IEntity, RemoveEntity> RemoveEntityPackets =
new ConcurrentDictionary<IEntity, RemoveEntity>(); new();
private static readonly ConcurrentDictionary<Item, WorldItem> WorldItemPackets = private static readonly ConcurrentDictionary<Item, WorldItem> WorldItemPackets =
new ConcurrentDictionary<Item, WorldItem>(); new();
private static readonly ConcurrentDictionary<Item, WorldItemSA> WorldItemSAPackets = private static readonly ConcurrentDictionary<Item, WorldItemSA> WorldItemSAPackets =
new ConcurrentDictionary<Item, WorldItemSA>(); new();
private static readonly ConcurrentDictionary<Item, WorldItemHS> WorldItemHSPackets = private static readonly ConcurrentDictionary<Item, WorldItemHS> WorldItemHSPackets =
new ConcurrentDictionary<Item, WorldItemHS>(); new();
public static OPLInfo GetOPLInfoPacket(IPropertyListObject obj) public static OPLInfo GetOPLInfoPacket(IPropertyListObject obj)
{ {

View file

@ -39,9 +39,9 @@ namespace Server.Network
public static IPEndPoint[] ListeningAddresses { get; private set; } public static IPEndPoint[] ListeningAddresses { get; private set; }
public static TcpListener[] Listeners { get; private set; } public static TcpListener[] Listeners { get; private set; }
public static HashSet<NetState> Instances { get; } = new HashSet<NetState>(128); public static HashSet<NetState> Instances { get; } = new(128);
public static ConcurrentQueue<NetState> m_ConnectedQueue = new ConcurrentQueue<NetState>(); public static ConcurrentQueue<NetState> m_ConnectedQueue = new();
public static void Configure() public static void Configure()
{ {

View file

@ -17,7 +17,7 @@ namespace Server
public static Poison Deadly => GetPoison("Deadly"); public static Poison Deadly => GetPoison("Deadly");
public static Poison Lethal => GetPoison("Lethal"); public static Poison Lethal => GetPoison("Lethal");
public static List<Poison> Poisons { get; } = new List<Poison>(); public static List<Poison> Poisons { get; } = new();
public abstract Timer ConstructTimer(Mobile m); public abstract Timer ConstructTimer(Mobile m);
/*public abstract void OnDamage( Mobile m, ref object state );*/ /*public abstract void OnDamage( Mobile m, ref object state );*/

View file

@ -36,7 +36,7 @@ namespace Server
public static Race Elf => Races[1]; public static Race Elf => Races[1];
public static Race Gargoyle => Races[2]; public static Race Gargoyle => Races[2];
public static List<Race> AllRaces { get; } = new List<Race>(); public static List<Race> AllRaces { get; } = new();
public Expansion RequiredExpansion { get; } public Expansion RequiredExpansion { get; }

View file

@ -176,7 +176,7 @@ namespace Server
Music = json.GetEnumProperty("music", options, out MusicName music) ? music : DefaultMusic; Music = json.GetEnumProperty("music", options, out MusicName music) ? music : DefaultMusic;
} }
public static List<Region> Regions { get; } = new List<Region>(); public static List<Region> Regions { get; } = new();
public static Type DefaultRegionType { get; set; } = typeof(Region); public static Type DefaultRegionType { get; set; } = typeof(Region);
@ -190,7 +190,7 @@ namespace Server
public Region Parent { get; } public Region Parent { get; }
public List<Region> Children { get; } = new List<Region>(); public List<Region> Children { get; } = new();
public Rectangle3D[] Area { get; } public Rectangle3D[] Area { get; }
@ -297,7 +297,7 @@ namespace Server
} }
public static Rectangle3D ConvertTo3D(Rectangle2D rect) => public static Rectangle3D ConvertTo3D(Rectangle2D rect) =>
new Rectangle3D(new Point3D(rect.Start, MinZ), new Point3D(rect.End, MaxZ)); new(new Point3D(rect.Start, MinZ), new Point3D(rect.End, MaxZ));
public static Rectangle3D[] ConvertTo3D(Rectangle2D[] rects) public static Rectangle3D[] ConvertTo3D(Rectangle2D[] rects)
{ {

View file

@ -27,11 +27,11 @@ namespace Server
public class Sector public class Sector
{ {
// TODO: Can we avoid this? // TODO: Can we avoid this?
private static readonly List<Mobile> m_DefaultMobileList = new List<Mobile>(); private static readonly List<Mobile> m_DefaultMobileList = new();
private static readonly List<Item> m_DefaultItemList = new List<Item>(); private static readonly List<Item> m_DefaultItemList = new();
private static readonly List<NetState> m_DefaultClientList = new List<NetState>(); private static readonly List<NetState> m_DefaultClientList = new();
private static readonly List<BaseMulti> m_DefaultMultiList = new List<BaseMulti>(); private static readonly List<BaseMulti> m_DefaultMultiList = new();
private static readonly List<RegionRect> m_DefaultRectList = new List<RegionRect>(); private static readonly List<RegionRect> m_DefaultRectList = new();
private bool m_Active; private bool m_Active;
private List<NetState> m_Clients; private List<NetState> m_Clients;
private List<Item> m_Items; private List<Item> m_Items;

View file

@ -4,8 +4,8 @@ namespace Server
{ {
public readonly struct Serial : IComparable<Serial>, IComparable<uint>, IEquatable<Serial> public readonly struct Serial : IComparable<Serial>, IComparable<uint>, IEquatable<Serial>
{ {
public static readonly Serial MinusOne = new Serial(0xFFFFFFFF); public static readonly Serial MinusOne = new(0xFFFFFFFF);
public static readonly Serial Zero = new Serial(0); public static readonly Serial Zero = new(0);
private Serial(uint serial) => Value = serial; private Serial(uint serial) => Value = serial;
@ -54,7 +54,7 @@ namespace Server
public static implicit operator uint(Serial a) => a.Value; public static implicit operator uint(Serial a) => a.Value;
public static implicit operator Serial(uint a) => new Serial(a); public static implicit operator Serial(uint a) => new(a);
public bool Equals(Serial other) => Value == other.Value; public bool Equals(Serial other) => Value == other.Value;

View file

@ -48,11 +48,11 @@ namespace Server
return s; return s;
} }
public DateTime ReadDateTime() => new DateTime(ReadLong()); public DateTime ReadDateTime() => new(ReadLong());
public DateTimeOffset ReadDateTimeOffset() => new DateTimeOffset(ReadLong(), ReadTimeSpan()); public DateTimeOffset ReadDateTimeOffset() => new(ReadLong(), ReadTimeSpan());
public TimeSpan ReadTimeSpan() => new TimeSpan(ReadLong()); public TimeSpan ReadTimeSpan() => new(ReadLong());
public DateTime ReadDeltaTime() public DateTime ReadDeltaTime()
{ {
@ -79,7 +79,7 @@ namespace Server
} }
} }
public decimal ReadDecimal() => new decimal(new[] { ReadInt(), ReadInt(), ReadInt(), ReadInt() }); public decimal ReadDecimal() => new(new[] { ReadInt(), ReadInt(), ReadInt(), ReadInt() });
public long ReadLong() public long ReadLong()
{ {
@ -158,15 +158,15 @@ namespace Server
return v; return v;
} }
public IPAddress ReadIPAddress() => new IPAddress(ReadLong()); public IPAddress ReadIPAddress() => new(ReadLong());
public Point3D ReadPoint3D() => new Point3D(ReadInt(), ReadInt(), ReadInt()); public Point3D ReadPoint3D() => new(ReadInt(), ReadInt(), ReadInt());
public Point2D ReadPoint2D() => new Point2D(ReadInt(), ReadInt()); public Point2D ReadPoint2D() => new(ReadInt(), ReadInt());
public Rectangle2D ReadRect2D() => new Rectangle2D(ReadPoint2D(), ReadPoint2D()); public Rectangle2D ReadRect2D() => new(ReadPoint2D(), ReadPoint2D());
public Rectangle3D ReadRect3D() => new Rectangle3D(ReadPoint3D(), ReadPoint3D()); public Rectangle3D ReadRect3D() => new(ReadPoint3D(), ReadPoint3D());
public Map ReadMap() => Map.Maps[ReadByte()]; public Map ReadMap() => Map.Maps[ReadByte()];

View file

@ -430,64 +430,64 @@ namespace Server
public static SkillInfo[] Table { get; set; } = public static SkillInfo[] Table { get; set; } =
{ {
new SkillInfo(0, "Alchemy", 0.0, 5.0, 5.0, "Alchemist", null, 0.0, 0.5, 0.5, 1.0), new(0, "Alchemy", 0.0, 5.0, 5.0, "Alchemist", null, 0.0, 0.5, 0.5, 1.0),
new SkillInfo(1, "Anatomy", 0.0, 0.0, 0.0, "Biologist", null, 0.15, 0.15, 0.7, 1.0), new(1, "Anatomy", 0.0, 0.0, 0.0, "Biologist", null, 0.15, 0.15, 0.7, 1.0),
new SkillInfo(2, "Animal Lore", 0.0, 0.0, 0.0, "Naturalist", null, 0.0, 0.0, 1.0, 1.0), new(2, "Animal Lore", 0.0, 0.0, 0.0, "Naturalist", null, 0.0, 0.0, 1.0, 1.0),
new SkillInfo(3, "Item Identification", 0.0, 0.0, 0.0, "Merchant", null, 0.0, 0.0, 1.0, 1.0), new(3, "Item Identification", 0.0, 0.0, 0.0, "Merchant", null, 0.0, 0.0, 1.0, 1.0),
new SkillInfo(4, "Arms Lore", 0.0, 0.0, 0.0, "Weapon Master", null, 0.75, 0.15, 0.1, 1.0), new(4, "Arms Lore", 0.0, 0.0, 0.0, "Weapon Master", null, 0.75, 0.15, 0.1, 1.0),
new SkillInfo(5, "Parrying", 7.5, 2.5, 0.0, "Duelist", null, 0.75, 0.25, 0.0, 1.0), new(5, "Parrying", 7.5, 2.5, 0.0, "Duelist", null, 0.75, 0.25, 0.0, 1.0),
new SkillInfo(6, "Begging", 0.0, 0.0, 0.0, "Beggar", null, 0.0, 0.0, 0.0, 1.0), new(6, "Begging", 0.0, 0.0, 0.0, "Beggar", null, 0.0, 0.0, 0.0, 1.0),
new SkillInfo(7, "Blacksmithy", 10.0, 0.0, 0.0, "Blacksmith", null, 1.0, 0.0, 0.0, 1.0), new(7, "Blacksmithy", 10.0, 0.0, 0.0, "Blacksmith", null, 1.0, 0.0, 0.0, 1.0),
new SkillInfo(8, "Bowcraft/Fletching", 6.0, 16.0, 0.0, "Bowyer", null, 0.6, 1.6, 0.0, 1.0), new(8, "Bowcraft/Fletching", 6.0, 16.0, 0.0, "Bowyer", null, 0.6, 1.6, 0.0, 1.0),
new SkillInfo(9, "Peacemaking", 0.0, 0.0, 0.0, "Pacifier", null, 0.0, 0.0, 0.0, 1.0), new(9, "Peacemaking", 0.0, 0.0, 0.0, "Pacifier", null, 0.0, 0.0, 0.0, 1.0),
new SkillInfo(10, "Camping", 20.0, 15.0, 15.0, "Explorer", null, 2.0, 1.5, 1.5, 1.0), new(10, "Camping", 20.0, 15.0, 15.0, "Explorer", null, 2.0, 1.5, 1.5, 1.0),
new SkillInfo(11, "Carpentry", 20.0, 5.0, 0.0, "Carpenter", null, 2.0, 0.5, 0.0, 1.0), new(11, "Carpentry", 20.0, 5.0, 0.0, "Carpenter", null, 2.0, 0.5, 0.0, 1.0),
new SkillInfo(12, "Cartography", 0.0, 7.5, 7.5, "Cartographer", null, 0.0, 0.75, 0.75, 1.0), new(12, "Cartography", 0.0, 7.5, 7.5, "Cartographer", null, 0.0, 0.75, 0.75, 1.0),
new SkillInfo(13, "Cooking", 0.0, 20.0, 30.0, "Chef", null, 0.0, 2.0, 3.0, 1.0), new(13, "Cooking", 0.0, 20.0, 30.0, "Chef", null, 0.0, 2.0, 3.0, 1.0),
new SkillInfo(14, "Detecting Hidden", 0.0, 0.0, 0.0, "Scout", null, 0.0, 0.4, 0.6, 1.0), new(14, "Detecting Hidden", 0.0, 0.0, 0.0, "Scout", null, 0.0, 0.4, 0.6, 1.0),
new SkillInfo(15, "Discordance", 0.0, 2.5, 2.5, "Demoralizer", null, 0.0, 0.25, 0.25, 1.0), new(15, "Discordance", 0.0, 2.5, 2.5, "Demoralizer", null, 0.0, 0.25, 0.25, 1.0),
new SkillInfo(16, "Evaluating Intelligence", 0.0, 0.0, 0.0, "Scholar", null, 0.0, 0.0, 1.0, 1.0), new(16, "Evaluating Intelligence", 0.0, 0.0, 0.0, "Scholar", null, 0.0, 0.0, 1.0, 1.0),
new SkillInfo(17, "Healing", 6.0, 6.0, 8.0, "Healer", null, 0.6, 0.6, 0.8, 1.0), new(17, "Healing", 6.0, 6.0, 8.0, "Healer", null, 0.6, 0.6, 0.8, 1.0),
new SkillInfo(18, "Fishing", 0.0, 0.0, 0.0, "Fisherman", null, 0.5, 0.5, 0.0, 1.0), new(18, "Fishing", 0.0, 0.0, 0.0, "Fisherman", null, 0.5, 0.5, 0.0, 1.0),
new SkillInfo(19, "Forensic Evaluation", 0.0, 0.0, 0.0, "Detective", null, 0.0, 0.2, 0.8, 1.0), new(19, "Forensic Evaluation", 0.0, 0.0, 0.0, "Detective", null, 0.0, 0.2, 0.8, 1.0),
new SkillInfo(20, "Herding", 16.25, 6.25, 2.5, "Shepherd", null, 1.625, 0.625, 0.25, 1.0), new(20, "Herding", 16.25, 6.25, 2.5, "Shepherd", null, 1.625, 0.625, 0.25, 1.0),
new SkillInfo(21, "Hiding", 0.0, 0.0, 0.0, "Shade", null, 0.0, 0.8, 0.2, 1.0), new(21, "Hiding", 0.0, 0.0, 0.0, "Shade", null, 0.0, 0.8, 0.2, 1.0),
new SkillInfo(22, "Provocation", 0.0, 4.5, 0.5, "Rouser", null, 0.0, 0.45, 0.05, 1.0), new(22, "Provocation", 0.0, 4.5, 0.5, "Rouser", null, 0.0, 0.45, 0.05, 1.0),
new SkillInfo(23, "Inscription", 0.0, 2.0, 8.0, "Scribe", null, 0.0, 0.2, 0.8, 1.0), new(23, "Inscription", 0.0, 2.0, 8.0, "Scribe", null, 0.0, 0.2, 0.8, 1.0),
new SkillInfo(24, "Lockpicking", 0.0, 25.0, 0.0, "Infiltrator", null, 0.0, 2.0, 0.0, 1.0), new(24, "Lockpicking", 0.0, 25.0, 0.0, "Infiltrator", null, 0.0, 2.0, 0.0, 1.0),
new SkillInfo(25, "Magery", 0.0, 0.0, 15.0, "Mage", null, 0.0, 0.0, 1.5, 1.0), new(25, "Magery", 0.0, 0.0, 15.0, "Mage", null, 0.0, 0.0, 1.5, 1.0),
new SkillInfo(26, "Resisting Spells", 0.0, 0.0, 0.0, "Warder", null, 0.25, 0.25, 0.5, 1.0), new(26, "Resisting Spells", 0.0, 0.0, 0.0, "Warder", null, 0.25, 0.25, 0.5, 1.0),
new SkillInfo(27, "Tactics", 0.0, 0.0, 0.0, "Tactician", null, 0.0, 0.0, 0.0, 1.0), new(27, "Tactics", 0.0, 0.0, 0.0, "Tactician", null, 0.0, 0.0, 0.0, 1.0),
new SkillInfo(28, "Snooping", 0.0, 25.0, 0.0, "Spy", null, 0.0, 2.5, 0.0, 1.0), new(28, "Snooping", 0.0, 25.0, 0.0, "Spy", null, 0.0, 2.5, 0.0, 1.0),
new SkillInfo(29, "Musicianship", 0.0, 0.0, 0.0, "Bard", null, 0.0, 0.8, 0.2, 1.0), new(29, "Musicianship", 0.0, 0.0, 0.0, "Bard", null, 0.0, 0.8, 0.2, 1.0),
new SkillInfo(30, "Poisoning", 0.0, 4.0, 16.0, "Assassin", null, 0.0, 0.4, 1.6, 1.0), new(30, "Poisoning", 0.0, 4.0, 16.0, "Assassin", null, 0.0, 0.4, 1.6, 1.0),
new SkillInfo(31, "Archery", 2.5, 7.5, 0.0, "Archer", null, 0.25, 0.75, 0.0, 1.0), new(31, "Archery", 2.5, 7.5, 0.0, "Archer", null, 0.25, 0.75, 0.0, 1.0),
new SkillInfo(32, "Spirit Speak", 0.0, 0.0, 0.0, "Medium", null, 0.0, 0.0, 1.0, 1.0), new(32, "Spirit Speak", 0.0, 0.0, 0.0, "Medium", null, 0.0, 0.0, 1.0, 1.0),
new SkillInfo(33, "Stealing", 0.0, 10.0, 0.0, "Pickpocket", null, 0.0, 1.0, 0.0, 1.0), new(33, "Stealing", 0.0, 10.0, 0.0, "Pickpocket", null, 0.0, 1.0, 0.0, 1.0),
new SkillInfo(34, "Tailoring", 3.75, 16.25, 5.0, "Tailor", null, 0.38, 1.63, 0.5, 1.0), new(34, "Tailoring", 3.75, 16.25, 5.0, "Tailor", null, 0.38, 1.63, 0.5, 1.0),
new SkillInfo(35, "Animal Taming", 14.0, 2.0, 4.0, "Tamer", null, 1.4, 0.2, 0.4, 1.0), new(35, "Animal Taming", 14.0, 2.0, 4.0, "Tamer", null, 1.4, 0.2, 0.4, 1.0),
new SkillInfo(36, "Taste Identification", 0.0, 0.0, 0.0, "Praegustator", null, 0.2, 0.0, 0.8, 1.0), new(36, "Taste Identification", 0.0, 0.0, 0.0, "Praegustator", null, 0.2, 0.0, 0.8, 1.0),
new SkillInfo(37, "Tinkering", 5.0, 2.0, 3.0, "Tinker", null, 0.5, 0.2, 0.3, 1.0), new(37, "Tinkering", 5.0, 2.0, 3.0, "Tinker", null, 0.5, 0.2, 0.3, 1.0),
new SkillInfo(38, "Tracking", 0.0, 12.5, 12.5, "Ranger", null, 0.0, 1.25, 1.25, 1.0), new(38, "Tracking", 0.0, 12.5, 12.5, "Ranger", null, 0.0, 1.25, 1.25, 1.0),
new SkillInfo(39, "Veterinary", 8.0, 4.0, 8.0, "Veterinarian", null, 0.8, 0.4, 0.8, 1.0), new(39, "Veterinary", 8.0, 4.0, 8.0, "Veterinarian", null, 0.8, 0.4, 0.8, 1.0),
new SkillInfo(40, "Swordsmanship", 7.5, 2.5, 0.0, "Swordsman", null, 0.75, 0.25, 0.0, 1.0), new(40, "Swordsmanship", 7.5, 2.5, 0.0, "Swordsman", null, 0.75, 0.25, 0.0, 1.0),
new SkillInfo(41, "Mace Fighting", 9.0, 1.0, 0.0, "Armsman", null, 0.9, 0.1, 0.0, 1.0), new(41, "Mace Fighting", 9.0, 1.0, 0.0, "Armsman", null, 0.9, 0.1, 0.0, 1.0),
new SkillInfo(42, "Fencing", 4.5, 5.5, 0.0, "Fencer", null, 0.45, 0.55, 0.0, 1.0), new(42, "Fencing", 4.5, 5.5, 0.0, "Fencer", null, 0.45, 0.55, 0.0, 1.0),
new SkillInfo(43, "Wrestling", 9.0, 1.0, 0.0, "Wrestler", null, 0.9, 0.1, 0.0, 1.0), new(43, "Wrestling", 9.0, 1.0, 0.0, "Wrestler", null, 0.9, 0.1, 0.0, 1.0),
new SkillInfo(44, "Lumberjacking", 20.0, 0.0, 0.0, "Lumberjack", null, 2.0, 0.0, 0.0, 1.0), new(44, "Lumberjacking", 20.0, 0.0, 0.0, "Lumberjack", null, 2.0, 0.0, 0.0, 1.0),
new SkillInfo(45, "Mining", 20.0, 0.0, 0.0, "Miner", null, 2.0, 0.0, 0.0, 1.0), new(45, "Mining", 20.0, 0.0, 0.0, "Miner", null, 2.0, 0.0, 0.0, 1.0),
new SkillInfo(46, "Meditation", 0.0, 0.0, 0.0, "Stoic", null, 0.0, 0.0, 0.0, 1.0), new(46, "Meditation", 0.0, 0.0, 0.0, "Stoic", null, 0.0, 0.0, 0.0, 1.0),
new SkillInfo(47, "Stealth", 0.0, 0.0, 0.0, "Rogue", null, 0.0, 0.0, 0.0, 1.0), new(47, "Stealth", 0.0, 0.0, 0.0, "Rogue", null, 0.0, 0.0, 0.0, 1.0),
new SkillInfo(48, "Remove Trap", 0.0, 0.0, 0.0, "Trap Specialist", null, 0.0, 0.0, 0.0, 1.0), new(48, "Remove Trap", 0.0, 0.0, 0.0, "Trap Specialist", null, 0.0, 0.0, 0.0, 1.0),
new SkillInfo(49, "Necromancy", 0.0, 0.0, 0.0, "Necromancer", null, 0.0, 0.0, 0.0, 1.0), new(49, "Necromancy", 0.0, 0.0, 0.0, "Necromancer", null, 0.0, 0.0, 0.0, 1.0),
new SkillInfo(50, "Focus", 0.0, 0.0, 0.0, "Driven", null, 0.0, 0.0, 0.0, 1.0), new(50, "Focus", 0.0, 0.0, 0.0, "Driven", null, 0.0, 0.0, 0.0, 1.0),
new SkillInfo(51, "Chivalry", 0.0, 0.0, 0.0, "Paladin", null, 0.0, 0.0, 0.0, 1.0), new(51, "Chivalry", 0.0, 0.0, 0.0, "Paladin", null, 0.0, 0.0, 0.0, 1.0),
new SkillInfo(52, "Bushido", 0.0, 0.0, 0.0, "Samurai", null, 0.0, 0.0, 0.0, 1.0), new(52, "Bushido", 0.0, 0.0, 0.0, "Samurai", null, 0.0, 0.0, 0.0, 1.0),
new SkillInfo(53, "Ninjitsu", 0.0, 0.0, 0.0, "Ninja", null, 0.0, 0.0, 0.0, 1.0), new(53, "Ninjitsu", 0.0, 0.0, 0.0, "Ninja", null, 0.0, 0.0, 0.0, 1.0),
new SkillInfo(54, "Spellweaving", 0.0, 0.0, 0.0, "Arcanist", null, 0.0, 0.0, 0.0, 1.0), new(54, "Spellweaving", 0.0, 0.0, 0.0, "Arcanist", null, 0.0, 0.0, 0.0, 1.0),
new SkillInfo(55, "Mysticism", 0.0, 0.0, 0.0, "Mystic", null, 0.0, 0.0, 0.0, 1.0), new(55, "Mysticism", 0.0, 0.0, 0.0, "Mystic", null, 0.0, 0.0, 0.0, 1.0),
new SkillInfo(56, "Imbuing", 0.0, 0.0, 0.0, "Artificer", null, 0.0, 0.0, 0.0, 1.0), new(56, "Imbuing", 0.0, 0.0, 0.0, "Artificer", null, 0.0, 0.0, 0.0, 1.0),
new SkillInfo(57, "Throwing", 0.0, 0.0, 0.0, "Bladeweaver", null, 0.0, 0.0, 0.0, 1.0) new(57, "Throwing", 0.0, 0.0, 0.0, "Bladeweaver", null, 0.0, 0.0, 0.0, 1.0)
}; };
} }
@ -621,7 +621,7 @@ namespace Server
{ {
var sk = m_Skills[i]; var sk = m_Skills[i];
if (sk != null && sk.BaseFixedPoint > value) if (sk?.BaseFixedPoint > value)
{ {
value = sk.BaseFixedPoint; value = sk.BaseFixedPoint;
highest = sk; highest = sk;

View file

@ -9,10 +9,10 @@ namespace Server
{ {
public class TileMatrix public class TileMatrix
{ {
private static readonly List<TileMatrix> m_Instances = new List<TileMatrix>(); private static readonly List<TileMatrix> m_Instances = new();
private readonly int m_FileIndex; private readonly int m_FileIndex;
private readonly List<TileMatrix> m_FileShare = new List<TileMatrix>(); private readonly List<TileMatrix> m_FileShare = new();
private readonly BinaryReader m_IndexReader; private readonly BinaryReader m_IndexReader;
@ -29,7 +29,7 @@ namespace Server
private readonly int[][] m_StaticPatches; private readonly int[][] m_StaticPatches;
private readonly StaticTile[][][][][] m_StaticTiles; private readonly StaticTile[][][][][] m_StaticTiles;
private readonly TileList m_TilesList = new TileList(); private readonly TileList m_TilesList = new();
private TileList[][] m_Lists; private TileList[][] m_Lists;
private DateTime m_NextLandWarning; private DateTime m_NextLandWarning;

View file

@ -21,7 +21,7 @@ namespace Server
public partial class Timer public partial class Timer
{ {
private static readonly Queue<Timer> m_Queue = new Queue<Timer>(); private static readonly Queue<Timer> m_Queue = new();
private static int m_QueueCountAtSlice; private static int m_QueueCountAtSlice;
private readonly int m_Count; private readonly int m_Count;
@ -253,7 +253,7 @@ namespace Server
public class TimerThread public class TimerThread
{ {
private static readonly Dictionary<Timer, TimerChangeEntry> private static readonly Dictionary<Timer, TimerChangeEntry>
m_Changed = new Dictionary<Timer, TimerChangeEntry>(); m_Changed = new();
private static readonly long[] m_NextPriorities = new long[8]; private static readonly long[] m_NextPriorities = new long[8];
@ -271,17 +271,17 @@ namespace Server
private static readonly List<Timer>[] m_Timers = private static readonly List<Timer>[] m_Timers =
{ {
new List<Timer>(), new(),
new List<Timer>(), new(),
new List<Timer>(), new(),
new List<Timer>(), new(),
new List<Timer>(), new(),
new List<Timer>(), new(),
new List<Timer>(), new(),
new List<Timer>() new()
}; };
private static readonly AutoResetEvent m_Signal = new AutoResetEvent(false); private static readonly AutoResetEvent m_Signal = new(false);
public static void DumpInfo(TextWriter tw) public static void DumpInfo(TextWriter tw)
{ {
@ -443,7 +443,7 @@ namespace Server
private class TimerChangeEntry private class TimerChangeEntry
{ {
private static readonly Queue<TimerChangeEntry> m_InstancePool = new Queue<TimerChangeEntry>(); private static readonly Queue<TimerChangeEntry> m_InstancePool = new();
public bool m_IsAdd; public bool m_IsAdd;
public int m_NewIndex; public int m_NewIndex;
public Timer m_Timer; public Timer m_Timer;

View file

@ -60,7 +60,7 @@ namespace Server.Utilities
public const int DEFAULT_RESOURCE_RETENTION = 10; public const int DEFAULT_RESOURCE_RETENTION = 10;
private readonly Generator m_Generator; private readonly Generator m_Generator;
private readonly Stack<TRef> m_Resources = new Stack<TRef>(); private readonly Stack<TRef> m_Resources = new();
private int m_MaxRefrenceRetention; private int m_MaxRefrenceRetention;
/// <param name="generator">The generator function for creating new resources.</param> /// <param name="generator">The generator function for creating new resources.</param>

View file

@ -100,7 +100,7 @@ namespace Server
SkillName.Tinkering SkillName.Tinkering
}; };
private static readonly Stack<ConsoleColor> m_ConsoleColors = new Stack<ConsoleColor>(); private static readonly Stack<ConsoleColor> m_ConsoleColors = new();
public static Encoding UTF8 => m_UTF8 ??= new UTF8Encoding(false, false); public static Encoding UTF8 => m_UTF8 ??= new UTF8Encoding(false, false);
public static Encoding UTF8WithEncoding => m_UTF8WithEncoding ??= new UTF8Encoding(true, false); public static Encoding UTF8WithEncoding => m_UTF8WithEncoding ??= new UTF8Encoding(true, false);

View file

@ -40,10 +40,10 @@ namespace Server
public static class World public static class World
{ {
private static readonly ManualResetEvent m_DiskWriteHandle = new ManualResetEvent(true); private static readonly ManualResetEvent m_DiskWriteHandle = new(true);
private static readonly Dictionary<Serial, IEntity> _pendingAdd = new Dictionary<Serial, IEntity>(); private static readonly Dictionary<Serial, IEntity> _pendingAdd = new();
private static readonly Dictionary<Serial, IEntity> _pendingDelete = new Dictionary<Serial, IEntity>(); private static readonly Dictionary<Serial, IEntity> _pendingDelete = new();
private static readonly ConcurrentQueue<Item> _decayQueue = new ConcurrentQueue<Item>(); private static readonly ConcurrentQueue<Item> _decayQueue = new();
public const uint ItemOffset = 0x40000000; public const uint ItemOffset = 0x40000000;
public const uint MaxItemSerial = 0x7FFFFFFF; public const uint MaxItemSerial = 0x7FFFFFFF;
@ -121,9 +121,9 @@ namespace Server
private static void OutOfMemory(string message) => throw new OutOfMemoryException(message); private static void OutOfMemory(string message) => throw new OutOfMemoryException(message);
internal static int _Saves; internal static int _Saves;
internal static List<Type> ItemTypes { get; } = new List<Type>(); internal static List<Type> ItemTypes { get; } = new();
internal static List<Type> MobileTypes { get; } = new List<Type>(); internal static List<Type> MobileTypes { get; } = new();
internal static List<Type> GuildTypes { get; } = new List<Type>(); internal static List<Type> GuildTypes { get; } = new();
public static WorldState WorldState { get; private set; } public static WorldState WorldState { get; private set; }
public static bool Saving => WorldState == WorldState.Saving; public static bool Saving => WorldState == WorldState.Saving;

View file

@ -10,7 +10,7 @@ namespace Server.Accounting
{ {
public static bool Enabled; public static bool Enabled;
private static readonly List<InvalidAccountAccessLog> m_List = new List<InvalidAccountAccessLog>(); private static readonly List<InvalidAccountAccessLog> m_List = new();
public static void Configure() public static void Configure()
{ {

View file

@ -19,15 +19,15 @@ namespace Server.Misc
private static readonly CityInfo[] StartingCities = private static readonly CityInfo[] StartingCities =
{ {
new CityInfo("New Haven", "New Haven Bank", 1150168, 3667, 2625, 0), new("New Haven", "New Haven Bank", 1150168, 3667, 2625, 0),
new CityInfo("Yew", "The Empath Abbey", 1075072, 633, 858, 0), new("Yew", "The Empath Abbey", 1075072, 633, 858, 0),
new CityInfo("Minoc", "The Barnacle", 1075073, 2476, 413, 15), new("Minoc", "The Barnacle", 1075073, 2476, 413, 15),
new CityInfo("Britain", "The Wayfarer's Inn", 1075074, 1602, 1591, 20), new("Britain", "The Wayfarer's Inn", 1075074, 1602, 1591, 20),
new CityInfo("Moonglow", "The Scholars Inn", 1075075, 4408, 1168, 0), new("Moonglow", "The Scholars Inn", 1075075, 4408, 1168, 0),
new CityInfo("Trinsic", "The Traveler's Inn", 1075076, 1845, 2745, 0), new("Trinsic", "The Traveler's Inn", 1075076, 1845, 2745, 0),
new CityInfo("Jhelom", "The Mercenary Inn", 1075078, 1374, 3826, 0), new("Jhelom", "The Mercenary Inn", 1075078, 1374, 3826, 0),
new CityInfo("Skara Brae", "The Falconer's Inn", 1075079, 618, 2234, 0), new("Skara Brae", "The Falconer's Inn", 1075079, 618, 2234, 0),
new CityInfo("Vesper", "The Ironwood Inn", 1075080, 2771, 976, 0) new("Vesper", "The Ironwood Inn", 1075080, 2771, 976, 0)
}; };
/* Old Haven/Magincia Locations /* Old Haven/Magincia Locations

View file

@ -7,7 +7,7 @@ namespace Server.Accounting
{ {
public static class Accounts public static class Accounts
{ {
private static Dictionary<string, IAccount> m_Accounts = new Dictionary<string, IAccount>(); private static Dictionary<string, IAccount> m_Accounts = new();
static Accounts() static Accounts()
{ {

View file

@ -22,7 +22,7 @@ namespace Server.Accounting.Security
{ {
public static IPasswordProtection Instance = new Argon2PasswordProtection(); public static IPasswordProtection Instance = new Argon2PasswordProtection();
private readonly Argon2PasswordHasher m_PasswordHasher = new Argon2PasswordHasher( private readonly Argon2PasswordHasher m_PasswordHasher = new(
rng: (RandomSources.SecureSource as SecureRandom)?.Generator rng: (RandomSources.SecureSource as SecureRandom)?.Generator
); );

View file

@ -23,7 +23,7 @@ namespace Server.Accounting.Security
{ {
public static IPasswordProtection Instance = new MD5PasswordProtection(); public static IPasswordProtection Instance = new MD5PasswordProtection();
#pragma warning disable CA5351 #pragma warning disable CA5351
private readonly MD5CryptoServiceProvider m_MD5HashProvider = new MD5CryptoServiceProvider(); private readonly MD5CryptoServiceProvider m_MD5HashProvider = new();
#pragma warning restore CA5351 #pragma warning restore CA5351
public string EncryptPassword(string plainPassword) public string EncryptPassword(string plainPassword)

View file

@ -23,7 +23,7 @@ namespace Server.Accounting.Security
{ {
public static IPasswordProtection Instance = new SHA1PasswordProtection(); public static IPasswordProtection Instance = new SHA1PasswordProtection();
#pragma warning disable CA5350 #pragma warning disable CA5350
private readonly SHA1CryptoServiceProvider m_SHA1HashProvider = new SHA1CryptoServiceProvider(); private readonly SHA1CryptoServiceProvider m_SHA1HashProvider = new();
#pragma warning restore CA5350 #pragma warning restore CA5350
public string EncryptPassword(string plainPassword) public string EncryptPassword(string plainPassword)

View file

@ -22,7 +22,7 @@ namespace Server.Accounting.Security
public class SHA2PasswordProtection : IPasswordProtection public class SHA2PasswordProtection : IPasswordProtection
{ {
public static IPasswordProtection Instance = new SHA2PasswordProtection(); public static IPasswordProtection Instance = new SHA2PasswordProtection();
private readonly SHA512CryptoServiceProvider m_SHA2HashProvider = new SHA512CryptoServiceProvider(); private readonly SHA512CryptoServiceProvider m_SHA2HashProvider = new();
public string EncryptPassword(string plainPassword) public string EncryptPassword(string plainPassword)
{ {

View file

@ -19,7 +19,7 @@ namespace Server.Commands
public string Condition { get; set; } = ""; public string Condition { get; set; } = "";
public List<BatchCommand> BatchCommands { get; } = new List<BatchCommand>(); public List<BatchCommand> BatchCommands { get; } = new();
public override void ExecuteList(CommandEventArgs e, List<object> list) public override void ExecuteList(CommandEventArgs e, List<object> list)
{ {

View file

@ -520,9 +520,9 @@ namespace Server.Commands
} }
private static StreamWriter GetWriter(string root, string name) => private static StreamWriter GetWriter(string root, string name) =>
new StreamWriter(Path.Combine(Path.Combine(m_RootDirectory, root), name)); new(Path.Combine(Path.Combine(m_RootDirectory, root), name));
private static StreamWriter GetWriter(string path) => new StreamWriter(Path.Combine(m_RootDirectory, path)); private static StreamWriter GetWriter(string path) => new(Path.Combine(m_RootDirectory, path));
public static string GetPair(Type varType, string name, bool ignoreRef) public static string GetPair(Type varType, string name, bool ignoreRef)
{ {

View file

@ -12,8 +12,8 @@ namespace Server.Commands.Generic
public abstract class BaseCommand public abstract class BaseCommand
{ {
private readonly List<MessageEntry> m_Failures = new List<MessageEntry>(); private readonly List<MessageEntry> m_Failures = new();
private readonly List<MessageEntry> m_Responses = new List<MessageEntry>(); private readonly List<MessageEntry> m_Responses = new();
public bool ListOptimized { get; set; } public bool ListOptimized { get; set; }

View file

@ -14,7 +14,7 @@ namespace Server.Commands.Generic
{ {
public static class TargetCommands public static class TargetCommands
{ {
public static List<BaseCommand> AllCommands { get; } = new List<BaseCommand>(); public static List<BaseCommand> AllCommands { get; } = new();
public static void Initialize() public static void Initialize()
{ {

View file

@ -18,7 +18,7 @@ namespace Server.Commands.Generic
} }
public static Dictionary<string, ExtensionInfo> Table { get; } = public static Dictionary<string, ExtensionInfo> Table { get; } =
new Dictionary<string, ExtensionInfo>(StringComparer.InvariantCultureIgnoreCase); new(StringComparer.InvariantCultureIgnoreCase);
public int Order { get; } public int Order { get; }

View file

@ -22,7 +22,7 @@ namespace Server.Commands.Generic
public sealed class TypeCondition : ICondition public sealed class TypeCondition : ICondition
{ {
public static TypeCondition Default = new TypeCondition(); public static TypeCondition Default = new();
void ICondition.Construct(TypeBuilder typeBuilder, ILGenerator il, int index) void ICondition.Construct(TypeBuilder typeBuilder, ILGenerator il, int index)
{ {

View file

@ -6,7 +6,7 @@ namespace Server.Commands.Generic
public sealed class DistinctExtension : BaseExtension public sealed class DistinctExtension : BaseExtension
{ {
public static ExtensionInfo ExtInfo = public static ExtensionInfo ExtInfo =
new ExtensionInfo(30, "Distinct", -1, () => new DistinctExtension()); new(30, "Distinct", -1, () => new DistinctExtension());
private readonly List<Property> m_Properties; private readonly List<Property> m_Properties;

View file

@ -5,7 +5,7 @@ namespace Server.Commands.Generic
{ {
public sealed class LimitExtension : BaseExtension public sealed class LimitExtension : BaseExtension
{ {
public static ExtensionInfo ExtInfo = new ExtensionInfo(80, "Limit", 1, () => new LimitExtension()); public static ExtensionInfo ExtInfo = new(80, "Limit", 1, () => new LimitExtension());
public override ExtensionInfo Info => ExtInfo; public override ExtensionInfo Info => ExtInfo;

View file

@ -5,7 +5,7 @@ namespace Server.Commands.Generic
{ {
public sealed class SortExtension : BaseExtension public sealed class SortExtension : BaseExtension
{ {
public static ExtensionInfo ExtInfo = new ExtensionInfo(40, "Order", -1, () => new SortExtension()); public static ExtensionInfo ExtInfo = new(40, "Order", -1, () => new SortExtension());
private readonly List<OrderInfo> m_Orders; private readonly List<OrderInfo> m_Orders;

View file

@ -4,7 +4,7 @@ namespace Server.Commands.Generic
{ {
public sealed class WhereExtension : BaseExtension public sealed class WhereExtension : BaseExtension
{ {
public static ExtensionInfo ExtInfo = new ExtensionInfo(20, "Where", -1, () => new WhereExtension()); public static ExtensionInfo ExtInfo = new(20, "Where", -1, () => new WhereExtension());
public override ExtensionInfo Info => ExtInfo; public override ExtensionInfo Info => ExtInfo;

View file

@ -8,7 +8,7 @@ namespace Server.Commands.Generic
private static readonly Type typeofItem = typeof(Item); private static readonly Type typeofItem = typeof(Item);
private static readonly Type typeofMobile = typeof(Mobile); private static readonly Type typeofMobile = typeof(Mobile);
public static readonly ObjectConditional Empty = new ObjectConditional(null, null); public static readonly ObjectConditional Empty = new(null, null);
private readonly ICondition[][] m_Conditions; private readonly ICondition[][] m_Conditions;

View file

@ -11,9 +11,9 @@ namespace Server.Commands
{ {
public static class HelpInfo public static class HelpInfo
{ {
public static Dictionary<string, CommandInfo> HelpInfos { get; } = new Dictionary<string, CommandInfo>(); public static Dictionary<string, CommandInfo> HelpInfos { get; } = new();
public static List<CommandInfo> SortedHelpInfo { get; private set; } = new List<CommandInfo>(); public static List<CommandInfo> SortedHelpInfo { get; private set; } = new();
[CallPriority(100)] [CallPriority(100)]
public static void Initialize() public static void Initialize()

View file

@ -7,7 +7,7 @@ namespace Server.Commands
{ {
public class LocationCommand : BaseCommand public class LocationCommand : BaseCommand
{ {
private static readonly List<int> m_DefaultGraphics = new List<int> { 0x17AF, 0x17B0, 0x17B1, 0x17B2 }; private static readonly List<int> m_DefaultGraphics = new() { 0x17AF, 0x17B0, 0x17B1, 0x17B2 };
public LocationCommand() public LocationCommand()
{ {

View file

@ -74,7 +74,7 @@ namespace Server.Commands
private static readonly Type typeofCannon = typeof(Cannon); private static readonly Type typeofCannon = typeof(Cannon);
private static readonly Type typeofSerpentPillar = typeof(SerpentPillar); private static readonly Type typeofSerpentPillar = typeof(SerpentPillar);
private static readonly Queue<Item> m_DeleteQueue = new Queue<Item>(); private static readonly Queue<Item> m_DeleteQueue = new();
private static readonly string[] m_EmptyParams = Array.Empty<string>(); private static readonly string[] m_EmptyParams = Array.Empty<string>();
private List<DecorationEntry> m_Entries; private List<DecorationEntry> m_Entries;

View file

@ -71,7 +71,7 @@ namespace Server.Commands
private static readonly Type typeofCannon = typeof(Cannon); private static readonly Type typeofCannon = typeof(Cannon);
private static readonly Type typeofSerpentPillar = typeof(SerpentPillar); private static readonly Type typeofSerpentPillar = typeof(SerpentPillar);
private static readonly Queue m_DeleteQueue = new Queue(); private static readonly Queue m_DeleteQueue = new();
private static readonly string[] m_EmptyParams = Array.Empty<string>(); private static readonly string[] m_EmptyParams = Array.Empty<string>();
private List<DecorationEntryMag> m_Entries; private List<DecorationEntryMag> m_Entries;

View file

@ -7,7 +7,7 @@ namespace Server.Commands
{ {
public static class SignParser public static class SignParser
{ {
private static readonly Queue<Item> m_ToDelete = new Queue<Item>(); private static readonly Queue<Item> m_ToDelete = new();
public static void Initialize() public static void Initialize()
{ {

View file

@ -30,7 +30,7 @@ namespace Server
"It is strongly recommended that you make backup of the data files mentioned above. " + "It is strongly recommended that you make backup of the data files mentioned above. " +
"Do you wish to proceed?"; "Do you wish to proceed?";
private static readonly Point3D NullP3D = new Point3D(int.MinValue, int.MinValue, int.MinValue); private static readonly Point3D NullP3D = new(int.MinValue, int.MinValue, int.MinValue);
private static byte[] m_Buffer; private static byte[] m_Buffer;

View file

@ -206,7 +206,7 @@ namespace Server.Engines.BulkOrders
private static readonly ConstructCallback PowerScroll = CreatePowerScroll; private static readonly ConstructCallback PowerScroll = CreatePowerScroll;
private static readonly ConstructCallback ColoredAnvil = CreateColoredAnvil; private static readonly ConstructCallback ColoredAnvil = CreateColoredAnvil;
private static readonly ConstructCallback AncientHammer = CreateAncientHammer; private static readonly ConstructCallback AncientHammer = CreateAncientHammer;
public static readonly SmithRewardCalculator Instance = new SmithRewardCalculator(); public static readonly SmithRewardCalculator Instance = new();
private static readonly int[][][] m_GoldTable = private static readonly int[][][] m_GoldTable =
{ {
@ -299,9 +299,9 @@ namespace Server.Engines.BulkOrders
private readonly RewardType[] m_Types = private readonly RewardType[] m_Types =
{ {
// Armors // Armors
new RewardType(200, typeof(RingmailGloves), typeof(RingmailChest), typeof(RingmailArms), typeof(RingmailLegs)), new(200, typeof(RingmailGloves), typeof(RingmailChest), typeof(RingmailArms), typeof(RingmailLegs)),
new RewardType(300, typeof(ChainCoif), typeof(ChainLegs), typeof(ChainChest)), new(300, typeof(ChainCoif), typeof(ChainLegs), typeof(ChainChest)),
new RewardType( new(
400, 400,
typeof(PlateArms), typeof(PlateArms),
typeof(PlateLegs), typeof(PlateLegs),
@ -312,8 +312,8 @@ namespace Server.Engines.BulkOrders
), ),
// Weapons // Weapons
new RewardType(200, typeof(Bardiche), typeof(Halberd)), new(200, typeof(Bardiche), typeof(Halberd)),
new RewardType( new(
300, 300,
typeof(Dagger), typeof(Dagger),
typeof(ShortSpear), typeof(ShortSpear),
@ -321,7 +321,7 @@ namespace Server.Engines.BulkOrders
typeof(WarFork), typeof(WarFork),
typeof(Kryss) typeof(Kryss)
), // OSI put the dagger in there. Odd, ain't it. ), // OSI put the dagger in there. Odd, ain't it.
new RewardType( new(
350, 350,
typeof(Axe), typeof(Axe),
typeof(BattleAxe), typeof(BattleAxe),
@ -330,7 +330,7 @@ namespace Server.Engines.BulkOrders
typeof(LargeBattleAxe), typeof(LargeBattleAxe),
typeof(TwoHandedAxe) typeof(TwoHandedAxe)
), ),
new RewardType( new(
350, 350,
typeof(Broadsword), typeof(Broadsword),
typeof(Cutlass), typeof(Cutlass),
@ -339,7 +339,7 @@ namespace Server.Engines.BulkOrders
typeof(Scimitar), /*typeof( ThinLongsword ),*/ typeof(Scimitar), /*typeof( ThinLongsword ),*/
typeof(VikingSword) typeof(VikingSword)
), ),
new RewardType( new(
350, 350,
typeof(WarAxe), typeof(WarAxe),
typeof(HammerPick), typeof(HammerPick),
@ -564,7 +564,7 @@ namespace Server.Engines.BulkOrders
private static readonly ConstructCallback PowerScroll = CreatePowerScroll; private static readonly ConstructCallback PowerScroll = CreatePowerScroll;
private static readonly ConstructCallback BearRug = CreateBearRug; private static readonly ConstructCallback BearRug = CreateBearRug;
private static readonly ConstructCallback ClothingBlessDeed = CreateCBD; private static readonly ConstructCallback ClothingBlessDeed = CreateCBD;
public static readonly TailorRewardCalculator Instance = new TailorRewardCalculator(); public static readonly TailorRewardCalculator Instance = new();
private static readonly int[][][] m_AosGoldTable = private static readonly int[][][] m_AosGoldTable =
{ {

View file

@ -36,7 +36,7 @@ namespace Server.Engines.CannedEvil
public static ChampionSpawnInfo[] Table { get; } = public static ChampionSpawnInfo[] Table { get; } =
{ {
new ChampionSpawnInfo( new(
"Abyss", "Abyss",
typeof(Semidar), typeof(Semidar),
new[] { "Foe", "Assassin", "Conqueror" }, new[] { "Foe", "Assassin", "Conqueror" },
@ -49,7 +49,7 @@ namespace Server.Engines.CannedEvil
new[] { typeof(Daemon), typeof(Succubus) } // Level 4 new[] { typeof(Daemon), typeof(Succubus) } // Level 4
} }
), ),
new ChampionSpawnInfo( new(
"Arachnid", "Arachnid",
typeof(Mephitis), typeof(Mephitis),
new[] { "Bane", "Killer", "Vanquisher" }, new[] { "Bane", "Killer", "Vanquisher" },
@ -62,7 +62,7 @@ namespace Server.Engines.CannedEvil
new[] { typeof(PoisonElemental), typeof(TerathanAvenger) } // Level 4 new[] { typeof(PoisonElemental), typeof(TerathanAvenger) } // Level 4
} }
), ),
new ChampionSpawnInfo( new(
"Cold Blood", "Cold Blood",
typeof(Rikktor), typeof(Rikktor),
new[] { "Blight", "Slayer", "Destroyer" }, new[] { "Blight", "Slayer", "Destroyer" },
@ -75,7 +75,7 @@ namespace Server.Engines.CannedEvil
new[] { typeof(Dragon), typeof(OphidianKnight) } // Level 4 new[] { typeof(Dragon), typeof(OphidianKnight) } // Level 4
} }
), ),
new ChampionSpawnInfo( new(
"Forest Lord", "Forest Lord",
typeof(LordOaks), typeof(LordOaks),
new[] { "Enemy", "Curse", "Slaughterer" }, new[] { "Enemy", "Curse", "Slaughterer" },
@ -88,7 +88,7 @@ namespace Server.Engines.CannedEvil
new[] { typeof(EtherealWarrior), typeof(SerpentineDragon) } // Level 4 new[] { typeof(EtherealWarrior), typeof(SerpentineDragon) } // Level 4
} }
), ),
new ChampionSpawnInfo( new(
"Vermin Horde", "Vermin Horde",
typeof(Barracoon), typeof(Barracoon),
new[] { "Adversary", "Subjugator", "Eradicator" }, new[] { "Adversary", "Subjugator", "Eradicator" },
@ -101,7 +101,7 @@ namespace Server.Engines.CannedEvil
new[] { typeof(RatmanArcher), typeof(SilverSerpent) } // Level 4 new[] { typeof(RatmanArcher), typeof(SilverSerpent) } // Level 4
} }
), ),
new ChampionSpawnInfo( new(
"Unholy Terror", "Unholy Terror",
typeof(Neira), typeof(Neira),
new[] { "Scourge", "Punisher", "Nemesis" }, new[] { "Scourge", "Punisher", "Nemesis" },
@ -120,7 +120,7 @@ namespace Server.Engines.CannedEvil
new[] { typeof(LichLord), typeof(RottingCorpse) } // Level 4 new[] { typeof(LichLord), typeof(RottingCorpse) } // Level 4
} }
), ),
new ChampionSpawnInfo( new(
"Sleeping Dragon", "Sleeping Dragon",
typeof(Serado), typeof(Serado),
new[] { "Rival", "Challenger", "Antagonist" }, new[] { "Rival", "Challenger", "Antagonist" },
@ -133,7 +133,7 @@ namespace Server.Engines.CannedEvil
new[] { typeof(Hiryu), typeof(Oni) } new[] { typeof(Hiryu), typeof(Oni) }
} }
), ),
new ChampionSpawnInfo( new(
"Glade", "Glade",
typeof(Twaulo), typeof(Twaulo),
new[] { "Banisher", "Enforcer", "Eradicator" }, new[] { "Banisher", "Enforcer", "Eradicator" },
@ -146,7 +146,7 @@ namespace Server.Engines.CannedEvil
new[] { typeof(FeralTreefellow), typeof(RagingGrizzlyBear) } new[] { typeof(FeralTreefellow), typeof(RagingGrizzlyBear) }
} }
), ),
new ChampionSpawnInfo( new(
"The Corrupt", "The Corrupt",
typeof(Ilhenir), typeof(Ilhenir),
new[] { "Cleanser", "Expunger", "Depurator" }, new[] { "Cleanser", "Expunger", "Depurator" },

View file

@ -64,7 +64,7 @@ namespace Server.Engines.Chat
public bool AlwaysAvailable { get; set; } public bool AlwaysAvailable { get; set; }
public static List<Channel> Channels { get; } = new List<Channel>(); public static List<Channel> Channels { get; } = new();
public bool Contains(ChatUser user) => m_Users.Contains(user); public bool Contains(ChatUser user) => m_Users.Contains(user);

View file

@ -8,8 +8,8 @@ namespace Server.Engines.Chat
public const char ModeratorColorCharacter = '1'; public const char ModeratorColorCharacter = '1';
public const char VoicedColorCharacter = '2'; public const char VoicedColorCharacter = '2';
private static readonly List<ChatUser> m_Users = new List<ChatUser>(); private static readonly List<ChatUser> m_Users = new();
private static readonly Dictionary<Mobile, ChatUser> m_Table = new Dictionary<Mobile, ChatUser>(); private static readonly Dictionary<Mobile, ChatUser> m_Table = new();
public ChatUser(Mobile m, string username) public ChatUser(Mobile m, string username)
{ {

View file

@ -12,7 +12,7 @@ namespace Server.Engines.ConPVP
private const int BlackColor32 = 0x000008; private const int BlackColor32 = 0x000008;
private static readonly Dictionary<Mobile, List<IgnoreEntry>> m_IgnoreLists = private static readonly Dictionary<Mobile, List<IgnoreEntry>> m_IgnoreLists =
new Dictionary<Mobile, List<IgnoreEntry>>(); new();
private readonly Mobile m_Challenged; private readonly Mobile m_Challenged;
private readonly Mobile m_Challenger; private readonly Mobile m_Challenger;

View file

@ -31,7 +31,7 @@ namespace Server.Engines.ConPVP
public override string DefaultName => "arena controller"; public override string DefaultName => "arena controller";
public static List<ArenaController> Instances { get; set; } = new List<ArenaController>(); public static List<ArenaController> Instances { get; set; } = new();
public override void OnDelete() public override void OnDelete()
{ {
@ -184,16 +184,16 @@ namespace Server.Engines.ConPVP
* \/\/\ * \/\/\
* \/\/ * \/\/
*/ */
new Point2D(0, 0), new(0, 0),
new Point2D(0, -1), new(0, -1),
new Point2D(0, +1), new(0, +1),
new Point2D(1, 0), new(1, 0),
new Point2D(1, -1), new(1, -1),
new Point2D(1, +1), new(1, +1),
new Point2D(2, 0), new(2, 0),
new Point2D(2, -1), new(2, -1),
new Point2D(2, +1), new(2, +1),
new Point2D(3, 0) new(3, 0)
}; };
// nw corner // nw corner
@ -206,16 +206,16 @@ namespace Server.Engines.ConPVP
* /\/\/\/\ * /\/\/\/\
* \/\/\/\/ * \/\/\/\/
*/ */
new Point2D(0, 0), new(0, 0),
new Point2D(0, 1), new(0, 1),
new Point2D(1, 0), new(1, 0),
new Point2D(1, 1), new(1, 1),
new Point2D(0, 2), new(0, 2),
new Point2D(2, 0), new(2, 0),
new Point2D(2, 1), new(2, 1),
new Point2D(1, 2), new(1, 2),
new Point2D(0, 3), new(0, 3),
new Point2D(3, 0) new(3, 0)
}; };
private static readonly int[][,] m_Rotate = private static readonly int[][,] m_Rotate =
@ -520,7 +520,7 @@ namespace Server.Engines.ConPVP
} }
} }
public static List<Arena> Arenas { get; } = new List<Arena>(); public static List<Arena> Arenas { get; } = new();
public int CompareTo(Arena c) => string.CompareOrdinal(m_Name, c?.m_Name); public int CompareTo(Arena c) => string.CompareOrdinal(m_Name, c?.m_Name);

View file

@ -29,7 +29,7 @@ namespace Server.Engines.ConPVP
private static readonly TimeSpan CombatDelay = TimeSpan.FromSeconds(30.0); private static readonly TimeSpan CombatDelay = TimeSpan.FromSeconds(30.0);
private static readonly TimeSpan AutoTieDelay = TimeSpan.FromMinutes(15.0); private static readonly TimeSpan AutoTieDelay = TimeSpan.FromMinutes(15.0);
private readonly List<Item> m_Walls = new List<Item>(); private readonly List<Item> m_Walls = new();
private Timer m_AutoTieTimer; private Timer m_AutoTieTimer;

View file

@ -16,7 +16,7 @@ namespace Server.Engines.ConPVP
private readonly List<Mobile> m_Helpers; private readonly List<Mobile> m_Helpers;
private readonly Point3DList m_Path = new Point3DList(); private readonly Point3DList m_Path = new();
private readonly EffectTimer m_Timer; private readonly EffectTimer m_Timer;
private bool m_Flying; private bool m_Flying;
private int m_PathIdx; private int m_PathIdx;
@ -449,7 +449,7 @@ namespace Server.Engines.ConPVP
MoveToWorld(m_Path[m_PathIdx - 1]); MoveToWorld(m_Path[m_PathIdx - 1]);
} }
Point3D pTop = new Point3D(GetWorldLocation()), pBottom = new Point3D(m_Path[pathCheckEnd - 1]); Point3D pTop = new(GetWorldLocation()), pBottom = new(m_Path[pathCheckEnd - 1]);
Utility.FixPoints(ref pTop, ref pBottom); Utility.FixPoints(ref pTop, ref pBottom);
for (var i = m_PathIdx; i < pathCheckEnd; i++) for (var i = m_PathIdx; i < pathCheckEnd; i++)

View file

@ -164,7 +164,7 @@ namespace Server.Engines.ConPVP
} }
} }
public List<LadderEntry> Entries { get; } = new List<LadderEntry>(); public List<LadderEntry> Entries { get; } = new();
public static Ladder Instance { get; set; } public static Ladder Instance { get; set; }

View file

@ -19,7 +19,7 @@ namespace Server.Engines.ConPVP
public Ruleset Base { get; private set; } public Ruleset Base { get; private set; }
public List<Ruleset> Flavors { get; } = new List<Ruleset>(); public List<Ruleset> Flavors { get; } = new();
public bool Changed { get; set; } public bool Changed { get; set; }

View file

@ -66,7 +66,7 @@ namespace Server.Engines.ConPVP
var entries = new List<RulesetLayout> var entries = new List<RulesetLayout>
{ {
new RulesetLayout( new(
"Spells", "Spells",
new[] new[]
{ {

View file

@ -7,7 +7,7 @@ namespace Server.Engines.ConPVP
{ {
public class TournamentController : Item public class TournamentController : Item
{ {
private static readonly List<TournamentController> m_Instances = new List<TournamentController>(); private static readonly List<TournamentController> m_Instances = new();
[Constructible] [Constructible]
public TournamentController() : base(0x1B7A) public TournamentController() : base(0x1B7A)

View file

@ -209,7 +209,7 @@ namespace Server.Engines.ConPVP
public class PyramidLevel public class PyramidLevel
{ {
public List<TourneyMatch> Matches { get; set; } = new List<TourneyMatch>(); public List<TourneyMatch> Matches { get; set; } = new();
public TourneyParticipant FreeAdvance { get; set; } public TourneyParticipant FreeAdvance { get; set; }
} }
} }

View file

@ -41,8 +41,7 @@ namespace Server.Engines.ConPVP
var tourney = Tournament?.Tournament; var tourney = Tournament?.Tournament;
if (InRange(m, 4) && !InRange(oldLocation, 4) && tourney != null && tourney.Stage == TournamentStage.Signup && if (InRange(m, 4) && !InRange(oldLocation, 4) && tourney?.Stage == TournamentStage.Signup && m.CanBeginAction(this))
m.CanBeginAction(this))
{ {
var ladder = Ladder.Instance; var ladder = Ladder.Instance;

View file

@ -26,7 +26,7 @@ namespace Server.Engines.Craft
public class CraftItem public class CraftItem
{ {
private static readonly Dictionary<Type, int> _itemIds = new Dictionary<Type, int>(); private static readonly Dictionary<Type, int> _itemIds = new();
private static readonly int[] m_HeatSources = private static readonly int[] m_HeatSources =
{ {

View file

@ -13,7 +13,7 @@ namespace Server.Engines.Craft
public abstract class CraftSystem public abstract class CraftSystem
{ {
private readonly Dictionary<Mobile, CraftContext> m_ContextTable = new Dictionary<Mobile, CraftContext>(); private readonly Dictionary<Mobile, CraftContext> m_ContextTable = new();
private readonly List<int> m_RareRecipes; private readonly List<int> m_RareRecipes;
private readonly List<int> m_Recipes; private readonly List<int> m_Recipes;

View file

@ -24,7 +24,7 @@ namespace Server.Engines.Craft
LargestRecipeID = Math.Max(id, LargestRecipeID); LargestRecipeID = Math.Max(id, LargestRecipeID);
} }
public static Dictionary<int, Recipe> Recipes { get; } = new Dictionary<int, Recipe>(); public static Dictionary<int, Recipe> Recipes { get; } = new();
public static int LargestRecipeID { get; private set; } public static int LargestRecipeID { get; private set; }

View file

@ -56,16 +56,16 @@ namespace Server.Engines.Doom
/* Exit & Enter locations for the lamp room */ /* Exit & Enter locations for the lamp room */
public static Point3D lr_Exit = new Point3D(353, 172, -1); public static Point3D lr_Exit = new(353, 172, -1);
public static Point3D lr_Enter = new Point3D(467, 96, -1); public static Point3D lr_Enter = new(467, 96, -1);
/* "Center" location in puzzle */ /* "Center" location in puzzle */
public static Point3D lp_Center = new Point3D(324, 64, -1); public static Point3D lp_Center = new(324, 64, -1);
/* Lamp Room Area */ /* Lamp Room Area */
public static Rectangle2D lr_Rect = new Rectangle2D(465, 92, 10, 10); public static Rectangle2D lr_Rect = new(465, 92, 10, 10);
/* Lamp Room area Poison message data */ /* Lamp Room area Poison message data */
@ -465,7 +465,7 @@ namespace Server.Engines.Doom
RandomPointIn(rect.X, rect.Y, rect.Height, rect.Width, z); RandomPointIn(rect.X, rect.Y, rect.Height, rect.Width, z);
public static Point3D RandomPointIn(int x, int y, int x2, int y2, int z) => public static Point3D RandomPointIn(int x, int y, int x2, int y2, int z) =>
new Point3D(Utility.Random(x, x2), Utility.Random(y, y2), z); new(Utility.Random(x, x2), Utility.Random(y, y2), z);
public static void PlaySounds(Point3D location, int[] sounds) public static void PlaySounds(Point3D location, int[] sounds)
{ {

Some files were not shown because too many files have changed in this diff Show more