Use 'new' expression in places where the type is evident for content (#2590)

* Content.Client

* Content.Benchmarks

* Content.IntegrationTests

* Content.Server

* Content.Server.Database

* Content.Shared

* Content.Tests

* Merge fixes

Co-authored-by: metalgearsloth <31366439+metalgearsloth@users.noreply.github.com>
This commit is contained in:
DrSmugleaf
2020-11-27 11:00:49 +01:00
committed by GitHub
parent 4a56df749b
commit 5c0cf1b1a0
235 changed files with 431 additions and 433 deletions

View File

@@ -19,7 +19,7 @@ namespace Content.Server.GameObjects.Components.Mobs
}
[ViewVariables(VVAccess.ReadWrite)]
public List<OverlayContainer> ActiveOverlays { get; } = new List<OverlayContainer>();
public List<OverlayContainer> ActiveOverlays { get; } = new();
public override void HandleNetworkMessage(ComponentMessage message, INetChannel netChannel, ICommonSession session = null)
{

View File

@@ -15,7 +15,7 @@ namespace Content.Server.GameObjects.Components.Mobs.Speech
[Dependency] private readonly IChatManager _chatManager = default!;
[Dependency] private readonly IComponentManager _componentManager = default!;
public static readonly Regex SentenceRegex = new Regex(@"(?<=[\.!\?])");
public static readonly Regex SentenceRegex = new(@"(?<=[\.!\?])");
public void Initialize()
{

View File

@@ -18,7 +18,7 @@ namespace Content.Server.GameObjects.Components.Mobs.Speech
}.AsReadOnly();
private string RandomFace => _random.Pick(Faces);
private static readonly Dictionary<string, string> SpecialWords = new Dictionary<string, string>
private static readonly Dictionary<string, string> SpecialWords = new()
{
{ "you", "wu" },
};

View File

@@ -11,7 +11,7 @@ namespace Content.Server.GameObjects.Components.Mobs.State
[ComponentReference(typeof(SharedMobStateManagerComponent))]
public class MobStateManagerComponent : SharedMobStateManagerComponent
{
private readonly Dictionary<DamageState, IMobState> _behavior = new Dictionary<DamageState, IMobState>
private readonly Dictionary<DamageState, IMobState> _behavior = new()
{
{DamageState.Alive, new NormalState()},
{DamageState.Critical, new CriticalState()},