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
@@ -5,7 +5,7 @@ namespace Robust.Client.GameObjects.EntitySystems
{
internal sealed class AppearanceSystem : EntitySystem
{
private readonly Queue<AppearanceComponent> _updatesQueued = new Queue<AppearanceComponent>();
private readonly Queue<AppearanceComponent> _updatesQueued = new();
public override void FrameUpdate(float frameTime)
{
@@ -29,7 +29,7 @@ namespace Robust.Client.GameObjects.EntitySystems
[Dependency] private readonly IEyeManager _eyeManager = default!;
[Dependency] private readonly IEntityManager _entityManager = default!;
private readonly List<PlayingStream> _playingClydeStreams = new List<PlayingStream>();
private readonly List<PlayingStream> _playingClydeStreams = new();
public int OcclusionCollisionMask;
@@ -24,7 +24,7 @@ namespace Robust.Client.GameObjects.EntitySystems
{
[Dependency] private readonly IMapManager _mapManager = default!;
private readonly Queue<IEntity> _dirtyEntities = new Queue<IEntity>();
private readonly Queue<IEntity> _dirtyEntities = new();
private uint _updateGeneration;
@@ -7,7 +7,7 @@ namespace Robust.Client.GameObjects.EntitySystems
{
public class ContainerSystem : EntitySystem
{
private readonly HashSet<IEntity> _updateQueue = new HashSet<IEntity>();
private readonly HashSet<IEntity> _updateQueue = new();
public override void Initialize()
{
@@ -35,7 +35,7 @@ namespace Robust.Client.GameObjects
[Dependency] private readonly IEntityManager _entityManager = default!;
[Dependency] private readonly IPlayerManager _playerManager = default!;
private readonly List<Effect> _Effects = new List<Effect>();
private readonly List<Effect> _Effects = new();
public override void Initialize()
{
@@ -182,7 +182,7 @@ namespace Robust.Client.GameObjects
/// <summary>
/// Effect's current size
/// </summary>
public Vector2 Size = new Vector2(1f, 1f);
public Vector2 Size = new(1f, 1f);
/// <summary>
/// Rate of change of effect's size change
@@ -192,12 +192,12 @@ namespace Robust.Client.GameObjects
/// <summary>
/// Effect's current color
/// </summary>
public Vector4 Color = new Vector4(255, 255, 255, 255);
public Vector4 Color = new(255, 255, 255, 255);
/// <summary>
/// Rate of change of effect's color
/// </summary>
public Vector4 ColorDelta = new Vector4(0, 0, 0, 0);
public Vector4 ColorDelta = new(0, 0, 0, 0);
/// <summary>
/// True if the effect is affected by lighting.
@@ -22,10 +22,10 @@ namespace Robust.Client.GameObjects.EntitySystems
[Dependency] private readonly IMapManagerInternal _mapManager = default!;
private readonly Dictionary<MapId, MapTrees> _mapTrees = new Dictionary<MapId, MapTrees>();
private readonly Dictionary<MapId, MapTrees> _mapTrees = new();
private readonly List<SpriteComponent> _spriteQueue = new List<SpriteComponent>();
private readonly List<PointLightComponent> _lightQueue = new List<PointLightComponent>();
private readonly List<SpriteComponent> _spriteQueue = new();
private readonly List<PointLightComponent> _lightQueue = new();
internal DynamicTree<SpriteComponent> GetSpriteTreeForMap(MapId map)
{
@@ -27,7 +27,7 @@ namespace Robust.Client.GameObjects.EntitySystems
// Only keep track of transforms actively lerping.
// Much faster than iterating 3000+ transforms every frame.
[ViewVariables] private readonly List<TransformComponent> _lerpingTransforms = new List<TransformComponent>();
[ViewVariables] private readonly List<TransformComponent> _lerpingTransforms = new();
public override void Initialize()
{