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:
@@ -105,7 +105,7 @@ namespace Content.Benchmarks
|
||||
[MethodImpl(AggressiveOpt)]
|
||||
public static Color InterpolateSimple(Color a, Color b, float lambda)
|
||||
{
|
||||
return new Color(
|
||||
return new(
|
||||
a.R + (b.R - a.R) * lambda,
|
||||
a.G + (b.G - a.G) * lambda,
|
||||
a.B + (b.G - a.B) * lambda,
|
||||
|
||||
@@ -11,14 +11,14 @@ namespace Content.Benchmarks
|
||||
[Params(5000)] public int NEnt { get; set; }
|
||||
|
||||
private readonly Dictionary<(EntityUid, Type), BComponent>
|
||||
_componentsFlat = new Dictionary<(EntityUid, Type), BComponent>();
|
||||
_componentsFlat = new();
|
||||
|
||||
private readonly Dictionary<Type, Dictionary<EntityUid, BComponent>> _componentsPart =
|
||||
new Dictionary<Type, Dictionary<EntityUid, BComponent>>();
|
||||
new();
|
||||
|
||||
private UniqueIndex<Type, BComponent> _allComponents = new UniqueIndex<Type, BComponent>();
|
||||
private UniqueIndex<Type, BComponent> _allComponents = new();
|
||||
|
||||
private readonly List<EntityUid> _lookupEntities = new List<EntityUid>();
|
||||
private readonly List<EntityUid> _lookupEntities = new();
|
||||
|
||||
[GlobalSetup]
|
||||
public void Setup()
|
||||
|
||||
@@ -13,7 +13,7 @@ namespace Content.Benchmarks
|
||||
{
|
||||
public class ComponentManagerGetAllComponents
|
||||
{
|
||||
private readonly List<IEntity> _entities = new List<IEntity>();
|
||||
private readonly List<IEntity> _entities = new();
|
||||
|
||||
private IComponentManager _componentManager;
|
||||
|
||||
|
||||
@@ -11,10 +11,10 @@ namespace Content.Benchmarks
|
||||
{
|
||||
((Box2) default).Enlarged(1), //2x2 square
|
||||
((Box2) default).Enlarged(2), //4x4 square
|
||||
new Box2(-3, 3, -3, 3), // point off to the bottom left
|
||||
new Box2(-3, -3, -3, -3), // point off to the top left
|
||||
new Box2(3, 3, 3, 3), // point off to the bottom right
|
||||
new Box2(3, -3, 3, -3), // point off to the top right
|
||||
new(-3, 3, -3, 3), // point off to the bottom left
|
||||
new(-3, -3, -3, -3), // point off to the top left
|
||||
new(3, 3, 3, 3), // point off to the bottom right
|
||||
new(3, -3, 3, -3), // point off to the top right
|
||||
((Box2) default).Enlarged(1), //2x2 square
|
||||
((Box2) default).Enlarged(2), //4x4 square
|
||||
((Box2) default).Enlarged(1), //2x2 square
|
||||
@@ -24,10 +24,10 @@ namespace Content.Benchmarks
|
||||
((Box2) default).Enlarged(1), //2x2 square
|
||||
((Box2) default).Enlarged(2), //4x4 square
|
||||
((Box2) default).Enlarged(3), //6x6 square
|
||||
new Box2(-3, 3, -3, 3), // point off to the bottom left
|
||||
new Box2(-3, -3, -3, -3), // point off to the top left
|
||||
new Box2(3, 3, 3, 3), // point off to the bottom right
|
||||
new Box2(3, -3, 3, -3), // point off to the top right
|
||||
new(-3, 3, -3, 3), // point off to the bottom left
|
||||
new(-3, -3, -3, -3), // point off to the top left
|
||||
new(3, 3, 3, 3), // point off to the bottom right
|
||||
new(3, -3, 3, -3), // point off to the top right
|
||||
};
|
||||
|
||||
private B2DynamicTree<int> _b2Tree;
|
||||
|
||||
@@ -12,8 +12,8 @@ namespace Content.Benchmarks
|
||||
|
||||
public int M { get; set; } = 10;
|
||||
|
||||
private readonly DictEntityStorage _dictStorage = new DictEntityStorage();
|
||||
private readonly GenEntityStorage _genStorage = new GenEntityStorage();
|
||||
private readonly DictEntityStorage _dictStorage = new();
|
||||
private readonly GenEntityStorage _genStorage = new();
|
||||
|
||||
private IEntityStorage<DictEntity, DictEntityUid> _dictStorageInterface;
|
||||
private IEntityStorage<GenEntity, GenEntityUid> _genStorageInterface;
|
||||
@@ -146,7 +146,7 @@ namespace Content.Benchmarks
|
||||
{
|
||||
private int _nextValue;
|
||||
|
||||
private readonly Dictionary<DictEntityUid, DictEntity> _dict = new Dictionary<DictEntityUid, DictEntity>();
|
||||
private readonly Dictionary<DictEntityUid, DictEntity> _dict = new();
|
||||
|
||||
public override bool TryGetEntity(DictEntityUid entityUid, out DictEntity entity)
|
||||
{
|
||||
@@ -198,7 +198,7 @@ namespace Content.Benchmarks
|
||||
private sealed class GenEntityStorage : EntityStorage<GenEntity, GenEntityUid>
|
||||
{
|
||||
private (int generation, GenEntity entity)[] _entities = new (int, GenEntity)[1];
|
||||
private readonly List<int> _availableSlots = new List<int> {0};
|
||||
private readonly List<int> _availableSlots = new() {0};
|
||||
|
||||
public override bool TryGetEntity(GenEntityUid entityUid, out GenEntity entity)
|
||||
{
|
||||
|
||||
@@ -23,8 +23,8 @@ namespace Content.Benchmarks
|
||||
[Params(8, 64, 256, 1024)]
|
||||
public int StringLength { get; set; }
|
||||
|
||||
private readonly MemoryStream _outputStream = new MemoryStream(2048);
|
||||
private readonly MemoryStream _inputStream = new MemoryStream(2048);
|
||||
private readonly MemoryStream _outputStream = new(2048);
|
||||
private readonly MemoryStream _inputStream = new(2048);
|
||||
|
||||
[GlobalSetup]
|
||||
public void Setup()
|
||||
|
||||
@@ -17,7 +17,7 @@ namespace Content.Client.Administration
|
||||
[Dependency] private readonly IClientConGroupController _conGroup = default!;
|
||||
|
||||
private AdminData? _adminData;
|
||||
private readonly HashSet<string> _availableCommands = new HashSet<string>();
|
||||
private readonly HashSet<string> _availableCommands = new();
|
||||
|
||||
public event Action? AdminStatusUpdated;
|
||||
|
||||
|
||||
@@ -18,10 +18,10 @@ namespace Content.Client.Arcade
|
||||
{
|
||||
public class BlockGameMenu : SS14Window
|
||||
{
|
||||
private static readonly Color OverlayBackgroundColor = new Color(74,74,81,180);
|
||||
private static readonly Color OverlayShadowColor = new Color(0,0,0,83);
|
||||
private static readonly Color OverlayBackgroundColor = new(74,74,81,180);
|
||||
private static readonly Color OverlayShadowColor = new(0,0,0,83);
|
||||
|
||||
private static readonly Vector2 BlockSize = new Vector2(15,15);
|
||||
private static readonly Vector2 BlockSize = new(15,15);
|
||||
|
||||
private readonly BlockGameBoundUserInterface _owner;
|
||||
|
||||
|
||||
@@ -61,7 +61,7 @@ namespace Content.Client.Chat
|
||||
private const char MeAlias = '@';
|
||||
private const char AdminChatAlias = ']';
|
||||
|
||||
private readonly List<StoredChatMessage> filteredHistory = new List<StoredChatMessage>();
|
||||
private readonly List<StoredChatMessage> filteredHistory = new();
|
||||
|
||||
// Filter Button States
|
||||
private bool _allState;
|
||||
@@ -88,13 +88,13 @@ namespace Content.Client.Chat
|
||||
/// We track them to push them up when new ones get added.
|
||||
/// </summary>
|
||||
private readonly Dictionary<EntityUid, List<SpeechBubble>> _activeSpeechBubbles =
|
||||
new Dictionary<EntityUid, List<SpeechBubble>>();
|
||||
new();
|
||||
|
||||
/// <summary>
|
||||
/// Speech bubbles that are to-be-sent because of the "rate limit" they have.
|
||||
/// </summary>
|
||||
private readonly Dictionary<EntityUid, SpeechBubbleQueueData> _queuedSpeechBubbles
|
||||
= new Dictionary<EntityUid, SpeechBubbleQueueData>();
|
||||
= new();
|
||||
|
||||
public void Initialize()
|
||||
{
|
||||
@@ -532,7 +532,7 @@ namespace Content.Client.Chat
|
||||
/// </summary>
|
||||
public float TimeLeft { get; set; }
|
||||
|
||||
public Queue<SpeechBubbleData> MessageQueue { get; } = new Queue<SpeechBubbleData>();
|
||||
public Queue<SpeechBubbleData> MessageQueue { get; } = new();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -22,10 +22,10 @@ namespace Content.Client
|
||||
[Dependency] private readonly IResourceCache _resourceCache = default!;
|
||||
|
||||
[ViewVariables]
|
||||
private readonly Dictionary<Texture, ClickMap> _textureMaps = new Dictionary<Texture, ClickMap>();
|
||||
private readonly Dictionary<Texture, ClickMap> _textureMaps = new();
|
||||
|
||||
[ViewVariables] private readonly Dictionary<RSI, RsiClickMapData> _rsiMaps =
|
||||
new Dictionary<RSI, RsiClickMapData>();
|
||||
new();
|
||||
|
||||
public void PostInject()
|
||||
{
|
||||
|
||||
@@ -29,7 +29,7 @@ namespace Content.Client
|
||||
[Dependency] private readonly IClientNetManager _netManager = default!;
|
||||
[Dependency] private readonly IEntityManager _entityManager = default!;
|
||||
|
||||
private readonly List<PopupLabel> _aliveLabels = new List<PopupLabel>();
|
||||
private readonly List<PopupLabel> _aliveLabels = new();
|
||||
private bool _initialized;
|
||||
|
||||
public void Initialize()
|
||||
|
||||
@@ -15,7 +15,7 @@ namespace Content.Client.Command
|
||||
protected override Vector2? CustomSize => new Vector2(600, 400);
|
||||
|
||||
private CommunicationsConsoleBoundUserInterface Owner { get; set; }
|
||||
private readonly CancellationTokenSource _timerCancelTokenSource = new CancellationTokenSource();
|
||||
private readonly CancellationTokenSource _timerCancelTokenSource = new();
|
||||
private readonly Button _emergencyShuttleButton;
|
||||
private readonly RichTextLabel _countdownLabel;
|
||||
|
||||
|
||||
@@ -143,7 +143,7 @@ namespace Content.Client.Construction
|
||||
|
||||
private static ItemList.Item GetItem(ConstructionPrototype recipe, ItemList itemList)
|
||||
{
|
||||
return new ItemList.Item(itemList)
|
||||
return new(itemList)
|
||||
{
|
||||
Metadata = recipe,
|
||||
Text = recipe.Name,
|
||||
|
||||
@@ -15,7 +15,7 @@ namespace Content.Client.Eui
|
||||
[Dependency] private readonly IReflectionManager _refl = default!;
|
||||
[Dependency] private readonly IDynamicTypeFactory _dtf = default!;
|
||||
|
||||
private readonly Dictionary<uint, EuiData> _openUis = new Dictionary<uint, EuiData>();
|
||||
private readonly Dictionary<uint, EuiData> _openUis = new();
|
||||
|
||||
public void Initialize()
|
||||
{
|
||||
|
||||
@@ -29,7 +29,7 @@ namespace Content.Client.GameObjects.Components.Access
|
||||
|
||||
private readonly IdCardConsoleBoundUserInterface _owner;
|
||||
|
||||
private readonly Dictionary<string, Button> _accessButtons = new Dictionary<string, Button>();
|
||||
private readonly Dictionary<string, Button> _accessButtons = new();
|
||||
|
||||
private string _lastFullName;
|
||||
private string _lastJobTitle;
|
||||
|
||||
@@ -9,7 +9,7 @@ namespace Content.Client.GameObjects.Components.Cargo
|
||||
[RegisterComponent]
|
||||
public class CargoOrderDatabaseComponent : SharedCargoOrderDatabaseComponent
|
||||
{
|
||||
private readonly List<CargoOrderData> _orders = new List<CargoOrderData>();
|
||||
private readonly List<CargoOrderData> _orders = new();
|
||||
|
||||
public IReadOnlyList<CargoOrderData> Orders => _orders;
|
||||
/// <summary>
|
||||
|
||||
@@ -130,7 +130,7 @@ namespace Content.Client.GameObjects.Components
|
||||
[ViewVariables] public Box2 East;
|
||||
[ViewVariables] public Box2 West;
|
||||
|
||||
public static DirBoundData Default { get; } = new DirBoundData();
|
||||
public static DirBoundData Default { get; } = new();
|
||||
|
||||
public void ExposeData(ObjectSerializer serializer)
|
||||
{
|
||||
|
||||
@@ -33,7 +33,7 @@ namespace Content.Client.GameObjects.Components.CloningPod
|
||||
private CloningPodBoundUserInterfaceState _lastUpdate = null!;
|
||||
|
||||
// List of scans that are visible based on current filter criteria.
|
||||
private readonly Dictionary<int, string> _filteredScans = new Dictionary<int, string>();
|
||||
private readonly Dictionary<int, string> _filteredScans = new();
|
||||
|
||||
// The indices of the visible scans last time UpdateVisibleScans was ran.
|
||||
// This is inclusive, so end is the index of the last scan, not right after it.
|
||||
|
||||
@@ -17,10 +17,9 @@ namespace Content.Client.GameObjects.Components
|
||||
public override string Name => "DoAfter";
|
||||
|
||||
public IReadOnlyDictionary<byte, ClientDoAfter> DoAfters => _doAfters;
|
||||
private readonly Dictionary<byte, ClientDoAfter> _doAfters = new Dictionary<byte, ClientDoAfter>();
|
||||
|
||||
public readonly List<(TimeSpan CancelTime, ClientDoAfter Message)> CancelledDoAfters =
|
||||
new List<(TimeSpan CancelTime, ClientDoAfter Message)>();
|
||||
private readonly Dictionary<byte, ClientDoAfter> _doAfters = new();
|
||||
|
||||
public readonly List<(TimeSpan CancelTime, ClientDoAfter Message)> CancelledDoAfters = new();
|
||||
|
||||
public DoAfterGui? Gui { get; set; }
|
||||
|
||||
|
||||
@@ -12,7 +12,7 @@ namespace Content.Client.GameObjects.Components
|
||||
[UsedImplicitly]
|
||||
public class FlashLightVisualizer : AppearanceVisualizer
|
||||
{
|
||||
private readonly Animation _radiatingLightAnimation = new Animation
|
||||
private readonly Animation _radiatingLightAnimation = new()
|
||||
{
|
||||
Length = TimeSpan.FromSeconds(1),
|
||||
AnimationTracks =
|
||||
@@ -32,7 +32,7 @@ namespace Content.Client.GameObjects.Components
|
||||
}
|
||||
};
|
||||
|
||||
private readonly Animation _blinkingLightAnimation = new Animation
|
||||
private readonly Animation _blinkingLightAnimation = new()
|
||||
{
|
||||
Length = TimeSpan.FromSeconds(1),
|
||||
AnimationTracks =
|
||||
|
||||
@@ -11,7 +11,7 @@ namespace Content.Client.GameObjects.Components.Gravity
|
||||
{
|
||||
public class GravityGeneratorVisualizer : AppearanceVisualizer
|
||||
{
|
||||
private readonly Dictionary<GravityGeneratorStatus, string> _spriteMap = new Dictionary<GravityGeneratorStatus, string>();
|
||||
private readonly Dictionary<GravityGeneratorStatus, string> _spriteMap = new();
|
||||
|
||||
public override void InitializeEntity(IEntity entity)
|
||||
{
|
||||
|
||||
@@ -22,7 +22,7 @@ namespace Content.Client.GameObjects.Components.HUD.Inventory
|
||||
[RegisterComponent]
|
||||
public class ClientInventoryComponent : SharedInventoryComponent
|
||||
{
|
||||
private readonly Dictionary<Slots, IEntity> _slots = new Dictionary<Slots, IEntity>();
|
||||
private readonly Dictionary<Slots, IEntity> _slots = new();
|
||||
|
||||
[ViewVariables] public InventoryInterfaceController InterfaceController { get; private set; } = default!;
|
||||
|
||||
|
||||
@@ -22,7 +22,7 @@ namespace Content.Client.GameObjects.Components.HUD.Inventory
|
||||
[Dependency] private readonly IItemSlotManager _itemSlotManager = default!;
|
||||
|
||||
private readonly Dictionary<Slots, List<ItemSlotButton>> _inventoryButtons
|
||||
= new Dictionary<Slots, List<ItemSlotButton>>();
|
||||
= new();
|
||||
|
||||
private ItemSlotButton _hudButtonPocket1;
|
||||
private ItemSlotButton _hudButtonPocket2;
|
||||
|
||||
@@ -42,12 +42,12 @@ namespace Content.Client.GameObjects.Components
|
||||
|
||||
private float _timer;
|
||||
|
||||
private static readonly StyleBoxFlat _styleBoxLit = new StyleBoxFlat
|
||||
private static readonly StyleBoxFlat _styleBoxLit = new()
|
||||
{
|
||||
BackgroundColor = Color.Green
|
||||
};
|
||||
|
||||
private static readonly StyleBoxFlat _styleBoxUnlit = new StyleBoxFlat
|
||||
private static readonly StyleBoxFlat _styleBoxUnlit = new()
|
||||
{
|
||||
BackgroundColor = Color.Black
|
||||
};
|
||||
|
||||
@@ -50,7 +50,7 @@ namespace Content.Client.GameObjects.Components.Instruments
|
||||
/// A queue of MidiEvents to be sent to the server.
|
||||
/// </summary>
|
||||
[ViewVariables]
|
||||
private readonly List<MidiEvent> _midiEventBuffer = new List<MidiEvent>();
|
||||
private readonly List<MidiEvent> _midiEventBuffer = new();
|
||||
|
||||
/// <summary>
|
||||
/// Whether a midi song will loop or not.
|
||||
|
||||
@@ -21,7 +21,7 @@ namespace Content.Client.GameObjects.Components.Items
|
||||
|
||||
private HandsGui? _gui;
|
||||
|
||||
private readonly List<Hand> _hands = new List<Hand>();
|
||||
private readonly List<Hand> _hands = new();
|
||||
|
||||
[ViewVariables] public IReadOnlyList<Hand> Hands => _hands;
|
||||
|
||||
|
||||
@@ -26,8 +26,8 @@ namespace Content.Client.GameObjects.Components.Kitchen
|
||||
|
||||
private MicrowaveMenu _menu;
|
||||
|
||||
private readonly Dictionary<int, EntityUid> _solids = new Dictionary<int, EntityUid>();
|
||||
private readonly Dictionary<int, Solution.ReagentQuantity> _reagents =new Dictionary<int, Solution.ReagentQuantity>();
|
||||
private readonly Dictionary<int, EntityUid> _solids = new();
|
||||
private readonly Dictionary<int, Solution.ReagentQuantity> _reagents =new();
|
||||
|
||||
public MicrowaveBoundUserInterface(ClientUserInterfaceComponent owner, object uiKey) : base(owner,uiKey)
|
||||
{
|
||||
|
||||
@@ -11,7 +11,7 @@ namespace Content.Client.GameObjects.Components
|
||||
[UsedImplicitly]
|
||||
public class LanternVisualizer : AppearanceVisualizer
|
||||
{
|
||||
private readonly Animation _radiatingLightAnimation = new Animation
|
||||
private readonly Animation _radiatingLightAnimation = new()
|
||||
{
|
||||
Length = TimeSpan.FromSeconds(5),
|
||||
AnimationTracks =
|
||||
|
||||
@@ -361,7 +361,7 @@ namespace Content.Client.GameObjects.Components
|
||||
}
|
||||
|
||||
[ViewVariables(VVAccess.ReadOnly)]
|
||||
private readonly List<AnimationContainer> _animations = new List<AnimationContainer>();
|
||||
private readonly List<AnimationContainer> _animations = new();
|
||||
|
||||
private float _originalRadius = default;
|
||||
private float _originalEnergy = default;
|
||||
|
||||
@@ -45,7 +45,7 @@ namespace Content.Client.GameObjects.Components.Mobs
|
||||
|
||||
[ViewVariables]
|
||||
private readonly Dictionary<AlertKey, AlertControl> _alertControls
|
||||
= new Dictionary<AlertKey, AlertControl>();
|
||||
= new();
|
||||
|
||||
/// <summary>
|
||||
/// Allows calculating if we need to act due to this component being controlled by the current mob
|
||||
|
||||
@@ -31,7 +31,7 @@ namespace Content.Client.GameObjects.Components.Mobs
|
||||
/// <summary>
|
||||
/// A list of overlay containers representing the current overlays applied
|
||||
/// </summary>
|
||||
private List<OverlayContainer> _currentEffects = new List<OverlayContainer>();
|
||||
private List<OverlayContainer> _currentEffects = new();
|
||||
|
||||
[ViewVariables(VVAccess.ReadOnly)]
|
||||
public List<OverlayContainer> ActiveOverlays
|
||||
|
||||
@@ -14,7 +14,7 @@ namespace Content.Client.GameObjects.Components.Mobs
|
||||
public sealed class DamageStateVisualizer : AppearanceVisualizer
|
||||
{
|
||||
private DamageState _data = DamageState.Alive;
|
||||
private readonly Dictionary<DamageState, string> _stateMap = new Dictionary<DamageState, string>();
|
||||
private readonly Dictionary<DamageState, string> _stateMap = new();
|
||||
private int? _originalDrawDepth;
|
||||
|
||||
public override void LoadData(YamlMappingNode node)
|
||||
|
||||
@@ -10,7 +10,7 @@ namespace Content.Client.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()},
|
||||
|
||||
@@ -19,8 +19,8 @@ namespace Content.Client.GameObjects.Components.Observer
|
||||
[Dependency] private readonly IGameHud _gameHud = default!;
|
||||
[Dependency] private readonly IPlayerManager _playerManager = default!;
|
||||
[Dependency] private readonly IComponentManager _componentManager = default!;
|
||||
public List<string> WarpNames = new List<string>();
|
||||
public Dictionary<EntityUid,string> PlayerNames = new Dictionary<EntityUid,string>();
|
||||
public List<string> WarpNames = new();
|
||||
public Dictionary<EntityUid,string> PlayerNames = new();
|
||||
|
||||
private GhostGui? _gui ;
|
||||
|
||||
|
||||
@@ -21,7 +21,7 @@ namespace Content.Client.GameObjects.Components
|
||||
{
|
||||
public class ParticleAcceleratorPartVisualizer : AppearanceVisualizer
|
||||
{
|
||||
private readonly Dictionary<ParticleAcceleratorVisualState, string> _states = new Dictionary<ParticleAcceleratorVisualState, string>();
|
||||
private readonly Dictionary<ParticleAcceleratorVisualState, string> _states = new();
|
||||
|
||||
public override void LoadData(YamlMappingNode node)
|
||||
{
|
||||
|
||||
@@ -17,7 +17,7 @@ namespace Content.Client.GameObjects.Components.Power
|
||||
[Dependency] private readonly IGameTiming _gameTiming = default;
|
||||
|
||||
private SolarControlWindow _window;
|
||||
private SolarControlConsoleBoundInterfaceState _lastState = new SolarControlConsoleBoundInterfaceState(0, 0, 0, 0);
|
||||
private SolarControlConsoleBoundInterfaceState _lastState = new(0, 0, 0, 0);
|
||||
|
||||
protected override void Open()
|
||||
{
|
||||
@@ -161,7 +161,7 @@ namespace Content.Client.GameObjects.Components.Power
|
||||
// This makes the display feel a lot smoother.
|
||||
private IGameTiming _gameTiming;
|
||||
|
||||
private SolarControlConsoleBoundInterfaceState _lastState = new SolarControlConsoleBoundInterfaceState(0, 0, 0, 0);
|
||||
private SolarControlConsoleBoundInterfaceState _lastState = new(0, 0, 0, 0);
|
||||
|
||||
private TimeSpan _lastStateTime = TimeSpan.Zero;
|
||||
|
||||
|
||||
@@ -25,7 +25,7 @@ namespace Content.Client.GameObjects.Components.Research
|
||||
|
||||
[ViewVariables]
|
||||
public Queue<LatheRecipePrototype> QueuedRecipes => _queuedRecipes;
|
||||
private readonly Queue<LatheRecipePrototype> _queuedRecipes = new Queue<LatheRecipePrototype>();
|
||||
private readonly Queue<LatheRecipePrototype> _queuedRecipes = new();
|
||||
|
||||
public LatheBoundUserInterface(ClientUserInterfaceComponent owner, object uiKey) : base(owner, uiKey)
|
||||
{
|
||||
|
||||
@@ -9,7 +9,7 @@ namespace Content.Client.GameObjects.Components.Research
|
||||
[ComponentReference(typeof(SharedMaterialStorageComponent))]
|
||||
public class MaterialStorageComponent : SharedMaterialStorageComponent
|
||||
{
|
||||
protected override Dictionary<string, int> Storage { get; set; } = new Dictionary<string, int>();
|
||||
protected override Dictionary<string, int> Storage { get; set; } = new();
|
||||
|
||||
public event Action OnMaterialStorageChanged;
|
||||
|
||||
|
||||
@@ -21,7 +21,7 @@ namespace Content.Client.GameObjects.Components.Sound
|
||||
{
|
||||
[Dependency] private readonly IRobustRandom _random = default!;
|
||||
|
||||
private readonly Dictionary<ScheduledSound, IPlayingAudioStream> _audioStreams = new Dictionary<ScheduledSound, IPlayingAudioStream>();
|
||||
private readonly Dictionary<ScheduledSound, IPlayingAudioStream> _audioStreams = new();
|
||||
private AudioSystem _audioSystem;
|
||||
|
||||
public override void StopAllSounds()
|
||||
|
||||
@@ -25,7 +25,7 @@ namespace Content.Client.GameObjects.Components.Storage
|
||||
[RegisterComponent]
|
||||
public class ClientStorageComponent : SharedStorageComponent, IDraggable
|
||||
{
|
||||
private List<IEntity> _storedEntities = new List<IEntity>();
|
||||
private List<IEntity> _storedEntities = new();
|
||||
private int StorageSizeUsed;
|
||||
private int StorageCapacityMax;
|
||||
private StorageWindow Window;
|
||||
@@ -138,8 +138,8 @@ namespace Content.Client.GameObjects.Components.Storage
|
||||
private readonly Label _information;
|
||||
public ClientStorageComponent StorageEntity;
|
||||
|
||||
private readonly StyleBoxFlat _hoveredBox = new StyleBoxFlat { BackgroundColor = Color.Black.WithAlpha(0.35f) };
|
||||
private readonly StyleBoxFlat _unHoveredBox = new StyleBoxFlat { BackgroundColor = Color.Black.WithAlpha(0.0f) };
|
||||
private readonly StyleBoxFlat _hoveredBox = new() { BackgroundColor = Color.Black.WithAlpha(0.35f) };
|
||||
private readonly StyleBoxFlat _unHoveredBox = new() { BackgroundColor = Color.Black.WithAlpha(0.0f) };
|
||||
|
||||
protected override Vector2? CustomSize => (180, 320);
|
||||
|
||||
|
||||
@@ -67,7 +67,7 @@ namespace Content.Client.GameObjects.Components.Suspicion
|
||||
}
|
||||
}
|
||||
|
||||
public HashSet<EntityUid> Allies { get; } = new HashSet<EntityUid>();
|
||||
public HashSet<EntityUid> Allies { get; } = new();
|
||||
|
||||
private bool AddAlly(EntityUid ally)
|
||||
{
|
||||
|
||||
@@ -23,7 +23,7 @@ namespace Content.Client.GameObjects.Components.Suspicion
|
||||
private readonly Font _font;
|
||||
|
||||
private readonly IEntity _user;
|
||||
private readonly HashSet<EntityUid> _allies = new HashSet<EntityUid>();
|
||||
private readonly HashSet<EntityUid> _allies = new();
|
||||
private readonly string _traitorText = Loc.GetString("Traitor");
|
||||
|
||||
public TraitorOverlay(
|
||||
|
||||
@@ -26,7 +26,7 @@ namespace Content.Client.GameObjects.Components.VendingMachines
|
||||
private Dictionary<string, bool> _baseStates;
|
||||
|
||||
private static readonly Dictionary<string, VendingMachineVisualLayers> LayerMap =
|
||||
new Dictionary<string, VendingMachineVisualLayers>
|
||||
new()
|
||||
{
|
||||
{"off", VendingMachineVisualLayers.Unlit},
|
||||
{"screen", VendingMachineVisualLayers.Screen},
|
||||
@@ -39,7 +39,7 @@ namespace Content.Client.GameObjects.Components.VendingMachines
|
||||
{"broken", VendingMachineVisualLayers.Unlit},
|
||||
};
|
||||
|
||||
private readonly Dictionary<string, Animation> _animations = new Dictionary<string, Animation>();
|
||||
private readonly Dictionary<string, Animation> _animations = new();
|
||||
|
||||
public override void LoadData(YamlMappingNode node)
|
||||
{
|
||||
|
||||
@@ -22,7 +22,7 @@ namespace Content.Client.GameObjects.Components.Weapons.Ranged.Barrels
|
||||
[RegisterComponent]
|
||||
public class ClientMagazineBarrelComponent : Component, IItemStatus
|
||||
{
|
||||
private static readonly Animation AlarmAnimationSmg = new Animation
|
||||
private static readonly Animation AlarmAnimationSmg = new()
|
||||
{
|
||||
Length = TimeSpan.FromSeconds(1.4),
|
||||
AnimationTracks =
|
||||
@@ -45,7 +45,7 @@ namespace Content.Client.GameObjects.Components.Weapons.Ranged.Barrels
|
||||
}
|
||||
};
|
||||
|
||||
private static readonly Animation AlarmAnimationLmg = new Animation
|
||||
private static readonly Animation AlarmAnimationLmg = new()
|
||||
{
|
||||
Length = TimeSpan.FromSeconds(0.75),
|
||||
AnimationTracks =
|
||||
|
||||
@@ -481,7 +481,7 @@ namespace Content.Client.GameObjects.Components.Wires
|
||||
|
||||
private sealed class StatusLight : Control
|
||||
{
|
||||
private static readonly Animation _blinkingFast = new Animation
|
||||
private static readonly Animation _blinkingFast = new()
|
||||
{
|
||||
Length = TimeSpan.FromSeconds(0.2),
|
||||
AnimationTracks =
|
||||
@@ -500,7 +500,7 @@ namespace Content.Client.GameObjects.Components.Wires
|
||||
}
|
||||
};
|
||||
|
||||
private static readonly Animation _blinkingSlow = new Animation
|
||||
private static readonly Animation _blinkingSlow = new()
|
||||
{
|
||||
Length = TimeSpan.FromSeconds(0.8),
|
||||
AnimationTracks =
|
||||
|
||||
@@ -19,7 +19,7 @@ namespace Content.Client.GameObjects.EntitySystems.AI
|
||||
[Dependency] private readonly IEyeManager _eyeManager = default!;
|
||||
|
||||
private AiDebugMode _tooltips = AiDebugMode.None;
|
||||
private readonly Dictionary<IEntity, PanelContainer> _aiBoxes = new Dictionary<IEntity,PanelContainer>();
|
||||
private readonly Dictionary<IEntity, PanelContainer> _aiBoxes = new();
|
||||
|
||||
public override void Update(float frameTime)
|
||||
{
|
||||
|
||||
@@ -179,27 +179,27 @@ namespace Content.Client.GameObjects.EntitySystems.AI
|
||||
public PathfindingDebugMode Modes { get; set; } = PathfindingDebugMode.None;
|
||||
|
||||
// Graph debugging
|
||||
public readonly Dictionary<int, List<Vector2>> Graph = new Dictionary<int, List<Vector2>>();
|
||||
private readonly Dictionary<int, Color> _graphColors = new Dictionary<int, Color>();
|
||||
public readonly Dictionary<int, List<Vector2>> Graph = new();
|
||||
private readonly Dictionary<int, Color> _graphColors = new();
|
||||
|
||||
// Cached regions
|
||||
public readonly Dictionary<GridId, Dictionary<int, List<Vector2>>> CachedRegions =
|
||||
new Dictionary<GridId, Dictionary<int, List<Vector2>>>();
|
||||
new();
|
||||
|
||||
private readonly Dictionary<GridId, Dictionary<int, Color>> _cachedRegionColors =
|
||||
new Dictionary<GridId, Dictionary<int, Color>>();
|
||||
new();
|
||||
|
||||
// Regions
|
||||
public readonly Dictionary<GridId, Dictionary<int, Dictionary<int, List<Vector2>>>> Regions =
|
||||
new Dictionary<GridId, Dictionary<int, Dictionary<int, List<Vector2>>>>();
|
||||
new();
|
||||
|
||||
private readonly Dictionary<GridId, Dictionary<int, Dictionary<int, Color>>> _regionColors =
|
||||
new Dictionary<GridId, Dictionary<int, Dictionary<int, Color>>>();
|
||||
new();
|
||||
|
||||
// Route debugging
|
||||
// As each pathfinder is very different you'll likely want to draw them completely different
|
||||
public readonly List<SharedAiDebug.AStarRouteMessage> AStarRoutes = new List<SharedAiDebug.AStarRouteMessage>();
|
||||
public readonly List<SharedAiDebug.JpsRouteMessage> JpsRoutes = new List<SharedAiDebug.JpsRouteMessage>();
|
||||
public readonly List<SharedAiDebug.AStarRouteMessage> AStarRoutes = new();
|
||||
public readonly List<SharedAiDebug.JpsRouteMessage> JpsRoutes = new();
|
||||
|
||||
public DebugPathfindingOverlay() : base(nameof(DebugPathfindingOverlay))
|
||||
{
|
||||
|
||||
@@ -18,7 +18,7 @@ namespace Content.Client.GameObjects.EntitySystems
|
||||
[Dependency] private readonly IMapManager _mapManager = default!;
|
||||
|
||||
private readonly Dictionary<GridId, AtmosDebugOverlayMessage> _tileData =
|
||||
new Dictionary<GridId, AtmosDebugOverlayMessage>();
|
||||
new();
|
||||
|
||||
public override void Initialize()
|
||||
{
|
||||
|
||||
@@ -29,7 +29,7 @@ namespace Content.Client.GameObjects.EntitySystems
|
||||
[Dependency] private readonly IPlayerManager _playerManager = default!;
|
||||
|
||||
private int _nextId;
|
||||
private readonly Dictionary<int, ConstructionGhostComponent> _ghosts = new Dictionary<int, ConstructionGhostComponent>();
|
||||
private readonly Dictionary<int, ConstructionGhostComponent> _ghosts = new();
|
||||
private ConstructionMenu _constructionMenu;
|
||||
|
||||
/// <inheritdoc />
|
||||
|
||||
@@ -21,11 +21,11 @@ namespace Content.Client.GameObjects.EntitySystems.DoAfter
|
||||
[Dependency] private readonly IEyeManager _eyeManager = default!;
|
||||
[Dependency] private readonly IGameTiming _gameTiming = default!;
|
||||
|
||||
private readonly Dictionary<byte, PanelContainer> _doAfterControls = new Dictionary<byte, PanelContainer>();
|
||||
private readonly Dictionary<byte, DoAfterBar> _doAfterBars = new Dictionary<byte, DoAfterBar>();
|
||||
private readonly Dictionary<byte, PanelContainer> _doAfterControls = new();
|
||||
private readonly Dictionary<byte, DoAfterBar> _doAfterBars = new();
|
||||
|
||||
// We'll store cancellations for a little bit just so we can flash the graphic to indicate it's cancelled
|
||||
private readonly Dictionary<byte, TimeSpan> _cancelledDoAfters = new Dictionary<byte, TimeSpan>();
|
||||
private readonly Dictionary<byte, TimeSpan> _cancelledDoAfters = new();
|
||||
|
||||
public IEntity? AttachedEntity { get; set; }
|
||||
private ScreenCoordinates _playerPosition;
|
||||
|
||||
@@ -35,7 +35,7 @@ namespace Content.Client.GameObjects.EntitySystems.DoAfter
|
||||
|
||||
// Each component in range will have its own vBox which we need to keep track of so if they go out of range or
|
||||
// come into range it needs altering
|
||||
private readonly HashSet<DoAfterComponent> _knownComponents = new HashSet<DoAfterComponent>();
|
||||
private readonly HashSet<DoAfterComponent> _knownComponents = new();
|
||||
|
||||
private IEntity? _attachedEntity;
|
||||
|
||||
|
||||
@@ -51,7 +51,7 @@ namespace Content.Client.GameObjects.EntitySystems
|
||||
// entity performing the drag action
|
||||
private IEntity _dragger;
|
||||
private IEntity _draggedEntity;
|
||||
private readonly List<IDraggable> _draggables = new List<IDraggable>();
|
||||
private readonly List<IDraggable> _draggables = new();
|
||||
private IEntity _dragShadow;
|
||||
private DragState _state;
|
||||
// time since mouse down over the dragged entity
|
||||
@@ -71,7 +71,7 @@ namespace Content.Client.GameObjects.EntitySystems
|
||||
private SharedInteractionSystem _interactionSystem;
|
||||
private InputSystem _inputSystem;
|
||||
|
||||
private readonly List<SpriteComponent> _highlightedSprites = new List<SpriteComponent>();
|
||||
private readonly List<SpriteComponent> _highlightedSprites = new();
|
||||
|
||||
private enum DragState
|
||||
{
|
||||
|
||||
@@ -24,7 +24,7 @@ namespace Content.Client.GameObjects.EntitySystems
|
||||
[Dependency] private readonly IMapManager _mapManager = default!;
|
||||
[Dependency] private readonly IResourceCache _resourceCache = default!;
|
||||
|
||||
private readonly Dictionary<float, Color> _fireCache = new Dictionary<float, Color>();
|
||||
private readonly Dictionary<float, Color> _fireCache = new();
|
||||
|
||||
// Gas overlays
|
||||
private readonly float[] _timer = new float[Atmospherics.TotalNumberOfGases];
|
||||
@@ -42,7 +42,7 @@ namespace Content.Client.GameObjects.EntitySystems
|
||||
private readonly Texture[][] _fireFrames = new Texture[FireStates][];
|
||||
|
||||
private readonly Dictionary<GridId, Dictionary<Vector2i, GasOverlayChunk>> _tileData =
|
||||
new Dictionary<GridId, Dictionary<Vector2i, GasOverlayChunk>>();
|
||||
new();
|
||||
|
||||
private AtmosphereSystem _atmosphereSystem = default!;
|
||||
|
||||
|
||||
@@ -21,7 +21,7 @@ namespace Content.Client.GameObjects.EntitySystems
|
||||
{
|
||||
[Dependency] private readonly IMapManager _mapManager = default!;
|
||||
|
||||
private readonly Queue<IEntity> _dirtyEntities = new Queue<IEntity>();
|
||||
private readonly Queue<IEntity> _dirtyEntities = new();
|
||||
|
||||
private int _generation;
|
||||
|
||||
|
||||
@@ -10,7 +10,7 @@ namespace Content.Client.GameObjects.EntitySystems
|
||||
[UsedImplicitly]
|
||||
public sealed class WindowSystem : EntitySystem
|
||||
{
|
||||
private readonly Queue<IEntity> _dirtyEntities = new Queue<IEntity>();
|
||||
private readonly Queue<IEntity> _dirtyEntities = new();
|
||||
|
||||
public override void Initialize()
|
||||
{
|
||||
|
||||
@@ -22,7 +22,7 @@ namespace Content.Client.GameTicking
|
||||
[Dependency] private readonly IStateManager _stateManager = default!;
|
||||
|
||||
[ViewVariables] private bool _initialized;
|
||||
private readonly List<string> _jobsAvailable = new List<string>();
|
||||
private readonly List<string> _jobsAvailable = new();
|
||||
|
||||
[ViewVariables] public bool AreWeReady { get; private set; }
|
||||
[ViewVariables] public bool IsGameStarted { get; private set; }
|
||||
|
||||
@@ -16,7 +16,7 @@ namespace Content.Client.Parallax
|
||||
{
|
||||
public class ParallaxGenerator
|
||||
{
|
||||
private readonly List<Layer> Layers = new List<Layer>();
|
||||
private readonly List<Layer> Layers = new();
|
||||
|
||||
public static Image<Rgba32> GenerateParallax(TomlTable config, Size size, ISawmill sawmill, List<Image<Rgba32>> debugLayerDump)
|
||||
{
|
||||
|
||||
@@ -24,11 +24,11 @@ namespace Content.Client.Parallax
|
||||
[Dependency] private readonly ILogManager _logManager = default!;
|
||||
[Dependency] private readonly IConfigurationManager _configurationManager = default!;
|
||||
|
||||
private static readonly ResourcePath ParallaxConfigPath = new ResourcePath("/parallax_config.toml");
|
||||
private static readonly ResourcePath ParallaxConfigPath = new("/parallax_config.toml");
|
||||
|
||||
// Both of these below are in the user directory.
|
||||
private static readonly ResourcePath ParallaxPath = new ResourcePath("/parallax_cache.png");
|
||||
private static readonly ResourcePath ParallaxConfigOld = new ResourcePath("/parallax_config_old");
|
||||
private static readonly ResourcePath ParallaxPath = new("/parallax_cache.png");
|
||||
private static readonly ResourcePath ParallaxConfigOld = new("/parallax_config_old");
|
||||
|
||||
public event Action<Texture> OnTextureLoaded;
|
||||
public Texture ParallaxTexture { get; private set; }
|
||||
|
||||
@@ -27,8 +27,8 @@ namespace Content.Client.Research
|
||||
|
||||
public LatheBoundUserInterface Owner { get; set; }
|
||||
|
||||
private readonly List<LatheRecipePrototype> _recipes = new List<LatheRecipePrototype>();
|
||||
private readonly List<LatheRecipePrototype> _shownRecipes = new List<LatheRecipePrototype>();
|
||||
private readonly List<LatheRecipePrototype> _recipes = new();
|
||||
private readonly List<LatheRecipePrototype> _shownRecipes = new();
|
||||
|
||||
public LatheMenu(LatheBoundUserInterface owner = null)
|
||||
{
|
||||
|
||||
@@ -18,9 +18,9 @@ namespace Content.Client.Research
|
||||
|
||||
protected override Vector2? CustomSize => (800, 400);
|
||||
|
||||
private readonly List<TechnologyPrototype> _unlockedTechnologyPrototypes = new List<TechnologyPrototype>();
|
||||
private readonly List<TechnologyPrototype> _unlockableTechnologyPrototypes = new List<TechnologyPrototype>();
|
||||
private readonly List<TechnologyPrototype> _futureTechnologyPrototypes = new List<TechnologyPrototype>();
|
||||
private readonly List<TechnologyPrototype> _unlockedTechnologyPrototypes = new();
|
||||
private readonly List<TechnologyPrototype> _unlockableTechnologyPrototypes = new();
|
||||
private readonly List<TechnologyPrototype> _futureTechnologyPrototypes = new();
|
||||
|
||||
private readonly Label _pointLabel;
|
||||
private readonly Label _pointsPerSecondLabel;
|
||||
|
||||
@@ -15,7 +15,7 @@ namespace Content.Client
|
||||
{
|
||||
internal class ScreenshotHook : IScreenshotHook
|
||||
{
|
||||
private static readonly ResourcePath BaseScreenshotPath = new ResourcePath("/Screenshots");
|
||||
private static readonly ResourcePath BaseScreenshotPath = new("/Screenshots");
|
||||
|
||||
[Dependency] private readonly IInputManager _inputManager = default;
|
||||
[Dependency] private readonly IClyde _clyde = default;
|
||||
|
||||
@@ -40,7 +40,7 @@ namespace Content.Client.State
|
||||
private bool _isConnecting;
|
||||
|
||||
// ReSharper disable once InconsistentNaming
|
||||
private static readonly Regex IPv6Regex = new Regex(@"\[(.*:.*:.*)](?::(\d+))?");
|
||||
private static readonly Regex IPv6Regex = new(@"\[(.*:.*:.*)](?::(\d+))?");
|
||||
|
||||
/// <inheritdoc />
|
||||
public override void Startup()
|
||||
|
||||
@@ -29,18 +29,18 @@ namespace Content.Client.StationEvents
|
||||
/// <summary>
|
||||
/// Current color of a pulse
|
||||
/// </summary>
|
||||
private readonly Dictionary<IEntity, Color> _colors = new Dictionary<IEntity, Color>();
|
||||
private readonly Dictionary<IEntity, Color> _colors = new();
|
||||
|
||||
/// <summary>
|
||||
/// Whether our alpha is increasing or decreasing and at what time does it flip (or stop)
|
||||
/// </summary>
|
||||
private readonly Dictionary<IEntity, (bool EasingIn, TimeSpan TransitionTime)> _transitions =
|
||||
new Dictionary<IEntity, (bool EasingIn, TimeSpan TransitionTime)>();
|
||||
new();
|
||||
|
||||
/// <summary>
|
||||
/// How much the alpha changes per second for each pulse
|
||||
/// </summary>
|
||||
private readonly Dictionary<IEntity, float> _alphaRateOfChange = new Dictionary<IEntity, float>();
|
||||
private readonly Dictionary<IEntity, float> _alphaRateOfChange = new();
|
||||
|
||||
private TimeSpan _lastTick;
|
||||
|
||||
|
||||
@@ -33,30 +33,30 @@ namespace Content.Client.UserInterface.AdminMenu
|
||||
|
||||
protected override Vector2? CustomSize => (500, 250);
|
||||
|
||||
private readonly List<CommandButton> _adminButtons = new List<CommandButton>
|
||||
private readonly List<CommandButton> _adminButtons = new()
|
||||
{
|
||||
new KickCommandButton(),
|
||||
new DirectCommandButton("Admin Ghost", "aghost"),
|
||||
new TeleportCommandButton(),
|
||||
};
|
||||
private readonly List<CommandButton> _adminbusButtons = new List<CommandButton>
|
||||
private readonly List<CommandButton> _adminbusButtons = new()
|
||||
{
|
||||
new SpawnEntitiesCommandButton(),
|
||||
new SpawnTilesCommandButton(),
|
||||
new StationEventsCommandButton(),
|
||||
};
|
||||
private readonly List<CommandButton> _debugButtons = new List<CommandButton>
|
||||
private readonly List<CommandButton> _debugButtons = new()
|
||||
{
|
||||
new AddAtmosCommandButton(),
|
||||
new FillGasCommandButton(),
|
||||
};
|
||||
private readonly List<CommandButton> _roundButtons = new List<CommandButton>
|
||||
private readonly List<CommandButton> _roundButtons = new()
|
||||
{
|
||||
new DirectCommandButton("Start Round", "startround"),
|
||||
new DirectCommandButton("End Round", "endround"),
|
||||
new DirectCommandButton("Restart Round", "restartround"),
|
||||
};
|
||||
private readonly List<CommandButton> _serverButtons = new List<CommandButton>
|
||||
private readonly List<CommandButton> _serverButtons = new()
|
||||
{
|
||||
new DirectCommandButton("Reboot", "restart"),
|
||||
new DirectCommandButton("Shutdown", "shutdown"),
|
||||
@@ -463,7 +463,7 @@ namespace Content.Client.UserInterface.AdminMenu
|
||||
public override string RequiredCommand => "events";
|
||||
public override string? SubmitText => "Run";
|
||||
|
||||
private readonly CommandUIDropDown _eventsDropDown = new CommandUIDropDown
|
||||
private readonly CommandUIDropDown _eventsDropDown = new()
|
||||
{
|
||||
Name = "Event",
|
||||
GetData = () =>
|
||||
@@ -478,7 +478,7 @@ namespace Content.Client.UserInterface.AdminMenu
|
||||
GetValueFromData = (obj) => ((string) obj).ToLower(),
|
||||
};
|
||||
|
||||
public override List<CommandUIControl> UI => new List<CommandUIControl>
|
||||
public override List<CommandUIControl> UI => new()
|
||||
{
|
||||
_eventsDropDown,
|
||||
new CommandUIButton
|
||||
@@ -510,19 +510,19 @@ namespace Content.Client.UserInterface.AdminMenu
|
||||
public override string Name => "Kick";
|
||||
public override string RequiredCommand => "kick";
|
||||
|
||||
private readonly CommandUIDropDown _playerDropDown = new CommandUIDropDown
|
||||
private readonly CommandUIDropDown _playerDropDown = new()
|
||||
{
|
||||
Name = "Player",
|
||||
GetData = () => IoCManager.Resolve<IPlayerManager>().Sessions.ToList<object>(),
|
||||
GetDisplayName = (obj) => $"{((IPlayerSession) obj).Name} ({((IPlayerSession) obj).AttachedEntity?.Name})",
|
||||
GetValueFromData = (obj) => ((IPlayerSession) obj).Name,
|
||||
};
|
||||
private readonly CommandUILineEdit _reason = new CommandUILineEdit
|
||||
private readonly CommandUILineEdit _reason = new()
|
||||
{
|
||||
Name = "Reason"
|
||||
};
|
||||
|
||||
public override List<CommandUIControl> UI => new List<CommandUIControl>
|
||||
public override List<CommandUIControl> UI => new()
|
||||
{
|
||||
_playerDropDown,
|
||||
_reason
|
||||
@@ -539,7 +539,7 @@ namespace Content.Client.UserInterface.AdminMenu
|
||||
public override string Name => "Teleport";
|
||||
public override string RequiredCommand => "tpto";
|
||||
|
||||
private readonly CommandUIDropDown _playerDropDown = new CommandUIDropDown
|
||||
private readonly CommandUIDropDown _playerDropDown = new()
|
||||
{
|
||||
Name = "Player",
|
||||
GetData = () => IoCManager.Resolve<IPlayerManager>().Sessions.ToList<object>(),
|
||||
@@ -547,7 +547,7 @@ namespace Content.Client.UserInterface.AdminMenu
|
||||
GetValueFromData = (obj) => ((IPlayerSession) obj).Name,
|
||||
};
|
||||
|
||||
public override List<CommandUIControl> UI => new List<CommandUIControl>
|
||||
public override List<CommandUIControl> UI => new()
|
||||
{
|
||||
_playerDropDown
|
||||
};
|
||||
@@ -563,7 +563,7 @@ namespace Content.Client.UserInterface.AdminMenu
|
||||
public override string Name => "Add Atmos";
|
||||
public override string RequiredCommand => "addatmos";
|
||||
|
||||
private readonly CommandUIDropDown _grid = new CommandUIDropDown
|
||||
private readonly CommandUIDropDown _grid = new()
|
||||
{
|
||||
Name = "Grid",
|
||||
GetData = () => IoCManager.Resolve<IMapManager>().GetAllGrids().Where(g => (int) g.Index != 0).ToList<object>(),
|
||||
@@ -571,7 +571,7 @@ namespace Content.Client.UserInterface.AdminMenu
|
||||
GetValueFromData = (obj) => ((IMapGrid) obj).Index.ToString(),
|
||||
};
|
||||
|
||||
public override List<CommandUIControl> UI => new List<CommandUIControl>
|
||||
public override List<CommandUIControl> UI => new()
|
||||
{
|
||||
_grid,
|
||||
};
|
||||
@@ -587,7 +587,7 @@ namespace Content.Client.UserInterface.AdminMenu
|
||||
public override string Name => "Fill Gas";
|
||||
public override string RequiredCommand => "fillgas";
|
||||
|
||||
private readonly CommandUIDropDown _grid = new CommandUIDropDown
|
||||
private readonly CommandUIDropDown _grid = new()
|
||||
{
|
||||
Name = "Grid",
|
||||
GetData = () => IoCManager.Resolve<IMapManager>().GetAllGrids().Where(g => (int) g.Index != 0).ToList<object>(),
|
||||
@@ -595,7 +595,7 @@ namespace Content.Client.UserInterface.AdminMenu
|
||||
GetValueFromData = (obj) => ((IMapGrid) obj).Index.ToString(),
|
||||
};
|
||||
|
||||
private readonly CommandUIDropDown _gas = new CommandUIDropDown
|
||||
private readonly CommandUIDropDown _gas = new()
|
||||
{
|
||||
Name = "Gas",
|
||||
GetData = () =>
|
||||
@@ -607,12 +607,12 @@ namespace Content.Client.UserInterface.AdminMenu
|
||||
GetValueFromData = (obj) => ((GasPrototype) obj).ID.ToString(),
|
||||
};
|
||||
|
||||
private readonly CommandUISpinBox _amount = new CommandUISpinBox
|
||||
private readonly CommandUISpinBox _amount = new()
|
||||
{
|
||||
Name = "Amount"
|
||||
};
|
||||
|
||||
public override List<CommandUIControl> UI => new List<CommandUIControl>
|
||||
public override List<CommandUIControl> UI => new()
|
||||
{
|
||||
_grid,
|
||||
_gas,
|
||||
|
||||
@@ -23,7 +23,7 @@ namespace Content.Client.UserInterface.Cargo
|
||||
public event Action<BaseButton.ButtonEventArgs> OnOrderApproved;
|
||||
public event Action<BaseButton.ButtonEventArgs> OnOrderCanceled;
|
||||
|
||||
private readonly List<string> _categoryStrings = new List<string>();
|
||||
private readonly List<string> _categoryStrings = new();
|
||||
|
||||
private Label _accountNameLabel { get; set; }
|
||||
private Label _pointsLabel { get; set; }
|
||||
|
||||
@@ -20,7 +20,7 @@ namespace Content.Client.UserInterface
|
||||
{
|
||||
[Dependency] private readonly IResourceCache _resourceManager = default!;
|
||||
|
||||
private static readonly Dictionary<string, int> PatronTierPriority = new Dictionary<string, int>
|
||||
private static readonly Dictionary<string, int> PatronTierPriority = new()
|
||||
{
|
||||
["Nuclear Operative"] = 1,
|
||||
["Syndicate Agent"] = 2,
|
||||
|
||||
@@ -10,8 +10,8 @@ namespace Content.Client.UserInterface
|
||||
{
|
||||
public class GhostGui : Control
|
||||
{
|
||||
private readonly Button _returnToBody = new Button() {Text = Loc.GetString("Return to body")};
|
||||
private readonly Button _ghostWarp = new Button() {Text = Loc.GetString("Ghost Warp")};
|
||||
private readonly Button _returnToBody = new() {Text = Loc.GetString("Return to body")};
|
||||
private readonly Button _ghostWarp = new() {Text = Loc.GetString("Ghost Warp")};
|
||||
private readonly GhostComponent _owner;
|
||||
|
||||
public GhostGui(GhostComponent owner)
|
||||
|
||||
@@ -25,7 +25,7 @@ namespace Content.Client.UserInterface
|
||||
{
|
||||
public partial class HumanoidProfileEditor : Control
|
||||
{
|
||||
private static readonly StyleBoxFlat HighlightedStyle = new StyleBoxFlat
|
||||
private static readonly StyleBoxFlat HighlightedStyle = new()
|
||||
{
|
||||
BackgroundColor = new Color(47, 47, 53),
|
||||
ContentMarginTopOverride = 10,
|
||||
|
||||
@@ -20,7 +20,7 @@ namespace Content.Client.UserInterface
|
||||
public class ItemStatusPanel : Control
|
||||
{
|
||||
[ViewVariables]
|
||||
private readonly List<(IItemStatus, Control)> _activeStatusComponents = new List<(IItemStatus, Control)>();
|
||||
private readonly List<(IItemStatus, Control)> _activeStatusComponents = new();
|
||||
|
||||
[ViewVariables]
|
||||
private readonly Label _itemNameLabel;
|
||||
|
||||
@@ -26,7 +26,7 @@ namespace Content.Client.UserInterface
|
||||
|
||||
public event Action<string> SelectedId;
|
||||
|
||||
private readonly Dictionary<string, JobButton> _jobButtons = new Dictionary<string, JobButton>();
|
||||
private readonly Dictionary<string, JobButton> _jobButtons = new();
|
||||
|
||||
public LateJoinGui()
|
||||
{
|
||||
|
||||
@@ -92,7 +92,7 @@ namespace Content.Client.UserInterface
|
||||
|
||||
private static SpriteView MakeSpriteView(IEntity entity, Direction direction)
|
||||
{
|
||||
return new SpriteView
|
||||
return new()
|
||||
{
|
||||
Sprite = entity.GetComponent<ISpriteComponent>(),
|
||||
OverrideDirection = direction,
|
||||
|
||||
@@ -20,7 +20,7 @@ namespace Content.Client.UserInterface
|
||||
private sealed class KeyRebindControl : Control
|
||||
{
|
||||
// List of key functions that must be registered as toggle instead.
|
||||
private static readonly HashSet<BoundKeyFunction> ToggleFunctions = new HashSet<BoundKeyFunction>
|
||||
private static readonly HashSet<BoundKeyFunction> ToggleFunctions = new()
|
||||
{
|
||||
EngineKeyFunctions.ShowDebugMonitors,
|
||||
EngineKeyFunctions.HideUI,
|
||||
@@ -31,9 +31,9 @@ namespace Content.Client.UserInterface
|
||||
private BindButton? _currentlyRebinding;
|
||||
|
||||
private readonly Dictionary<BoundKeyFunction, KeyControl> _keyControls =
|
||||
new Dictionary<BoundKeyFunction, KeyControl>();
|
||||
new();
|
||||
|
||||
private readonly List<Action> _deferCommands = new List<Action>();
|
||||
private readonly List<Action> _deferCommands = new();
|
||||
|
||||
public KeyRebindControl()
|
||||
{
|
||||
|
||||
@@ -355,7 +355,7 @@ namespace Content.Client.ParticleAccelerator
|
||||
|
||||
PASegmentControl Segment(string name)
|
||||
{
|
||||
return new PASegmentControl(this, resourceCache, name);
|
||||
return new(this, resourceCache, name);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -27,10 +27,10 @@ namespace Content.Client.UserInterface.Permissions
|
||||
[Dependency] private readonly IClientAdminManager _adminManager = default!;
|
||||
|
||||
private readonly Menu _menu;
|
||||
private readonly List<SS14Window> _subWindows = new List<SS14Window>();
|
||||
private readonly List<SS14Window> _subWindows = new();
|
||||
|
||||
private Dictionary<int, PermissionsEuiState.AdminRankData> _ranks =
|
||||
new Dictionary<int, PermissionsEuiState.AdminRankData>();
|
||||
new();
|
||||
|
||||
public PermissionsEui()
|
||||
{
|
||||
@@ -348,7 +348,7 @@ namespace Content.Client.UserInterface.Permissions
|
||||
public readonly Button? RemoveButton;
|
||||
|
||||
public readonly Dictionary<AdminFlags, (Button inherit, Button sub, Button plus)> FlagButtons
|
||||
= new Dictionary<AdminFlags, (Button, Button, Button)>();
|
||||
= new();
|
||||
|
||||
public EditAdminWindow(PermissionsEui ui, PermissionsEuiState.AdminData? data)
|
||||
{
|
||||
@@ -519,7 +519,7 @@ namespace Content.Client.UserInterface.Permissions
|
||||
public readonly LineEdit NameEdit;
|
||||
public readonly Button SaveButton;
|
||||
public readonly Button? RemoveButton;
|
||||
public readonly Dictionary<AdminFlags, CheckBox> FlagCheckBoxes = new Dictionary<AdminFlags, CheckBox>();
|
||||
public readonly Dictionary<AdminFlags, CheckBox> FlagCheckBoxes = new();
|
||||
|
||||
public EditAdminRankWindow(PermissionsEui ui, KeyValuePair<int, PermissionsEuiState.AdminRankData>? data)
|
||||
{
|
||||
|
||||
@@ -75,7 +75,7 @@ namespace Content.IntegrationTests
|
||||
|
||||
public T AddGameRule<T>() where T : GameRule, new()
|
||||
{
|
||||
return new T();
|
||||
return new();
|
||||
}
|
||||
|
||||
public bool HasGameRule(Type type)
|
||||
@@ -120,7 +120,7 @@ namespace Content.IntegrationTests
|
||||
|
||||
public Dictionary<string, int> GetAvailablePositions()
|
||||
{
|
||||
return new Dictionary<string, int>();
|
||||
return new();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -433,7 +433,7 @@ namespace Content.IntegrationTests.Tests.Networking
|
||||
|
||||
// Queue of all the events that come in so we can test that they come in perfectly as expected.
|
||||
public List<(GameTick tick, bool firstPredict, bool old, bool @new, bool value)> EventTriggerList { get; } =
|
||||
new List<(GameTick, bool, bool, bool, bool)>();
|
||||
new();
|
||||
|
||||
[Dependency] private readonly IGameTiming _gameTiming = default!;
|
||||
|
||||
|
||||
@@ -80,7 +80,7 @@ namespace Content.Server.Database
|
||||
[Column("preference_id")] public int Id { get; set; }
|
||||
[Column("user_id")] public Guid UserId { get; set; }
|
||||
[Column("selected_character_slot")] public int SelectedCharacterSlot { get; set; }
|
||||
public List<Profile> Profiles { get; } = new List<Profile>();
|
||||
public List<Profile> Profiles { get; } = new();
|
||||
}
|
||||
|
||||
[Table("profile")]
|
||||
@@ -97,8 +97,8 @@ namespace Content.Server.Database
|
||||
[Column("facial_hair_color")] public string FacialHairColor { get; set; } = null!;
|
||||
[Column("eye_color")] public string EyeColor { get; set; } = null!;
|
||||
[Column("skin_color")] public string SkinColor { get; set; } = null!;
|
||||
public List<Job> Jobs { get; } = new List<Job>();
|
||||
public List<Antag> Antags { get; } = new List<Antag>();
|
||||
public List<Job> Jobs { get; } = new();
|
||||
public List<Antag> Antags { get; } = new();
|
||||
|
||||
[Column("pref_unavailable")] public DbPreferenceUnavailableMode PreferenceUnavailable { get; set; }
|
||||
|
||||
|
||||
@@ -31,8 +31,8 @@ namespace Content.Server.AI.Utility.AiLogic
|
||||
/// <summary>
|
||||
/// The sum of all BehaviorSets gives us what actions the AI can take
|
||||
/// </summary>
|
||||
public Dictionary<Type, BehaviorSet> BehaviorSets { get; } = new Dictionary<Type, BehaviorSet>();
|
||||
private readonly List<IAiUtility> _availableActions = new List<IAiUtility>();
|
||||
public Dictionary<Type, BehaviorSet> BehaviorSets { get; } = new();
|
||||
private readonly List<IAiUtility> _availableActions = new();
|
||||
|
||||
/// <summary>
|
||||
/// The currently running action; most importantly are the operators.
|
||||
|
||||
@@ -7,7 +7,7 @@ namespace Content.Server.AI.Utility.Considerations
|
||||
{
|
||||
public class ConsiderationsManager
|
||||
{
|
||||
private readonly Dictionary<Type, Consideration> _considerations = new Dictionary<Type, Consideration>();
|
||||
private readonly Dictionary<Type, Consideration> _considerations = new();
|
||||
|
||||
public void Initialize()
|
||||
{
|
||||
|
||||
@@ -15,8 +15,8 @@ namespace Content.Server.AI.WorldState
|
||||
|
||||
// This also stops you from re-writing the same boilerplate everywhere of stuff like "Do I have OuterClothing on?"
|
||||
|
||||
private readonly Dictionary<Type, IAiState> _states = new Dictionary<Type, IAiState>();
|
||||
private readonly List<IPlanningState> _planningStates = new List<IPlanningState>();
|
||||
private readonly Dictionary<Type, IAiState> _states = new();
|
||||
private readonly List<IPlanningState> _planningStates = new();
|
||||
|
||||
public Blackboard(IEntity owner)
|
||||
{
|
||||
|
||||
@@ -14,7 +14,7 @@ namespace Content.Server.AI.WorldState
|
||||
{
|
||||
// Cache the known types
|
||||
public IReadOnlyCollection<Type> AiStates => _aiStates;
|
||||
private readonly List<Type> _aiStates = new List<Type>();
|
||||
private readonly List<Type> _aiStates = new();
|
||||
|
||||
public void Initialize()
|
||||
{
|
||||
|
||||
@@ -39,7 +39,7 @@ namespace Content.Server.Administration
|
||||
[Dependency] private readonly IConsoleShell _consoleShell = default!;
|
||||
[Dependency] private readonly IChatManager _chat = default!;
|
||||
|
||||
private readonly Dictionary<IPlayerSession, AdminReg> _admins = new Dictionary<IPlayerSession, AdminReg>();
|
||||
private readonly Dictionary<IPlayerSession, AdminReg> _admins = new();
|
||||
|
||||
public event Action<AdminPermsChangedEventArgs>? OnPermsChanged;
|
||||
|
||||
@@ -49,8 +49,8 @@ namespace Content.Server.Administration
|
||||
|
||||
// If a command isn't in this list it's server-console only.
|
||||
// if a command is in but the flags value is null it's available to everybody.
|
||||
private readonly HashSet<string> _anyCommands = new HashSet<string>();
|
||||
private readonly Dictionary<string, AdminFlags[]> _adminCommands = new Dictionary<string, AdminFlags[]>();
|
||||
private readonly HashSet<string> _anyCommands = new();
|
||||
private readonly Dictionary<string, AdminFlags[]> _adminCommands = new();
|
||||
|
||||
public AdminData? GetAdminData(IPlayerSession session, bool includeDeAdmin = false)
|
||||
{
|
||||
|
||||
@@ -26,7 +26,7 @@ namespace Content.Server.Administration
|
||||
private bool _isLoading;
|
||||
|
||||
private readonly List<(Admin a, string? lastUserName)> _admins = new List<(Admin, string? lastUserName)>();
|
||||
private readonly List<DbAdminRank> _adminRanks = new List<DbAdminRank>();
|
||||
private readonly List<DbAdminRank> _adminRanks = new();
|
||||
|
||||
public PermissionsEui()
|
||||
{
|
||||
|
||||
@@ -12,7 +12,7 @@ namespace Content.Server.Atmos
|
||||
private bool _disposed = false;
|
||||
|
||||
[ViewVariables]
|
||||
private readonly HashSet<TileAtmosphere> _tiles = new HashSet<TileAtmosphere>();
|
||||
private readonly HashSet<TileAtmosphere> _tiles = new();
|
||||
|
||||
[ViewVariables]
|
||||
private GridAtmosphereComponent _gridAtmosphereComponent;
|
||||
|
||||
@@ -23,7 +23,7 @@ namespace Content.Server.Atmos
|
||||
{
|
||||
private readonly AtmosphereSystem _atmosphereSystem;
|
||||
|
||||
public static GasMixture SpaceGas => new GasMixture() {Volume = 2500f, Immutable = true, Temperature = Atmospherics.TCMB};
|
||||
public static GasMixture SpaceGas => new() {Volume = 2500f, Immutable = true, Temperature = Atmospherics.TCMB};
|
||||
|
||||
// This must always have a length that is a multiple of 4 for SIMD acceleration.
|
||||
[ViewVariables]
|
||||
@@ -44,7 +44,7 @@ namespace Content.Server.Atmos
|
||||
public float LastShare { get; private set; } = 0;
|
||||
|
||||
[ViewVariables]
|
||||
public readonly Dictionary<GasReaction, float> ReactionResults = new Dictionary<GasReaction, float>()
|
||||
public readonly Dictionary<GasReaction, float> ReactionResults = new()
|
||||
{
|
||||
// We initialize the dictionary here.
|
||||
{ GasReaction.Fire, 0f }
|
||||
|
||||
@@ -36,7 +36,7 @@ namespace Content.Server.Atmos
|
||||
private readonly GridTileLookupSystem _gridTileLookupSystem = default!;
|
||||
|
||||
|
||||
private static readonly TileAtmosphereComparer Comparer = new TileAtmosphereComparer();
|
||||
private static readonly TileAtmosphereComparer Comparer = new();
|
||||
|
||||
[ViewVariables] private int _archivedCycle;
|
||||
[ViewVariables] private int _currentCycle;
|
||||
|
||||
@@ -6,8 +6,8 @@ namespace Content.Server.Cargo
|
||||
{
|
||||
public class CargoOrderDataManager : ICargoOrderDataManager
|
||||
{
|
||||
private readonly Dictionary<int, CargoOrderDatabase> _accounts = new Dictionary<int, CargoOrderDatabase>();
|
||||
private readonly List<CargoOrderDatabaseComponent> _components = new List<CargoOrderDatabaseComponent>();
|
||||
private readonly Dictionary<int, CargoOrderDatabase> _accounts = new();
|
||||
private readonly List<CargoOrderDatabaseComponent> _components = new();
|
||||
|
||||
public CargoOrderDataManager()
|
||||
{
|
||||
|
||||
@@ -7,7 +7,7 @@ namespace Content.Server.Cargo
|
||||
{
|
||||
public class CargoOrderDatabase
|
||||
{
|
||||
private readonly Dictionary<int, CargoOrderData> _orders = new Dictionary<int, CargoOrderData>();
|
||||
private readonly Dictionary<int, CargoOrderData> _orders = new();
|
||||
private int _orderNumber = 0;
|
||||
|
||||
public CargoOrderDatabase(int id)
|
||||
|
||||
@@ -23,7 +23,7 @@ namespace Content.Server.Database
|
||||
// For SQLite we use a single DB context via SQLite.
|
||||
// This doesn't allow concurrent access so that's what the semaphore is for.
|
||||
// That said, this is bloody SQLite, I don't even think EFCore bothers to truly async it.
|
||||
private readonly SemaphoreSlim _prefsSemaphore = new SemaphoreSlim(1, 1);
|
||||
private readonly SemaphoreSlim _prefsSemaphore = new(1, 1);
|
||||
|
||||
private readonly Task _dbReadyTask;
|
||||
private readonly SqliteServerDbContext _prefsCtx;
|
||||
|
||||
@@ -14,8 +14,8 @@ namespace Content.Server.GameObjects.EntitySystems.DeviceNetwork
|
||||
|
||||
[Dependency] private readonly IRobustRandom _random = default!;
|
||||
|
||||
private readonly Dictionary<int, List<NetworkDevice>> _devices = new Dictionary<int, List<NetworkDevice>>();
|
||||
private readonly Queue<NetworkPackage> _packages = new Queue<NetworkPackage>();
|
||||
private readonly Dictionary<int, List<NetworkDevice>> _devices = new();
|
||||
private readonly Queue<NetworkPackage> _packages = new();
|
||||
|
||||
/// <inheritdoc/>
|
||||
public DeviceNetworkConnection Register(int netId, int frequency, OnReceiveNetMessage messageHandler, bool receiveAll = false)
|
||||
|
||||
@@ -19,7 +19,7 @@ namespace Content.Server.Eui
|
||||
[Dependency] private readonly IServerNetManager _net = default!;
|
||||
|
||||
private readonly Dictionary<IPlayerSession, PlayerEuiData> _playerData =
|
||||
new Dictionary<IPlayerSession, PlayerEuiData>();
|
||||
new();
|
||||
|
||||
private readonly Queue<(IPlayerSession player, uint id)> _stateUpdateQueue =
|
||||
new Queue<(IPlayerSession, uint id)>();
|
||||
@@ -27,7 +27,7 @@ namespace Content.Server.Eui
|
||||
private sealed class PlayerEuiData
|
||||
{
|
||||
public uint NextId = 1;
|
||||
public readonly Dictionary<uint, BaseEui> OpenUIs = new Dictionary<uint, BaseEui>();
|
||||
public readonly Dictionary<uint, BaseEui> OpenUIs = new();
|
||||
}
|
||||
|
||||
void IPostInjectInit.PostInject()
|
||||
|
||||
@@ -17,7 +17,7 @@ namespace Content.Server.GameObjects.Components.Access
|
||||
public override string Name => "Access";
|
||||
|
||||
[ViewVariables]
|
||||
private readonly HashSet<string> _tags = new HashSet<string>();
|
||||
private readonly HashSet<string> _tags = new();
|
||||
|
||||
public ISet<string> Tags => _tags;
|
||||
public bool IsReadOnly => false;
|
||||
|
||||
@@ -25,8 +25,8 @@ namespace Content.Server.GameObjects.Components.Access
|
||||
{
|
||||
public override string Name => "AccessReader";
|
||||
|
||||
private readonly List<ISet<string>> _accessLists = new List<ISet<string>>();
|
||||
private readonly HashSet<string> _denyTags = new HashSet<string>();
|
||||
private readonly List<ISet<string>> _accessLists = new();
|
||||
private readonly HashSet<string> _denyTags = new();
|
||||
|
||||
/// <summary>
|
||||
/// List of access lists to check allowed against. For an access check to pass
|
||||
|
||||
@@ -39,7 +39,7 @@ namespace Content.Server.GameObjects.Components.Arcade
|
||||
private BlockGame? _game;
|
||||
|
||||
private IPlayerSession? _player;
|
||||
private readonly List<IPlayerSession> _spectators = new List<IPlayerSession>();
|
||||
private readonly List<IPlayerSession> _spectators = new();
|
||||
|
||||
public void Activate(ActivateEventArgs eventArgs)
|
||||
{
|
||||
@@ -166,7 +166,7 @@ namespace Content.Server.GameObjects.Components.Arcade
|
||||
|
||||
private readonly BlockGameArcadeComponent _component;
|
||||
|
||||
private readonly List<BlockGameBlock> _field = new List<BlockGameBlock>();
|
||||
private readonly List<BlockGameBlock> _field = new();
|
||||
|
||||
private BlockGamePiece _currentPiece;
|
||||
|
||||
@@ -733,7 +733,7 @@ namespace Content.Server.GameObjects.Components.Arcade
|
||||
|
||||
private readonly BlockGamePieceType[] _allBlockGamePieces;
|
||||
|
||||
private List<BlockGamePieceType> _blockGamePiecesBuffer = new List<BlockGamePieceType>();
|
||||
private List<BlockGamePieceType> _blockGamePiecesBuffer = new();
|
||||
|
||||
private BlockGamePiece GetRandomBlockGamePiece(IRobustRandom random)
|
||||
{
|
||||
|
||||
@@ -429,7 +429,7 @@ namespace Content.Server.GameObjects.Components.Arcade
|
||||
/// <returns>A Metadata-message.</returns>
|
||||
public SpaceVillainArcadeMetaDataUpdateMessage GenerateMetaDataMessage()
|
||||
{
|
||||
return new SpaceVillainArcadeMetaDataUpdateMessage(_playerHp, _playerMp, _enemyHp, _enemyMp, _latestPlayerActionMessage, _latestEnemyActionMessage, Name, _enemyName, !_running);
|
||||
return new(_playerHp, _playerMp, _enemyHp, _enemyMp, _latestPlayerActionMessage, _latestEnemyActionMessage, Name, _enemyName, !_running);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -439,7 +439,7 @@ namespace Content.Server.GameObjects.Components.Arcade
|
||||
public SpaceVillainArcadeDataUpdateMessage
|
||||
GenerateUpdateMessage()
|
||||
{
|
||||
return new SpaceVillainArcadeDataUpdateMessage(_playerHp, _playerMp, _enemyHp, _enemyMp, _latestPlayerActionMessage,
|
||||
return new(_playerHp, _playerMp, _enemyHp, _enemyMp, _latestPlayerActionMessage,
|
||||
_latestEnemyActionMessage);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -32,7 +32,7 @@ namespace Content.Server.GameObjects.Components.Atmos
|
||||
public class FlammableComponent : SharedFlammableComponent, ICollideBehavior, IFireAct, IReagentReaction
|
||||
{
|
||||
private bool _resisting = false;
|
||||
private readonly List<EntityUid> _collided = new List<EntityUid>();
|
||||
private readonly List<EntityUid> _collided = new();
|
||||
|
||||
[ViewVariables(VVAccess.ReadWrite)]
|
||||
public bool OnFire { get; private set; }
|
||||
|
||||
@@ -63,7 +63,7 @@ namespace Content.Server.GameObjects.Components.Atmos
|
||||
|
||||
private bool _paused = false;
|
||||
private float _timer = 0f;
|
||||
private Stopwatch _stopwatch = new Stopwatch();
|
||||
private Stopwatch _stopwatch = new();
|
||||
private GridId _gridId;
|
||||
|
||||
[ComponentDependency] private IMapGridComponent? _mapGridComponent = default!;
|
||||
@@ -75,7 +75,7 @@ namespace Content.Server.GameObjects.Components.Atmos
|
||||
private double _tileEqualizeLastProcess;
|
||||
|
||||
[ViewVariables]
|
||||
private readonly HashSet<ExcitedGroup> _excitedGroups = new HashSet<ExcitedGroup>(1000);
|
||||
private readonly HashSet<ExcitedGroup> _excitedGroups = new(1000);
|
||||
|
||||
[ViewVariables]
|
||||
private int ExcitedGroupCount => _excitedGroups.Count;
|
||||
@@ -84,10 +84,10 @@ namespace Content.Server.GameObjects.Components.Atmos
|
||||
private double _excitedGroupLastProcess;
|
||||
|
||||
[ViewVariables]
|
||||
protected readonly Dictionary<Vector2i, TileAtmosphere> Tiles = new Dictionary<Vector2i, TileAtmosphere>(1000);
|
||||
protected readonly Dictionary<Vector2i, TileAtmosphere> Tiles = new(1000);
|
||||
|
||||
[ViewVariables]
|
||||
private readonly HashSet<TileAtmosphere> _activeTiles = new HashSet<TileAtmosphere>(1000);
|
||||
private readonly HashSet<TileAtmosphere> _activeTiles = new(1000);
|
||||
|
||||
[ViewVariables]
|
||||
private int ActiveTilesCount => _activeTiles.Count;
|
||||
@@ -96,7 +96,7 @@ namespace Content.Server.GameObjects.Components.Atmos
|
||||
private double _activeTilesLastProcess;
|
||||
|
||||
[ViewVariables]
|
||||
private readonly HashSet<TileAtmosphere> _hotspotTiles = new HashSet<TileAtmosphere>(1000);
|
||||
private readonly HashSet<TileAtmosphere> _hotspotTiles = new(1000);
|
||||
|
||||
[ViewVariables]
|
||||
private int HotspotTilesCount => _hotspotTiles.Count;
|
||||
@@ -105,7 +105,7 @@ namespace Content.Server.GameObjects.Components.Atmos
|
||||
private double _hotspotsLastProcess;
|
||||
|
||||
[ViewVariables]
|
||||
private readonly HashSet<TileAtmosphere> _superconductivityTiles = new HashSet<TileAtmosphere>(1000);
|
||||
private readonly HashSet<TileAtmosphere> _superconductivityTiles = new(1000);
|
||||
|
||||
[ViewVariables]
|
||||
private int SuperconductivityTilesCount => _superconductivityTiles.Count;
|
||||
@@ -114,13 +114,13 @@ namespace Content.Server.GameObjects.Components.Atmos
|
||||
private double _superconductivityLastProcess;
|
||||
|
||||
[ViewVariables]
|
||||
private readonly HashSet<Vector2i> _invalidatedCoords = new HashSet<Vector2i>(1000);
|
||||
private readonly HashSet<Vector2i> _invalidatedCoords = new(1000);
|
||||
|
||||
[ViewVariables]
|
||||
private int InvalidatedCoordsCount => _invalidatedCoords.Count;
|
||||
|
||||
[ViewVariables]
|
||||
private HashSet<TileAtmosphere> _highPressureDelta = new HashSet<TileAtmosphere>(1000);
|
||||
private HashSet<TileAtmosphere> _highPressureDelta = new(1000);
|
||||
|
||||
[ViewVariables]
|
||||
private int HighPressureDeltaCount => _highPressureDelta.Count;
|
||||
@@ -129,28 +129,28 @@ namespace Content.Server.GameObjects.Components.Atmos
|
||||
private double _highPressureDeltaLastProcess;
|
||||
|
||||
[ViewVariables]
|
||||
private readonly HashSet<IPipeNet> _pipeNets = new HashSet<IPipeNet>();
|
||||
private readonly HashSet<IPipeNet> _pipeNets = new();
|
||||
|
||||
[ViewVariables]
|
||||
private double _pipeNetLastProcess;
|
||||
|
||||
[ViewVariables]
|
||||
private readonly HashSet<PipeNetDeviceComponent> _pipeNetDevices = new HashSet<PipeNetDeviceComponent>();
|
||||
private readonly HashSet<PipeNetDeviceComponent> _pipeNetDevices = new();
|
||||
|
||||
[ViewVariables]
|
||||
private double _pipeNetDevicesLastProcess;
|
||||
|
||||
[ViewVariables]
|
||||
private Queue<TileAtmosphere> _currentRunTiles = new Queue<TileAtmosphere>();
|
||||
private Queue<TileAtmosphere> _currentRunTiles = new();
|
||||
|
||||
[ViewVariables]
|
||||
private Queue<ExcitedGroup> _currentRunExcitedGroups = new Queue<ExcitedGroup>();
|
||||
private Queue<ExcitedGroup> _currentRunExcitedGroups = new();
|
||||
|
||||
[ViewVariables]
|
||||
private Queue<IPipeNet> _currentRunPipeNet = new Queue<IPipeNet>();
|
||||
private Queue<IPipeNet> _currentRunPipeNet = new();
|
||||
|
||||
[ViewVariables]
|
||||
private Queue<PipeNetDeviceComponent> _currentRunPipeNetDevice = new Queue<PipeNetDeviceComponent>();
|
||||
private Queue<PipeNetDeviceComponent> _currentRunPipeNetDevice = new();
|
||||
|
||||
[ViewVariables]
|
||||
private ProcessState _state = ProcessState.TileEqualize;
|
||||
|
||||
@@ -20,7 +20,7 @@ namespace Content.Server.GameObjects.Components.Atmos
|
||||
|
||||
public override TileAtmosphere? GetTile(Vector2i indices, bool createSpace = true)
|
||||
{
|
||||
return new TileAtmosphere(this, GridId.Invalid, indices, new GasMixture(2500, AtmosphereSystem), true);
|
||||
return new(this, GridId.Invalid, indices, new GasMixture(2500, AtmosphereSystem), true);
|
||||
}
|
||||
|
||||
protected override IEnumerable<AirtightComponent> GetObstructingComponents(Vector2i indices)
|
||||
|
||||
@@ -103,7 +103,7 @@ namespace Content.Server.GameObjects.Components.Body.Behavior
|
||||
/// Used to track how long each reagent has been in the stomach
|
||||
/// </summary>
|
||||
[ViewVariables]
|
||||
private readonly List<ReagentDelta> _reagentDeltas = new List<ReagentDelta>();
|
||||
private readonly List<ReagentDelta> _reagentDeltas = new();
|
||||
|
||||
public override void ExposeData(ObjectSerializer serializer)
|
||||
{
|
||||
|
||||
@@ -62,7 +62,7 @@ namespace Content.Server.GameObjects.Components.Body
|
||||
/// </summary>
|
||||
private BodyScannerUIState InterfaceState(IBody body)
|
||||
{
|
||||
return new BodyScannerUIState(body.Owner.Uid);
|
||||
return new(body.Owner.Uid);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user