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:
@@ -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);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -30,7 +30,7 @@ namespace Content.Server.GameObjects.Components.Body.Part
|
||||
[ComponentReference(typeof(IBodyPart))]
|
||||
public class BodyPartComponent : SharedBodyPartComponent, IAfterInteract
|
||||
{
|
||||
private readonly Dictionary<int, object> _optionsCache = new Dictionary<int, object>();
|
||||
private readonly Dictionary<int, object> _optionsCache = new();
|
||||
private IBody? _owningBodyCache;
|
||||
private int _idHash;
|
||||
private IEntity? _surgeonCache;
|
||||
|
||||
@@ -32,7 +32,7 @@ namespace Content.Server.GameObjects.Components.Body
|
||||
public override string Name => "SurgeryTool";
|
||||
public override uint? NetID => ContentNetIDs.SURGERY;
|
||||
|
||||
private readonly Dictionary<int, object> _optionsCache = new Dictionary<int, object>();
|
||||
private readonly Dictionary<int, object> _optionsCache = new();
|
||||
|
||||
private float _baseOperateTime;
|
||||
|
||||
|
||||
@@ -48,7 +48,7 @@ namespace Content.Server.GameObjects.Components.Chemistry
|
||||
|
||||
[ViewVariables] private bool Powered => !Owner.TryGetComponent(out PowerReceiverComponent? receiver) || receiver.Powered;
|
||||
|
||||
[ViewVariables] private readonly SolutionContainerComponent BufferSolution = new SolutionContainerComponent();
|
||||
[ViewVariables] private readonly SolutionContainerComponent BufferSolution = new();
|
||||
|
||||
[ViewVariables] private BoundUserInterface? UserInterface => Owner.GetUIOrNull(ChemMasterUiKey.Key);
|
||||
|
||||
|
||||
@@ -31,7 +31,7 @@ namespace Content.Server.GameObjects.Components
|
||||
[ViewVariables] private BoundUserInterface UserInterface => Owner.GetUIOrNull(ConfigurationUiKey.Key);
|
||||
|
||||
[ViewVariables]
|
||||
private readonly Dictionary<string, string> _config = new Dictionary<string, string>();
|
||||
private readonly Dictionary<string, string> _config = new();
|
||||
|
||||
private Regex _validation;
|
||||
|
||||
|
||||
@@ -41,7 +41,7 @@ namespace Content.Server.GameObjects.Components.Construction
|
||||
private string _startingNodeIdentifier = string.Empty;
|
||||
|
||||
[ViewVariables]
|
||||
private HashSet<string> _containers = new HashSet<string>();
|
||||
private HashSet<string> _containers = new();
|
||||
[ViewVariables]
|
||||
private List<List<ConstructionGraphStep>>? _edgeNestedStepProgress = null;
|
||||
|
||||
|
||||
@@ -31,7 +31,7 @@ namespace Content.Server.GameObjects.Components.Damage
|
||||
private ActSystem _actSystem;
|
||||
|
||||
public override List<DamageState> SupportedDamageStates =>
|
||||
new List<DamageState> {DamageState.Alive, DamageState.Dead};
|
||||
new() {DamageState.Alive, DamageState.Dead};
|
||||
|
||||
void IExAct.OnExplosion(ExplosionEventArgs eventArgs)
|
||||
{
|
||||
|
||||
@@ -17,7 +17,7 @@ namespace Content.Server.GameObjects.Components.Damage
|
||||
|
||||
/* Set in YAML */
|
||||
protected int Damage;
|
||||
private List<ToolQuality> _tools = new List<ToolQuality>();
|
||||
private List<ToolQuality> _tools = new();
|
||||
|
||||
public override void ExposeData(ObjectSerializer serializer)
|
||||
{
|
||||
|
||||
@@ -33,7 +33,7 @@ namespace Content.Server.GameObjects.Components.Damage
|
||||
protected string DestroySoundCollection { get; private set; }
|
||||
|
||||
public override List<DamageState> SupportedDamageStates =>
|
||||
new List<DamageState> {DamageState.Alive, DamageState.Dead};
|
||||
new() {DamageState.Alive, DamageState.Dead};
|
||||
|
||||
public override void ExposeData(ObjectSerializer serializer)
|
||||
{
|
||||
|
||||
@@ -47,7 +47,7 @@ namespace Content.Server.GameObjects.Components.Disposal
|
||||
/// A list of tags attached to the content, used for sorting
|
||||
/// </summary>
|
||||
[ViewVariables]
|
||||
public HashSet<string> Tags { get; set; } = new HashSet<string>();
|
||||
public HashSet<string> Tags { get; set; } = new();
|
||||
|
||||
private bool CanInsert(IEntity entity)
|
||||
{
|
||||
|
||||
@@ -63,7 +63,7 @@ namespace Content.Server.GameObjects.Components.Disposal
|
||||
[ViewVariables]
|
||||
private TimeSpan _lastExitAttempt;
|
||||
|
||||
public static readonly Regex TagRegex = new Regex("^[a-zA-Z0-9, ]*$", RegexOptions.Compiled);
|
||||
public static readonly Regex TagRegex = new("^[a-zA-Z0-9, ]*$", RegexOptions.Compiled);
|
||||
|
||||
/// <summary>
|
||||
/// The current pressure of this disposal unit.
|
||||
@@ -101,7 +101,7 @@ namespace Content.Server.GameObjects.Components.Disposal
|
||||
[ViewVariables] public IReadOnlyList<IEntity> ContainedEntities => _container.ContainedEntities;
|
||||
|
||||
[ViewVariables]
|
||||
private readonly List<string> _targetList = new List<string>();
|
||||
private readonly List<string> _targetList = new();
|
||||
|
||||
[ViewVariables]
|
||||
private string _target = "";
|
||||
|
||||
@@ -36,7 +36,7 @@ namespace Content.Server.GameObjects.Components.Disposal
|
||||
public override string Name => "DisposalRouter";
|
||||
|
||||
[ViewVariables]
|
||||
private readonly HashSet<string> _tags = new HashSet<string>();
|
||||
private readonly HashSet<string> _tags = new();
|
||||
|
||||
[ViewVariables]
|
||||
public bool Anchored =>
|
||||
|
||||
@@ -107,7 +107,7 @@ namespace Content.Server.GameObjects.Components.Disposal
|
||||
/// <returns>Returns a <see cref="DisposalTaggerUserInterfaceState"/></returns>
|
||||
private DisposalTaggerUserInterfaceState GetUserInterfaceState()
|
||||
{
|
||||
return new DisposalTaggerUserInterfaceState(_tag);
|
||||
return new(_tag);
|
||||
}
|
||||
|
||||
private void UpdateUserInterface()
|
||||
|
||||
@@ -10,7 +10,7 @@ namespace Content.Server.GameObjects.Components
|
||||
public sealed class DoAfterComponent : SharedDoAfterComponent
|
||||
{
|
||||
public IReadOnlyCollection<DoAfter> DoAfters => _doAfters.Keys;
|
||||
private readonly Dictionary<DoAfter, byte> _doAfters = new Dictionary<DoAfter, byte>();
|
||||
private readonly Dictionary<DoAfter, byte> _doAfters = new();
|
||||
|
||||
// So the client knows which one to update (and so we don't send all of the do_afters every time 1 updates)
|
||||
// we'll just send them the index. Doesn't matter if it wraps around.
|
||||
|
||||
@@ -36,7 +36,7 @@ namespace Content.Server.GameObjects.Components.Doors
|
||||
/// </summary>
|
||||
private static readonly TimeSpan PowerWiresTimeout = TimeSpan.FromSeconds(5.0);
|
||||
|
||||
private CancellationTokenSource _powerWiresPulsedTimerCancel = new CancellationTokenSource();
|
||||
private CancellationTokenSource _powerWiresPulsedTimerCancel = new();
|
||||
|
||||
private bool _powerWiresPulsed;
|
||||
|
||||
|
||||
@@ -63,7 +63,7 @@ namespace Content.Server.GameObjects.Components.Doors
|
||||
[ViewVariables(VVAccess.ReadWrite)]
|
||||
protected float CloseSpeed = AutoCloseDelay;
|
||||
|
||||
private readonly CancellationTokenSource _cancellationTokenSource = new CancellationTokenSource();
|
||||
private readonly CancellationTokenSource _cancellationTokenSource = new();
|
||||
|
||||
protected virtual TimeSpan CloseTimeOne => TimeSpan.FromSeconds(0.3f);
|
||||
protected virtual TimeSpan CloseTimeTwo => TimeSpan.FromSeconds(0.9f);
|
||||
|
||||
@@ -55,7 +55,7 @@ namespace Content.Server.GameObjects.Components.GUI
|
||||
}
|
||||
}
|
||||
|
||||
[ViewVariables] private readonly List<Hand> _hands = new List<Hand>();
|
||||
[ViewVariables] private readonly List<Hand> _hands = new();
|
||||
|
||||
public IEnumerable<string> Hands => _hands.Select(h => h.Name);
|
||||
|
||||
@@ -744,7 +744,7 @@ namespace Content.Server.GameObjects.Components.GUI
|
||||
|
||||
public SharedHand ToShared(int index, HandLocation location)
|
||||
{
|
||||
return new SharedHand(index, Name, Entity?.Uid, location, Enabled);
|
||||
return new(index, Name, Entity?.Uid, location, Enabled);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -30,7 +30,7 @@ namespace Content.Server.GameObjects.Components.GUI
|
||||
[Dependency] private readonly IEntitySystemManager _entitySystemManager = default!;
|
||||
|
||||
[ViewVariables]
|
||||
private readonly Dictionary<Slots, ContainerSlot> _slotContainers = new Dictionary<Slots, ContainerSlot>();
|
||||
private readonly Dictionary<Slots, ContainerSlot> _slotContainers = new();
|
||||
|
||||
private KeyValuePair<Slots, (EntityUid entity, bool fits)>? _hoverEntity;
|
||||
|
||||
|
||||
@@ -28,7 +28,7 @@ namespace Content.Server.GameObjects.Components.Headset
|
||||
|
||||
private RadioSystem _radioSystem = default!;
|
||||
|
||||
private List<int> _channels = new List<int>();
|
||||
private List<int> _channels = new();
|
||||
|
||||
[ViewVariables(VVAccess.ReadWrite)]
|
||||
private int BroadcastFrequency { get; set; }
|
||||
|
||||
@@ -22,7 +22,7 @@ namespace Content.Server.GameObjects.Components.Interactable
|
||||
[RegisterComponent]
|
||||
public class ExpendableLightComponent : SharedExpendableLightComponent, IUse
|
||||
{
|
||||
private static readonly AudioParams LoopedSoundParams = new AudioParams(0, 1, "Master", 62.5f, 1, AudioMixTarget.Stereo, true, 0.3f);
|
||||
private static readonly AudioParams LoopedSoundParams = new(0, 1, "Master", 62.5f, 1, AudioMixTarget.Stereo, true, 0.3f);
|
||||
|
||||
/// <summary>
|
||||
/// Status of light, whether or not it is emitting light.
|
||||
|
||||
@@ -44,7 +44,7 @@ namespace Content.Server.GameObjects.Components.Items.Storage
|
||||
private bool _storageInitialCalculated;
|
||||
private int _storageUsed;
|
||||
private int _storageCapacityMax;
|
||||
public readonly HashSet<IPlayerSession> SubscribedSessions = new HashSet<IPlayerSession>();
|
||||
public readonly HashSet<IPlayerSession> SubscribedSessions = new();
|
||||
|
||||
[ViewVariables]
|
||||
public override IReadOnlyList<IEntity>? StoredEntities => _storage?.ContainedEntities;
|
||||
|
||||
@@ -24,10 +24,10 @@ namespace Content.Server.GameObjects.Components.Markers
|
||||
public override string Name => "ConditionalSpawner";
|
||||
|
||||
[ViewVariables(VVAccess.ReadWrite)]
|
||||
public List<string> Prototypes { get; set; } = new List<string>();
|
||||
public List<string> Prototypes { get; set; } = new();
|
||||
|
||||
[ViewVariables(VVAccess.ReadWrite)]
|
||||
private readonly List<string> _gameRules = new List<string>();
|
||||
private readonly List<string> _gameRules = new();
|
||||
|
||||
[ViewVariables(VVAccess.ReadWrite)]
|
||||
public float Chance { get; set; } = 1.0f;
|
||||
|
||||
@@ -21,7 +21,7 @@ namespace Content.Server.GameObjects.Components.Markers
|
||||
public override string Name => "TimedSpawner";
|
||||
|
||||
[ViewVariables(VVAccess.ReadWrite)]
|
||||
public List<string> Prototypes { get; set; } = new List<string>();
|
||||
public List<string> Prototypes { get; set; } = new();
|
||||
|
||||
[ViewVariables(VVAccess.ReadWrite)]
|
||||
public float Chance { get; set; } = 1.0f;
|
||||
|
||||
@@ -19,10 +19,10 @@ namespace Content.Server.GameObjects.Components.Markers
|
||||
public override string Name => "TrashSpawner";
|
||||
|
||||
[ViewVariables(VVAccess.ReadWrite)]
|
||||
public List<string> RarePrototypes { get; set; } = new List<string>();
|
||||
public List<string> RarePrototypes { get; set; } = new();
|
||||
|
||||
[ViewVariables(VVAccess.ReadWrite)]
|
||||
private List<string> _gameRules = new List<string>();
|
||||
private List<string> _gameRules = new();
|
||||
|
||||
[ViewVariables(VVAccess.ReadWrite)]
|
||||
public float RareChance { get; set; } = 0.05f;
|
||||
|
||||
@@ -42,7 +42,7 @@ namespace Content.Server.GameObjects.Components.Medical
|
||||
private TimeSpan _lastInternalOpenAttempt;
|
||||
|
||||
private ContainerSlot _bodyContainer = default!;
|
||||
private readonly Vector2 _ejectOffset = new Vector2(0f, 0f);
|
||||
private readonly Vector2 _ejectOffset = new(0f, 0f);
|
||||
|
||||
[ViewVariables]
|
||||
private bool Powered => !Owner.TryGetComponent(out PowerReceiverComponent? receiver) || receiver.Powered;
|
||||
@@ -95,7 +95,7 @@ namespace Content.Server.GameObjects.Components.Medical
|
||||
}
|
||||
|
||||
private static readonly MedicalScannerBoundUserInterfaceState EmptyUIState =
|
||||
new MedicalScannerBoundUserInterfaceState(
|
||||
new(
|
||||
null,
|
||||
new Dictionary<DamageClass, int>(),
|
||||
new Dictionary<DamageType, int>(),
|
||||
|
||||
@@ -43,11 +43,11 @@ namespace Content.Server.GameObjects.Components.Metabolism
|
||||
|
||||
[ViewVariables(VVAccess.ReadWrite)] private int _suffocationDamage;
|
||||
|
||||
[ViewVariables] public Dictionary<Gas, float> NeedsGases { get; set; } = new Dictionary<Gas, float>();
|
||||
[ViewVariables] public Dictionary<Gas, float> NeedsGases { get; set; } = new();
|
||||
|
||||
[ViewVariables] public Dictionary<Gas, float> ProducesGases { get; set; } = new Dictionary<Gas, float>();
|
||||
[ViewVariables] public Dictionary<Gas, float> ProducesGases { get; set; } = new();
|
||||
|
||||
[ViewVariables] public Dictionary<Gas, float> DeficitGases { get; set; } = new Dictionary<Gas, float>();
|
||||
[ViewVariables] public Dictionary<Gas, float> DeficitGases { get; set; } = new();
|
||||
|
||||
/// <summary>
|
||||
/// Heat generated due to metabolism. It's generated via metabolism
|
||||
|
||||
@@ -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)
|
||||
{
|
||||
|
||||
@@ -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()
|
||||
{
|
||||
|
||||
@@ -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" },
|
||||
};
|
||||
|
||||
@@ -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()},
|
||||
|
||||
@@ -16,7 +16,7 @@ namespace Content.Server.GameObjects.Components.NodeContainer
|
||||
|
||||
[ViewVariables]
|
||||
public IReadOnlyList<Node> Nodes => _nodes;
|
||||
private List<Node> _nodes = new List<Node>();
|
||||
private List<Node> _nodes = new();
|
||||
|
||||
public override void ExposeData(ObjectSerializer serializer)
|
||||
{
|
||||
|
||||
@@ -25,7 +25,7 @@ namespace Content.Server.GameObjects.Components.NodeContainer.NodeGroups
|
||||
|
||||
public AMEControllerComponent MasterController => _masterController;
|
||||
|
||||
private readonly List<AMEShieldComponent> _cores = new List<AMEShieldComponent>();
|
||||
private readonly List<AMEShieldComponent> _cores = new();
|
||||
|
||||
public int CoreCount => _cores.Count;
|
||||
|
||||
|
||||
@@ -26,10 +26,10 @@ namespace Content.Server.GameObjects.Components.NodeContainer.NodeGroups
|
||||
public class ApcNetNodeGroup : BaseNetConnectorNodeGroup<BaseApcNetComponent, IApcNet>, IApcNet
|
||||
{
|
||||
[ViewVariables]
|
||||
private readonly Dictionary<ApcComponent, BatteryComponent> _apcBatteries = new Dictionary<ApcComponent, BatteryComponent>();
|
||||
private readonly Dictionary<ApcComponent, BatteryComponent> _apcBatteries = new();
|
||||
|
||||
[ViewVariables]
|
||||
private readonly Dictionary<PowerProviderComponent, List<PowerReceiverComponent>> _providerReceivers = new Dictionary<PowerProviderComponent, List<PowerReceiverComponent>>();
|
||||
private readonly Dictionary<PowerProviderComponent, List<PowerReceiverComponent>> _providerReceivers = new();
|
||||
|
||||
//Debug property
|
||||
[ViewVariables]
|
||||
|
||||
@@ -7,7 +7,7 @@ namespace Content.Server.GameObjects.Components.NodeContainer.NodeGroups
|
||||
{
|
||||
public abstract class BaseNetConnectorNodeGroup<TNetConnector, TNetType> : BaseNodeGroup where TNetConnector : BaseNetConnectorComponent<TNetType>
|
||||
{
|
||||
private readonly Dictionary<Node, List<TNetConnector>> _netConnectorComponents = new Dictionary<Node, List<TNetConnector>>();
|
||||
private readonly Dictionary<Node, List<TNetConnector>> _netConnectorComponents = new();
|
||||
|
||||
protected override void OnAddNode(Node node)
|
||||
{
|
||||
|
||||
@@ -30,7 +30,7 @@ namespace Content.Server.GameObjects.Components.NodeContainer.NodeGroups
|
||||
{
|
||||
[ViewVariables]
|
||||
public IReadOnlyList<Node> Nodes => _nodes;
|
||||
private readonly List<Node> _nodes = new List<Node>();
|
||||
private readonly List<Node> _nodes = new();
|
||||
|
||||
[ViewVariables]
|
||||
public int NodeCount => Nodes.Count;
|
||||
@@ -104,7 +104,7 @@ namespace Content.Server.GameObjects.Components.NodeContainer.NodeGroups
|
||||
private class NullNodeGroup : INodeGroup
|
||||
{
|
||||
public IReadOnlyList<Node> Nodes => _nodes;
|
||||
private readonly List<Node> _nodes = new List<Node>();
|
||||
private readonly List<Node> _nodes = new();
|
||||
public void Initialize(Node sourceNode) { }
|
||||
public void AddNode(Node node) { }
|
||||
public void CombineGroup(INodeGroup newGroup) { }
|
||||
|
||||
@@ -18,7 +18,7 @@ namespace Content.Server.GameObjects.Components.NodeContainer.NodeGroups
|
||||
|
||||
public class NodeGroupManager : INodeGroupManager
|
||||
{
|
||||
private readonly HashSet<INodeGroup> _dirtyNodeGroups = new HashSet<INodeGroup>();
|
||||
private readonly HashSet<INodeGroup> _dirtyNodeGroups = new();
|
||||
|
||||
public void AddDirtyNodeGroup(INodeGroup nodeGroup)
|
||||
{
|
||||
|
||||
@@ -20,12 +20,12 @@ namespace Content.Server.GameObjects.Components.NodeContainer.NodeGroups
|
||||
public class PipeNet : BaseNodeGroup, IPipeNet
|
||||
{
|
||||
[ViewVariables]
|
||||
public GasMixture Air { get; set; } = new GasMixture();
|
||||
public GasMixture Air { get; set; } = new();
|
||||
|
||||
public static readonly IPipeNet NullNet = new NullPipeNet();
|
||||
|
||||
[ViewVariables]
|
||||
private readonly List<PipeNode> _pipes = new List<PipeNode>();
|
||||
private readonly List<PipeNode> _pipes = new();
|
||||
|
||||
[ViewVariables] private AtmosphereSystem _atmosphereSystem;
|
||||
|
||||
@@ -94,7 +94,7 @@ namespace Content.Server.GameObjects.Components.NodeContainer.NodeGroups
|
||||
|
||||
private class NullPipeNet : IPipeNet
|
||||
{
|
||||
GasMixture IGasMixtureHolder.Air { get; set; } = new GasMixture();
|
||||
GasMixture IGasMixtureHolder.Air { get; set; } = new();
|
||||
public void Update() { }
|
||||
}
|
||||
}
|
||||
|
||||
@@ -26,7 +26,7 @@
|
||||
[Dependency] private readonly IReflectionManager _reflectionManager = default!;
|
||||
[Dependency] private readonly IDynamicTypeFactory _typeFactory = default!;
|
||||
|
||||
private readonly Dictionary<NodeGroupID, Type> _groupTypes = new Dictionary<NodeGroupID, Type>();
|
||||
private readonly Dictionary<NodeGroupID, Type> _groupTypes = new();
|
||||
|
||||
public void Initialize()
|
||||
{
|
||||
|
||||
@@ -32,16 +32,16 @@ namespace Content.Server.GameObjects.Components.NodeContainer.NodeGroups
|
||||
[Dependency] private readonly IPowerNetManager _powerNetManager = default!;
|
||||
|
||||
[ViewVariables]
|
||||
private readonly List<PowerSupplierComponent> _suppliers = new List<PowerSupplierComponent>();
|
||||
private readonly List<PowerSupplierComponent> _suppliers = new();
|
||||
|
||||
[ViewVariables]
|
||||
private int _totalSupply = 0;
|
||||
|
||||
[ViewVariables]
|
||||
private readonly Dictionary<Priority, List<PowerConsumerComponent>> _consumersByPriority = new Dictionary<Priority, List<PowerConsumerComponent>>();
|
||||
private readonly Dictionary<Priority, List<PowerConsumerComponent>> _consumersByPriority = new();
|
||||
|
||||
[ViewVariables]
|
||||
private readonly Dictionary<Priority, int> _drawByPriority = new Dictionary<Priority, int>();
|
||||
private readonly Dictionary<Priority, int> _drawByPriority = new();
|
||||
|
||||
public static readonly IPowerNet NullNet = new NullPowerNet();
|
||||
|
||||
|
||||
@@ -54,7 +54,7 @@ namespace Content.Server.GameObjects.Components.Nutrition
|
||||
|
||||
[ViewVariables(VVAccess.ReadOnly)]
|
||||
public Dictionary<HungerThreshold, float> HungerThresholds => _hungerThresholds;
|
||||
private readonly Dictionary<HungerThreshold, float> _hungerThresholds = new Dictionary<HungerThreshold, float>
|
||||
private readonly Dictionary<HungerThreshold, float> _hungerThresholds = new()
|
||||
{
|
||||
{HungerThreshold.Overfed, 600.0f},
|
||||
{HungerThreshold.Okay, 450.0f},
|
||||
@@ -70,7 +70,7 @@ namespace Content.Server.GameObjects.Components.Nutrition
|
||||
}
|
||||
|
||||
|
||||
public static readonly Dictionary<HungerThreshold, AlertType> HungerThresholdAlertTypes = new Dictionary<HungerThreshold, AlertType>
|
||||
public static readonly Dictionary<HungerThreshold, AlertType> HungerThresholdAlertTypes = new()
|
||||
{
|
||||
{ HungerThreshold.Overfed, AlertType.Overfed },
|
||||
{ HungerThreshold.Peckish, AlertType.Peckish },
|
||||
|
||||
@@ -54,7 +54,7 @@ namespace Content.Server.GameObjects.Components.Nutrition
|
||||
private float _currentThirst;
|
||||
|
||||
[ViewVariables(VVAccess.ReadOnly)]
|
||||
public Dictionary<ThirstThreshold, float> ThirstThresholds { get; } = new Dictionary<ThirstThreshold, float>
|
||||
public Dictionary<ThirstThreshold, float> ThirstThresholds { get; } = new()
|
||||
{
|
||||
{ThirstThreshold.OverHydrated, 600.0f},
|
||||
{ThirstThreshold.Okay, 450.0f},
|
||||
@@ -63,7 +63,7 @@ namespace Content.Server.GameObjects.Components.Nutrition
|
||||
{ThirstThreshold.Dead, 0.0f},
|
||||
};
|
||||
|
||||
public static readonly Dictionary<ThirstThreshold, AlertType> ThirstThresholdAlertTypes = new Dictionary<ThirstThreshold, AlertType>
|
||||
public static readonly Dictionary<ThirstThreshold, AlertType> ThirstThresholdAlertTypes = new()
|
||||
{
|
||||
{ThirstThreshold.OverHydrated, AlertType.Overhydrated},
|
||||
{ThirstThreshold.Thirsty, AlertType.Thirsty},
|
||||
|
||||
@@ -441,7 +441,7 @@ namespace Content.Server.GameObjects.Components.PDA
|
||||
private sealed class PdaAccessSet : ISet<string>
|
||||
{
|
||||
private readonly PDAComponent _pdaComponent;
|
||||
private static readonly HashSet<string> EmptySet = new HashSet<string>();
|
||||
private static readonly HashSet<string> EmptySet = new();
|
||||
|
||||
public PdaAccessSet(PDAComponent pdaComponent)
|
||||
{
|
||||
|
||||
@@ -31,7 +31,7 @@ namespace Content.Server.GameObjects.Components.Portal
|
||||
[ViewVariables] private bool _onCooldown;
|
||||
[ViewVariables] private string _departureSound = "";
|
||||
[ViewVariables] private string _arrivalSound = "";
|
||||
public readonly List<IEntity> ImmuneEntities = new List<IEntity>(); // K
|
||||
public readonly List<IEntity> ImmuneEntities = new(); // K
|
||||
[ViewVariables(VVAccess.ReadWrite)] private float _aliveTime;
|
||||
|
||||
public override void ExposeData(ObjectSerializer serializer)
|
||||
|
||||
@@ -37,7 +37,7 @@ namespace Content.Server.GameObjects.Components.Power.ApcNetComponents
|
||||
|
||||
[ViewVariables]
|
||||
public IReadOnlyList<PowerReceiverComponent> LinkedReceivers => _linkedReceivers;
|
||||
private List<PowerReceiverComponent> _linkedReceivers = new List<PowerReceiverComponent>();
|
||||
private List<PowerReceiverComponent> _linkedReceivers = new();
|
||||
|
||||
/// <summary>
|
||||
/// If <see cref="PowerReceiverComponent"/>s should consider connecting to this.
|
||||
|
||||
@@ -174,7 +174,7 @@ namespace Content.Server.GameObjects.Components.Power.ApcNetComponents.PowerRece
|
||||
On
|
||||
}
|
||||
|
||||
public Dictionary<EmergencyLightState, string> BatteryStateText = new Dictionary<EmergencyLightState, string>
|
||||
public Dictionary<EmergencyLightState, string> BatteryStateText = new()
|
||||
{
|
||||
{ EmergencyLightState.Full, "[color=darkgreen]Full[/color]"},
|
||||
{ EmergencyLightState.Empty, "[color=darkred]Empty[/color]"},
|
||||
|
||||
@@ -19,7 +19,7 @@ namespace Content.Server.GameObjects.Components.Power.PowerNetComponents
|
||||
|
||||
public class PowerNetManager : IPowerNetManager
|
||||
{
|
||||
private readonly HashSet<IPowerNet> _dirtyPowerNets = new HashSet<IPowerNet>();
|
||||
private readonly HashSet<IPowerNet> _dirtyPowerNets = new();
|
||||
|
||||
public void AddDirtyPowerNet(IPowerNet powerNet)
|
||||
{
|
||||
|
||||
@@ -27,7 +27,7 @@ namespace Content.Server.GameObjects.Components.Radio
|
||||
private RadioSystem _radioSystem = default!;
|
||||
|
||||
private bool _radioOn;
|
||||
private List<int> _channels = new List<int>();
|
||||
private List<int> _channels = new();
|
||||
|
||||
[ViewVariables(VVAccess.ReadWrite)]
|
||||
private int BroadcastFrequency { get; set; }
|
||||
|
||||
@@ -25,7 +25,7 @@ namespace Content.Server.GameObjects.Components.Recycling
|
||||
{
|
||||
public override string Name => "Recycler";
|
||||
|
||||
private readonly List<IEntity> _intersecting = new List<IEntity>();
|
||||
private readonly List<IEntity> _intersecting = new();
|
||||
|
||||
/// <summary>
|
||||
/// Whether or not sentient beings will be recycled
|
||||
|
||||
@@ -29,7 +29,7 @@ namespace Content.Server.GameObjects.Components.Research
|
||||
public const int VolumePerSheet = 3750;
|
||||
|
||||
[ViewVariables]
|
||||
public Queue<LatheRecipePrototype> Queue { get; } = new Queue<LatheRecipePrototype>();
|
||||
public Queue<LatheRecipePrototype> Queue { get; } = new();
|
||||
|
||||
[ViewVariables]
|
||||
public bool Producing { get; private set; }
|
||||
|
||||
@@ -11,7 +11,7 @@ namespace Content.Server.GameObjects.Components.Research
|
||||
public class MaterialStorageComponent : SharedMaterialStorageComponent
|
||||
{
|
||||
[ViewVariables]
|
||||
protected override Dictionary<string, int> Storage { get; set; } = new Dictionary<string, int>();
|
||||
protected override Dictionary<string, int> Storage { get; set; } = new();
|
||||
|
||||
/// <summary>
|
||||
/// How much material the storage can store in total.
|
||||
|
||||
@@ -31,10 +31,10 @@ namespace Content.Server.GameObjects.Components.Research
|
||||
public IReadOnlyList<TechnologyPrototype> UnlockedTechnologies => Database.Technologies;
|
||||
|
||||
[ViewVariables(VVAccess.ReadOnly)]
|
||||
public List<ResearchPointSourceComponent> PointSources { get; } = new List<ResearchPointSourceComponent>();
|
||||
public List<ResearchPointSourceComponent> PointSources { get; } = new();
|
||||
|
||||
[ViewVariables(VVAccess.ReadOnly)]
|
||||
public List<ResearchClientComponent> Clients { get; } = new List<ResearchClientComponent>();
|
||||
public List<ResearchClientComponent> Clients { get; } = new();
|
||||
|
||||
public int Point => _points;
|
||||
|
||||
|
||||
@@ -15,9 +15,9 @@ namespace Content.Server.GameObjects.Components.Singularity
|
||||
{
|
||||
public readonly ContainmentFieldGeneratorComponent Generator1;
|
||||
public readonly ContainmentFieldGeneratorComponent Generator2;
|
||||
private readonly List<IEntity> _fields = new List<IEntity>();
|
||||
private readonly List<IEntity> _fields = new();
|
||||
private int _sharedEnergyPool;
|
||||
private readonly CancellationTokenSource _powerDecreaseCancellationTokenSource = new CancellationTokenSource();
|
||||
private readonly CancellationTokenSource _powerDecreaseCancellationTokenSource = new();
|
||||
public int SharedEnergyPool
|
||||
{
|
||||
get => _sharedEnergyPool;
|
||||
|
||||
@@ -158,7 +158,7 @@ namespace Content.Server.GameObjects.Components.Singularity
|
||||
_singularityController?.Push(pushVector.Normalized, 2);
|
||||
}
|
||||
|
||||
private readonly List<IEntity> _previousPulledEntities = new List<IEntity>();
|
||||
private readonly List<IEntity> _previousPulledEntities = new();
|
||||
public void PullUpdate()
|
||||
{
|
||||
foreach (var previousPulledEntity in _previousPulledEntities)
|
||||
|
||||
@@ -24,7 +24,7 @@ namespace Content.Server.GameObjects.Components.Suspicion
|
||||
public class SuspicionRoleComponent : SharedSuspicionRoleComponent, IExamine
|
||||
{
|
||||
private Role? _role;
|
||||
private readonly HashSet<SuspicionRoleComponent> _allies = new HashSet<SuspicionRoleComponent>();
|
||||
private readonly HashSet<SuspicionRoleComponent> _allies = new();
|
||||
|
||||
[ViewVariables]
|
||||
public Role? Role
|
||||
|
||||
@@ -24,7 +24,7 @@ namespace Content.Server.GameObjects.Components.Weapon.Ranged.Ammunition
|
||||
{
|
||||
public override string Name => "RangedMagazine";
|
||||
|
||||
private readonly Stack<IEntity> _spawnedAmmo = new Stack<IEntity>();
|
||||
private readonly Stack<IEntity> _spawnedAmmo = new();
|
||||
private Container _ammoContainer;
|
||||
|
||||
public int ShotsLeft => _spawnedAmmo.Count + _unspawnedCount;
|
||||
|
||||
@@ -118,22 +118,22 @@ namespace Content.Server.GameObjects.Components
|
||||
/// Contains all registered wires.
|
||||
/// </summary>
|
||||
[ViewVariables]
|
||||
public readonly List<Wire> WiresList = new List<Wire>();
|
||||
public readonly List<Wire> WiresList = new();
|
||||
|
||||
/// <summary>
|
||||
/// Status messages are displayed at the bottom of the UI.
|
||||
/// </summary>
|
||||
[ViewVariables]
|
||||
private readonly Dictionary<object, object> _statuses = new Dictionary<object, object>();
|
||||
private readonly Dictionary<object, object> _statuses = new();
|
||||
|
||||
/// <summary>
|
||||
/// <see cref="AssignAppearance"/> and <see cref="WiresBuilder.CreateWire"/>.
|
||||
/// </summary>
|
||||
private readonly List<WireColor> _availableColors =
|
||||
new List<WireColor>((WireColor[]) Enum.GetValues(typeof(WireColor)));
|
||||
new((WireColor[]) Enum.GetValues(typeof(WireColor)));
|
||||
|
||||
private readonly List<WireLetter> _availableLetters =
|
||||
new List<WireLetter>((WireLetter[]) Enum.GetValues(typeof(WireLetter)));
|
||||
new((WireLetter[]) Enum.GetValues(typeof(WireLetter)));
|
||||
|
||||
private string _boardName = default!;
|
||||
|
||||
|
||||
@@ -24,7 +24,7 @@ namespace Content.Server.GameObjects.EntitySystems.AI
|
||||
|
||||
public Faction GetHostileFactions(Faction faction) => _hostileFactions.TryGetValue(faction, out var hostiles) ? hostiles : Faction.None;
|
||||
|
||||
private readonly Dictionary<Faction, Faction> _hostileFactions = new Dictionary<Faction, Faction>
|
||||
private readonly Dictionary<Faction, Faction> _hostileFactions = new()
|
||||
{
|
||||
{Faction.NanoTransen,
|
||||
Faction.SimpleHostile | Faction.Syndicate | Faction.Xeno},
|
||||
|
||||
@@ -28,15 +28,15 @@ namespace Content.Server.GameObjects.EntitySystems.AI
|
||||
[Dependency] private readonly IDynamicTypeFactory _typeFactory = default!;
|
||||
[Dependency] private readonly IReflectionManager _reflectionManager = default!;
|
||||
|
||||
private readonly Dictionary<string, Type> _processorTypes = new Dictionary<string, Type>();
|
||||
private readonly Dictionary<string, Type> _processorTypes = new();
|
||||
|
||||
/// <summary>
|
||||
/// To avoid iterating over dead AI continuously they can wake and sleep themselves when necessary.
|
||||
/// </summary>
|
||||
private readonly HashSet<AiLogicProcessor> _awakeAi = new HashSet<AiLogicProcessor>();
|
||||
private readonly HashSet<AiLogicProcessor> _awakeAi = new();
|
||||
|
||||
// To avoid modifying awakeAi while iterating over it.
|
||||
private readonly List<SleepAiMessage> _queuedSleepMessages = new List<SleepAiMessage>();
|
||||
private readonly List<SleepAiMessage> _queuedSleepMessages = new();
|
||||
|
||||
public bool IsAwake(AiLogicProcessor processor) => _awakeAi.Contains(processor);
|
||||
|
||||
|
||||
@@ -9,7 +9,7 @@ namespace Content.Server.GameObjects.EntitySystems.AI.LoadBalancer
|
||||
/// </summary>
|
||||
public class AiActionSystem : EntitySystem
|
||||
{
|
||||
private readonly AiActionJobQueue _aiRequestQueue = new AiActionJobQueue();
|
||||
private readonly AiActionJobQueue _aiRequestQueue = new();
|
||||
|
||||
public AiActionRequestJob RequestAction(AiActionRequest request, CancellationTokenSource cancellationToken)
|
||||
{
|
||||
|
||||
@@ -45,7 +45,7 @@ namespace Content.Server.GameObjects.EntitySystems.AI.Pathfinding.Accessible
|
||||
/// <summary>
|
||||
/// Queued region updates
|
||||
/// </summary>
|
||||
private readonly HashSet<PathfindingChunk> _queuedUpdates = new HashSet<PathfindingChunk>();
|
||||
private readonly HashSet<PathfindingChunk> _queuedUpdates = new();
|
||||
|
||||
// Oh god the nesting. Shouldn't need to go beyond this
|
||||
/// <summary>
|
||||
@@ -54,7 +54,7 @@ namespace Content.Server.GameObjects.EntitySystems.AI.Pathfinding.Accessible
|
||||
/// i.e. same collision, not-space, same access, etc.
|
||||
/// </summary>
|
||||
private readonly Dictionary<GridId, Dictionary<PathfindingChunk, HashSet<PathfindingRegion>>> _regions =
|
||||
new Dictionary<GridId, Dictionary<PathfindingChunk, HashSet<PathfindingRegion>>>();
|
||||
new();
|
||||
|
||||
/// <summary>
|
||||
/// Minimum time for the cached reachable regions to be stored
|
||||
@@ -71,9 +71,9 @@ namespace Content.Server.GameObjects.EntitySystems.AI.Pathfinding.Accessible
|
||||
// Also, didn't use a dictionary because there didn't seem to be a clean way to do the lookup
|
||||
// Plus this way we can check if everything is equal except for vision so an entity with a lower vision radius can use an entity with a higher vision radius' cached result
|
||||
private readonly Dictionary<ReachableArgs, Dictionary<PathfindingRegion, (TimeSpan CacheTime, HashSet<PathfindingRegion> Regions)>> _cachedAccessible =
|
||||
new Dictionary<ReachableArgs, Dictionary<PathfindingRegion, (TimeSpan, HashSet<PathfindingRegion>)>>();
|
||||
new();
|
||||
|
||||
private readonly List<PathfindingRegion> _queuedCacheDeletions = new List<PathfindingRegion>();
|
||||
private readonly List<PathfindingRegion> _queuedCacheDeletions = new();
|
||||
|
||||
#if DEBUG
|
||||
private int _runningCacheIdx = 0;
|
||||
|
||||
@@ -27,7 +27,7 @@ namespace Content.Server.GameObjects.EntitySystems.AI.Pathfinding.Accessible
|
||||
public int Width { get; private set; } = 1;
|
||||
|
||||
public PathfindingChunk ParentChunk => OriginNode.ParentChunk;
|
||||
public HashSet<PathfindingRegion> Neighbors { get; } = new HashSet<PathfindingRegion>();
|
||||
public HashSet<PathfindingRegion> Neighbors { get; } = new();
|
||||
|
||||
public bool IsDoor { get; }
|
||||
public HashSet<PathfindingNode> Nodes => _nodes;
|
||||
|
||||
@@ -22,17 +22,17 @@ namespace Content.Server.GameObjects.EntitySystems.AI.Pathfinding
|
||||
/// Whenever there's a change in the collision layers we update the mask as the graph has more reads than writes
|
||||
/// </summary>
|
||||
public int BlockedCollisionMask { get; private set; }
|
||||
private readonly Dictionary<IEntity, int> _blockedCollidables = new Dictionary<IEntity, int>(0);
|
||||
private readonly Dictionary<IEntity, int> _blockedCollidables = new(0);
|
||||
|
||||
public IReadOnlyDictionary<IEntity, int> PhysicsLayers => _physicsLayers;
|
||||
private readonly Dictionary<IEntity, int> _physicsLayers = new Dictionary<IEntity, int>(0);
|
||||
private readonly Dictionary<IEntity, int> _physicsLayers = new(0);
|
||||
|
||||
/// <summary>
|
||||
/// The entities on this tile that require access to traverse
|
||||
/// </summary>
|
||||
/// We don't store the ICollection, at least for now, as we'd need to replicate the access code here
|
||||
public IReadOnlyCollection<AccessReader> AccessReaders => _accessReaders.Values;
|
||||
private readonly Dictionary<IEntity, AccessReader> _accessReaders = new Dictionary<IEntity, AccessReader>(0);
|
||||
private readonly Dictionary<IEntity, AccessReader> _accessReaders = new(0);
|
||||
|
||||
public PathfindingNode(PathfindingChunk parent, TileRef tileRef)
|
||||
{
|
||||
|
||||
@@ -35,18 +35,18 @@ namespace Content.Server.GameObjects.EntitySystems.AI.Pathfinding
|
||||
[Dependency] private readonly IEntityManager _entityManager = default!;
|
||||
|
||||
public IReadOnlyDictionary<GridId, Dictionary<Vector2i, PathfindingChunk>> Graph => _graph;
|
||||
private readonly Dictionary<GridId, Dictionary<Vector2i, PathfindingChunk>> _graph = new Dictionary<GridId, Dictionary<Vector2i, PathfindingChunk>>();
|
||||
private readonly Dictionary<GridId, Dictionary<Vector2i, PathfindingChunk>> _graph = new();
|
||||
|
||||
private readonly PathfindingJobQueue _pathfindingQueue = new PathfindingJobQueue();
|
||||
private readonly PathfindingJobQueue _pathfindingQueue = new();
|
||||
|
||||
// Queued pathfinding graph updates
|
||||
private readonly Queue<CollisionChangeMessage> _collidableUpdateQueue = new Queue<CollisionChangeMessage>();
|
||||
private readonly Queue<MoveEvent> _moveUpdateQueue = new Queue<MoveEvent>();
|
||||
private readonly Queue<AccessReaderChangeMessage> _accessReaderUpdateQueue = new Queue<AccessReaderChangeMessage>();
|
||||
private readonly Queue<TileRef> _tileUpdateQueue = new Queue<TileRef>();
|
||||
private readonly Queue<CollisionChangeMessage> _collidableUpdateQueue = new();
|
||||
private readonly Queue<MoveEvent> _moveUpdateQueue = new();
|
||||
private readonly Queue<AccessReaderChangeMessage> _accessReaderUpdateQueue = new();
|
||||
private readonly Queue<TileRef> _tileUpdateQueue = new();
|
||||
|
||||
// Need to store previously known entity positions for collidables for when they move
|
||||
private readonly Dictionary<IEntity, PathfindingNode> _lastKnownPositions = new Dictionary<IEntity, PathfindingNode>();
|
||||
private readonly Dictionary<IEntity, PathfindingNode> _lastKnownPositions = new();
|
||||
|
||||
public const int TrackedCollisionLayers = (int)
|
||||
(CollisionGroup.Impassable |
|
||||
|
||||
@@ -52,37 +52,37 @@ namespace Content.Server.GameObjects.EntitySystems.AI.Steering
|
||||
// agent's steering. Should help a lot given this is the most expensive operator by far.
|
||||
// The AI will keep moving, it's just it'll keep moving in its existing direction.
|
||||
// If we change to 20/30 TPS you might want to change this but for now it's fine
|
||||
private readonly List<Dictionary<IEntity, IAiSteeringRequest>> _agentLists = new List<Dictionary<IEntity, IAiSteeringRequest>>(AgentListCount);
|
||||
private readonly List<Dictionary<IEntity, IAiSteeringRequest>> _agentLists = new(AgentListCount);
|
||||
private const int AgentListCount = 2;
|
||||
private int _listIndex;
|
||||
|
||||
// Cache nextGrid
|
||||
private readonly Dictionary<IEntity, EntityCoordinates> _nextGrid = new Dictionary<IEntity, EntityCoordinates>();
|
||||
private readonly Dictionary<IEntity, EntityCoordinates> _nextGrid = new();
|
||||
|
||||
/// <summary>
|
||||
/// Current live paths for AI
|
||||
/// </summary>
|
||||
private readonly Dictionary<IEntity, Queue<TileRef>> _paths = new Dictionary<IEntity, Queue<TileRef>>();
|
||||
private readonly Dictionary<IEntity, Queue<TileRef>> _paths = new();
|
||||
|
||||
/// <summary>
|
||||
/// Pathfinding request jobs we're waiting on
|
||||
/// </summary>
|
||||
private readonly Dictionary<IEntity, (CancellationTokenSource CancelToken, Job<Queue<TileRef>> Job)> _pathfindingRequests =
|
||||
new Dictionary<IEntity, (CancellationTokenSource, Job<Queue<TileRef>>)>();
|
||||
new();
|
||||
|
||||
/// <summary>
|
||||
/// Keep track of how long we've been in 1 position and re-path if it's been too long
|
||||
/// </summary>
|
||||
private readonly Dictionary<IEntity, int> _stuckCounter = new Dictionary<IEntity, int>();
|
||||
private readonly Dictionary<IEntity, int> _stuckCounter = new();
|
||||
|
||||
/// <summary>
|
||||
/// Get a fixed position for the target entity; if they move then re-path
|
||||
/// </summary>
|
||||
private readonly Dictionary<IEntity, EntityCoordinates> _entityTargetPosition = new Dictionary<IEntity, EntityCoordinates>();
|
||||
private readonly Dictionary<IEntity, EntityCoordinates> _entityTargetPosition = new();
|
||||
|
||||
// Anti-Stuck
|
||||
// Given the collision avoidance can lead to twitching need to store a reference position and check if we've been near this too long
|
||||
private readonly Dictionary<IEntity, EntityCoordinates> _stuckPositions = new Dictionary<IEntity, EntityCoordinates>();
|
||||
private readonly Dictionary<IEntity, EntityCoordinates> _stuckPositions = new();
|
||||
|
||||
public override void Initialize()
|
||||
{
|
||||
|
||||
@@ -30,7 +30,7 @@ namespace Content.Server.GameObjects.EntitySystems.Atmos
|
||||
/// To modify it see <see cref="AddObserver"/> and
|
||||
/// <see cref="RemoveObserver"/>.
|
||||
/// </summary>
|
||||
private readonly HashSet<IPlayerSession> _playerObservers = new HashSet<IPlayerSession>();
|
||||
private readonly HashSet<IPlayerSession> _playerObservers = new();
|
||||
|
||||
/// <summary>
|
||||
/// Overlay update ticks per second.
|
||||
|
||||
@@ -37,16 +37,16 @@ namespace Content.Server.GameObjects.EntitySystems.Atmos
|
||||
/// <summary>
|
||||
/// The tiles that have had their atmos data updated since last tick
|
||||
/// </summary>
|
||||
private readonly Dictionary<GridId, HashSet<Vector2i>> _invalidTiles = new Dictionary<GridId, HashSet<Vector2i>>();
|
||||
private readonly Dictionary<GridId, HashSet<Vector2i>> _invalidTiles = new();
|
||||
|
||||
private readonly Dictionary<IPlayerSession, PlayerGasOverlay> _knownPlayerChunks =
|
||||
new Dictionary<IPlayerSession, PlayerGasOverlay>();
|
||||
new();
|
||||
|
||||
/// <summary>
|
||||
/// Gas data stored in chunks to make PVS / bubbling easier.
|
||||
/// </summary>
|
||||
private readonly Dictionary<GridId, Dictionary<Vector2i, GasOverlayChunk>> _overlay =
|
||||
new Dictionary<GridId, Dictionary<Vector2i, GasOverlayChunk>>();
|
||||
new();
|
||||
|
||||
/// <summary>
|
||||
/// How far away do we update gas overlays (minimum; due to chunking further away tiles may also be updated).
|
||||
@@ -378,14 +378,14 @@ namespace Content.Server.GameObjects.EntitySystems.Atmos
|
||||
private sealed class PlayerGasOverlay
|
||||
{
|
||||
private readonly Dictionary<GridId, Dictionary<Vector2i, GasOverlayChunk>> _data =
|
||||
new Dictionary<GridId, Dictionary<Vector2i, GasOverlayChunk>>();
|
||||
new();
|
||||
|
||||
private readonly Dictionary<GasOverlayChunk, GameTick> _lastSent =
|
||||
new Dictionary<GasOverlayChunk, GameTick>();
|
||||
new();
|
||||
|
||||
public GasOverlayMessage UpdateClient(GridId grid, List<(Vector2i, GasOverlayData)> data)
|
||||
{
|
||||
return new GasOverlayMessage(grid, data);
|
||||
return new(grid, data);
|
||||
}
|
||||
|
||||
public void Reset()
|
||||
|
||||
@@ -12,8 +12,8 @@ namespace Content.Server.GameObjects.EntitySystems
|
||||
// ReSharper disable once ClassNeverInstantiated.Global
|
||||
public class BlockGameSystem : EntitySystem
|
||||
{
|
||||
private readonly List<BlockGameMessages.HighScoreEntry> _roundHighscores = new List<BlockGameMessages.HighScoreEntry>();
|
||||
private readonly List<BlockGameMessages.HighScoreEntry> _globalHighscores = new List<BlockGameMessages.HighScoreEntry>();
|
||||
private readonly List<BlockGameMessages.HighScoreEntry> _roundHighscores = new();
|
||||
private readonly List<BlockGameMessages.HighScoreEntry> _globalHighscores = new();
|
||||
|
||||
public HighScorePlacement RegisterHighScore(string name, int score)
|
||||
{
|
||||
|
||||
@@ -22,7 +22,7 @@ namespace Content.Server.GameObjects.EntitySystems
|
||||
/// <summary>
|
||||
/// Stores all bank accounts.
|
||||
/// </summary>
|
||||
private readonly Dictionary<int, CargoBankAccount> _accountsDict = new Dictionary<int, CargoBankAccount>();
|
||||
private readonly Dictionary<int, CargoBankAccount> _accountsDict = new();
|
||||
/// <summary>
|
||||
/// Used to assign IDs to bank accounts. Incremental counter.
|
||||
/// </summary>
|
||||
|
||||
@@ -17,7 +17,7 @@ namespace Content.Server.GameObjects.EntitySystems
|
||||
}
|
||||
}
|
||||
|
||||
public readonly Dictionary<int, Mind> Minds = new Dictionary<int, Mind>();
|
||||
public readonly Dictionary<int, Mind> Minds = new();
|
||||
|
||||
public void AddToDnaScans(Mind mind)
|
||||
{
|
||||
|
||||
@@ -38,7 +38,7 @@ namespace Content.Server.GameObjects.EntitySystems
|
||||
[Dependency] private readonly IPrototypeManager _prototypeManager = default!;
|
||||
[Dependency] private readonly IRobustRandom _robustRandom = default!;
|
||||
|
||||
private readonly Dictionary<ICommonSession, HashSet<int>> _beingBuilt = new Dictionary<ICommonSession, HashSet<int>>();
|
||||
private readonly Dictionary<ICommonSession, HashSet<int>> _beingBuilt = new();
|
||||
|
||||
public override void Initialize()
|
||||
{
|
||||
|
||||
@@ -35,7 +35,7 @@ namespace Content.Server.GameObjects.EntitySystems
|
||||
AllowAll
|
||||
}
|
||||
|
||||
private readonly List<ServerDoorComponent> _activeDoors = new List<ServerDoorComponent>();
|
||||
private readonly List<ServerDoorComponent> _activeDoors = new();
|
||||
|
||||
public override void Initialize()
|
||||
{
|
||||
|
||||
@@ -9,7 +9,7 @@ namespace Content.Server.GameObjects.EntitySystems
|
||||
[UsedImplicitly]
|
||||
internal sealed class EmergencyLightSystem : EntitySystem
|
||||
{
|
||||
private readonly List<EmergencyLightComponent> _activeLights = new List<EmergencyLightComponent>();
|
||||
private readonly List<EmergencyLightComponent> _activeLights = new();
|
||||
|
||||
public override void Initialize()
|
||||
{
|
||||
|
||||
@@ -12,7 +12,7 @@ namespace Content.Server.GameObjects.EntitySystems
|
||||
[UsedImplicitly]
|
||||
public class GodmodeSystem : EntitySystem, IResettingEntitySystem
|
||||
{
|
||||
private readonly Dictionary<IEntity, OldEntityInformation> _entities = new Dictionary<IEntity, OldEntityInformation>();
|
||||
private readonly Dictionary<IEntity, OldEntityInformation> _entities = new();
|
||||
|
||||
public void Reset()
|
||||
{
|
||||
|
||||
@@ -28,7 +28,7 @@ namespace Content.Server.GameObjects.EntitySystems
|
||||
|
||||
private const uint ShakeTimes = 10;
|
||||
|
||||
private Dictionary<GridId, uint> _gridsToShake = new Dictionary<GridId, uint>();
|
||||
private Dictionary<GridId, uint> _gridsToShake = new();
|
||||
|
||||
private float _internalTimer = 0.0f;
|
||||
|
||||
|
||||
@@ -21,8 +21,8 @@ namespace Content.Server.GameObjects.EntitySystems.JobQueues.Queues
|
||||
/// </summary>
|
||||
public virtual double MaxTime => 0.002;
|
||||
|
||||
private readonly Queue<IJob> _pendingQueue = new Queue<IJob>();
|
||||
private readonly List<IJob> _waitingJobs = new List<IJob>();
|
||||
private readonly Queue<IJob> _pendingQueue = new();
|
||||
private readonly List<IJob> _waitingJobs = new();
|
||||
|
||||
public void EnqueueJob(IJob job)
|
||||
{
|
||||
|
||||
@@ -19,7 +19,7 @@ namespace Content.Server.GameObjects.EntitySystems
|
||||
[Dependency] private readonly IPrototypeManager _prototypeManager = default!;
|
||||
|
||||
private int _nextUid = 0;
|
||||
private readonly Dictionary<int, Seed> _seeds = new Dictionary<int,Seed>();
|
||||
private readonly Dictionary<int, Seed> _seeds = new();
|
||||
|
||||
private float _timer = 0f;
|
||||
|
||||
|
||||
@@ -40,7 +40,7 @@ namespace Content.Server.GameObjects.EntitySystems
|
||||
/// A dictionary of players to the last time that they
|
||||
/// pointed at something.
|
||||
/// </summary>
|
||||
private readonly Dictionary<ICommonSession, TimeSpan> _pointers = new Dictionary<ICommonSession, TimeSpan>();
|
||||
private readonly Dictionary<ICommonSession, TimeSpan> _pointers = new();
|
||||
|
||||
private const float PointingRange = 15f;
|
||||
|
||||
|
||||
@@ -11,7 +11,7 @@ namespace Content.Server.GameObjects.EntitySystems
|
||||
public const float ResearchConsoleUIUpdateTime = 30f;
|
||||
|
||||
private float _timer = ResearchConsoleUIUpdateTime;
|
||||
private readonly List<ResearchServerComponent> _servers = new List<ResearchServerComponent>();
|
||||
private readonly List<ResearchServerComponent> _servers = new();
|
||||
private readonly IEntityQuery ConsoleQuery;
|
||||
public IReadOnlyList<ResearchServerComponent> Servers => _servers;
|
||||
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user