Use 'new' expression in places where the type is evident for the engine (#1415)

Co-authored-by: Pieter-Jan Briers <pieterjan.briers+git@gmail.com>
This commit is contained in:
DrSmugleaf
2020-11-26 00:16:55 +01:00
committed by GitHub
co-authored by Pieter-Jan Briers
parent e82a83223f
commit b8e5b47e7a
242 changed files with 1171 additions and 1174 deletions
@@ -23,7 +23,7 @@ namespace Robust.UnitTesting
public int ChannelCount => _channels.Count;
private readonly Dictionary<int, IntegrationNetChannel> _channels =
new Dictionary<int, IntegrationNetChannel>();
new();
private readonly Channel<object> _messageChannel;
@@ -37,8 +37,8 @@ namespace Robust.UnitTesting
public int Port => default;
public IReadOnlyDictionary<Type, long> MessageBandwidthUsage { get; } = new Dictionary<Type, long>();
private readonly Dictionary<Type, ProcessMessage> _callbacks = new Dictionary<Type, ProcessMessage>();
private readonly HashSet<Type> _registeredMessages = new HashSet<Type>();
private readonly Dictionary<Type, ProcessMessage> _callbacks = new();
private readonly HashSet<Type> _registeredMessages = new();
/// <summary>
/// The channel we will connect to when <see cref="ClientConnect"/> is called.
@@ -249,7 +249,7 @@ namespace Robust.UnitTesting
private readonly List<Func<NetConnectingArgs, Task>> _connectingEvent
= new List<Func<NetConnectingArgs, Task>>();
= new();
public event Func<NetConnectingArgs, Task> Connecting
{
@@ -366,7 +366,7 @@ namespace Robust.UnitTesting
public bool IsConnected { get; }
// TODO: Should this port value make sense?
public IPEndPoint RemoteEndPoint { get; } = new IPEndPoint(IPAddress.Loopback, 1212);
public IPEndPoint RemoteEndPoint { get; } = new(IPAddress.Loopback, 1212);
public NetUserId UserId { get; }
public string UserName { get; }
public LoginType AuthType => LoginType.GuestAssigned;