Merge pull request #1893 from DrSmugleaf/pragma-begone
This commit is contained in:
@@ -41,11 +41,9 @@ namespace Content.Server.GameObjects.Components.Body
|
||||
[ComponentReference(typeof(IBodyManagerComponent))]
|
||||
public class BodyManagerComponent : SharedBodyManagerComponent, IBodyPartContainer, IRelayMoveInput
|
||||
{
|
||||
#pragma warning disable CS0649
|
||||
[Dependency] private readonly IPrototypeManager _prototypeManager = default!;
|
||||
[Dependency] private readonly IBodyNetworkFactory _bodyNetworkFactory = default!;
|
||||
[Dependency] private readonly IReflectionManager _reflectionManager = default!;
|
||||
#pragma warning restore
|
||||
|
||||
[ViewVariables] private string _presetName = default!;
|
||||
|
||||
|
||||
@@ -147,7 +147,7 @@ namespace Content.Server.GameObjects.Components.Cargo
|
||||
break;
|
||||
}
|
||||
|
||||
_prototypeManager.TryIndex(order.ProductId, out CargoProductPrototype product);
|
||||
PrototypeManager.TryIndex(order.ProductId, out CargoProductPrototype product);
|
||||
if (product == null!)
|
||||
break;
|
||||
var capacity = _cargoOrderDataManager.GetCapacity(orders.Database.Id);
|
||||
@@ -168,7 +168,7 @@ namespace Content.Server.GameObjects.Components.Cargo
|
||||
// TEMPORARY loop for spawning stuff on top of console
|
||||
foreach (var order in approvedOrders)
|
||||
{
|
||||
if (!_prototypeManager.TryIndex(order.ProductId, out CargoProductPrototype product))
|
||||
if (!PrototypeManager.TryIndex(order.ProductId, out CargoProductPrototype product))
|
||||
continue;
|
||||
for (var i = 0; i < order.Amount; i++)
|
||||
{
|
||||
|
||||
@@ -8,9 +8,7 @@ namespace Content.Server.GameObjects.Components.Cargo
|
||||
[RegisterComponent]
|
||||
public class CargoOrderDatabaseComponent : SharedCargoOrderDatabaseComponent
|
||||
{
|
||||
#pragma warning disable 649
|
||||
[Dependency] private readonly ICargoOrderDataManager _cargoOrderDataManager;
|
||||
#pragma warning restore 649
|
||||
[Dependency] private readonly ICargoOrderDataManager _cargoOrderDataManager = default!;
|
||||
|
||||
public CargoOrderDatabase Database { get; set; }
|
||||
public bool ConnectedToDatabase => Database != null;
|
||||
|
||||
@@ -20,9 +20,8 @@ namespace Content.Server.GameObjects.Components.Chemistry
|
||||
[ComponentReference(typeof(IAfterInteract))]
|
||||
public class PillComponent : FoodComponent, IUse, IAfterInteract
|
||||
{
|
||||
#pragma warning disable 649
|
||||
[Dependency] private readonly IEntitySystemManager _entitySystem;
|
||||
#pragma warning restore 649
|
||||
[Dependency] private readonly IEntitySystemManager _entitySystem = default!;
|
||||
|
||||
public override string Name => "Pill";
|
||||
|
||||
[ViewVariables]
|
||||
|
||||
@@ -19,9 +19,7 @@ namespace Content.Server.GameObjects.Components.Chemistry
|
||||
[RegisterComponent]
|
||||
class PourableComponent : Component, IInteractUsing
|
||||
{
|
||||
#pragma warning disable 649
|
||||
[Dependency] private readonly IServerNotifyManager _notifyManager;
|
||||
#pragma warning restore 649
|
||||
[Dependency] private readonly IServerNotifyManager _notifyManager = default!;
|
||||
|
||||
public override string Name => "Pourable";
|
||||
|
||||
|
||||
@@ -29,10 +29,8 @@ namespace Content.Server.GameObjects.Components.Chemistry
|
||||
[RegisterComponent]
|
||||
public class SolutionComponent : SharedSolutionComponent, IExamine
|
||||
{
|
||||
#pragma warning disable 649
|
||||
[Dependency] private readonly IPrototypeManager _prototypeManager;
|
||||
[Dependency] private readonly IEntitySystemManager _entitySystemManager;
|
||||
#pragma warning restore 649
|
||||
[Dependency] private readonly IPrototypeManager _prototypeManager = default!;
|
||||
[Dependency] private readonly IEntitySystemManager _entitySystemManager = default!;
|
||||
|
||||
private IEnumerable<ReactionPrototype> _reactions;
|
||||
private AudioSystem _audioSystem;
|
||||
|
||||
@@ -21,10 +21,8 @@ namespace Content.Server.GameObjects.Components.Damage
|
||||
[ComponentReference(typeof(IDamageableComponent))]
|
||||
public class BreakableComponent : RuinableComponent, IExAct
|
||||
{
|
||||
#pragma warning disable 649
|
||||
[Dependency] private readonly IEntitySystemManager _entitySystemManager;
|
||||
[Dependency] private readonly IRobustRandom _random;
|
||||
#pragma warning restore 649
|
||||
[Dependency] private readonly IEntitySystemManager _entitySystemManager = default!;
|
||||
[Dependency] private readonly IRobustRandom _random = default!;
|
||||
|
||||
public override string Name => "Breakable";
|
||||
|
||||
|
||||
@@ -16,9 +16,7 @@ namespace Content.Server.GameObjects.Components.Damage
|
||||
[ComponentReference(typeof(IDamageableComponent))]
|
||||
public class DestructibleComponent : RuinableComponent, IDestroyAct
|
||||
{
|
||||
#pragma warning disable 649
|
||||
[Dependency] private readonly IEntitySystemManager _entitySystemManager;
|
||||
#pragma warning restore 649
|
||||
[Dependency] private readonly IEntitySystemManager _entitySystemManager = default!;
|
||||
|
||||
protected ActSystem ActSystem;
|
||||
|
||||
|
||||
@@ -14,9 +14,7 @@ namespace Content.Server.GameObjects.Components.Disposal
|
||||
[ComponentReference(typeof(IDisposalTubeComponent))]
|
||||
public class DisposalJunctionComponent : DisposalTubeComponent
|
||||
{
|
||||
#pragma warning disable 649
|
||||
[Dependency] private readonly IRobustRandom _random;
|
||||
#pragma warning restore 649
|
||||
[Dependency] private readonly IRobustRandom _random = default!;
|
||||
|
||||
/// <summary>
|
||||
/// The angles to connect to.
|
||||
|
||||
@@ -46,9 +46,7 @@ namespace Content.Server.GameObjects.Components.Fluids
|
||||
// based on behaviour (e.g. someone being punched vs slashed with a sword would have different blood sprite)
|
||||
// to check for low volumes for evaporation or whatever
|
||||
|
||||
#pragma warning disable 649
|
||||
[Dependency] private readonly IMapManager _mapManager;
|
||||
#pragma warning restore 649
|
||||
[Dependency] private readonly IMapManager _mapManager = default!;
|
||||
|
||||
public override string Name => "Puddle";
|
||||
|
||||
|
||||
@@ -28,10 +28,8 @@ namespace Content.Server.GameObjects.Components.GUI
|
||||
[RegisterComponent]
|
||||
public class InventoryComponent : SharedInventoryComponent, IExAct, IEffectBlocker, IPressureProtection
|
||||
{
|
||||
#pragma warning disable 649
|
||||
[Dependency] private readonly IEntitySystemManager _entitySystemManager;
|
||||
[Dependency] private readonly IServerNotifyManager _serverNotifyManager;
|
||||
#pragma warning restore 649
|
||||
[Dependency] private readonly IEntitySystemManager _entitySystemManager = default!;
|
||||
[Dependency] private readonly IServerNotifyManager _serverNotifyManager = default!;
|
||||
|
||||
[ViewVariables]
|
||||
private readonly Dictionary<Slots, ContainerSlot> _slotContainers = new Dictionary<Slots, ContainerSlot>();
|
||||
|
||||
@@ -14,11 +14,9 @@ namespace Content.Server.GameObjects.Components.Interactable
|
||||
[RegisterComponent]
|
||||
public class TilePryingComponent : Component, IAfterInteract
|
||||
{
|
||||
#pragma warning disable 649
|
||||
[Dependency] private readonly IEntitySystemManager _entitySystemManager;
|
||||
[Dependency] private readonly ITileDefinitionManager _tileDefinitionManager;
|
||||
[Dependency] private readonly IMapManager _mapManager;
|
||||
#pragma warning restore 649
|
||||
[Dependency] private readonly IEntitySystemManager _entitySystemManager = default!;
|
||||
[Dependency] private readonly ITileDefinitionManager _tileDefinitionManager = default!;
|
||||
[Dependency] private readonly IMapManager _mapManager = default!;
|
||||
|
||||
public override string Name => "TilePrying";
|
||||
private bool _toolComponentNeeded = true;
|
||||
|
||||
@@ -20,9 +20,7 @@ namespace Content.Server.GameObjects.Components.Items.Clothing
|
||||
[ComponentReference(typeof(IItemComponent))]
|
||||
public class ClothingComponent : ItemComponent, IUse
|
||||
{
|
||||
#pragma warning disable 649
|
||||
[Dependency] private readonly IServerNotifyManager _serverNotifyManager;
|
||||
#pragma warning restore 649
|
||||
[Dependency] private readonly IServerNotifyManager _serverNotifyManager = default!;
|
||||
|
||||
public override string Name => "Clothing";
|
||||
public override uint? NetID => ContentNetIDs.CLOTHING;
|
||||
|
||||
@@ -20,10 +20,8 @@ namespace Content.Server.GameObjects.Components.Items
|
||||
[RegisterComponent]
|
||||
public class DiceComponent : Component, IActivate, IUse, ILand, IExamine
|
||||
{
|
||||
#pragma warning disable 649
|
||||
[Dependency] private readonly IPrototypeManager _prototypeManager;
|
||||
[Dependency] private readonly IRobustRandom _random;
|
||||
#pragma warning restore 649
|
||||
[Dependency] private readonly IPrototypeManager _prototypeManager = default!;
|
||||
[Dependency] private readonly IRobustRandom _random = default!;
|
||||
|
||||
public override string Name => "Dice";
|
||||
|
||||
|
||||
@@ -15,10 +15,8 @@ namespace Content.Server.GameObjects.Components.Items
|
||||
[RegisterComponent]
|
||||
public class FloorTileItemComponent : Component, IAfterInteract
|
||||
{
|
||||
#pragma warning disable 649
|
||||
[Dependency] private readonly ITileDefinitionManager _tileDefinitionManager;
|
||||
[Dependency] private readonly IMapManager _mapManager;
|
||||
#pragma warning restore 649
|
||||
[Dependency] private readonly ITileDefinitionManager _tileDefinitionManager = default!;
|
||||
[Dependency] private readonly IMapManager _mapManager = default!;
|
||||
|
||||
public override string Name => "FloorTile";
|
||||
private string _outputTile;
|
||||
|
||||
@@ -15,10 +15,8 @@ namespace Content.Server.GameObjects.Components.Items.RCD
|
||||
[RegisterComponent]
|
||||
public class RCDAmmoComponent : Component, IAfterInteract, IExamine
|
||||
{
|
||||
[Dependency] private IServerNotifyManager _serverNotifyManager = default!;
|
||||
|
||||
#pragma warning disable 649
|
||||
[Dependency] private IServerNotifyManager _serverNotifyManager;
|
||||
#pragma warning restore 649
|
||||
public override string Name => "RCDAmmo";
|
||||
|
||||
//How much ammo we refill
|
||||
|
||||
@@ -25,14 +25,12 @@ namespace Content.Server.GameObjects.Components.Items.RCD
|
||||
[RegisterComponent]
|
||||
public class RCDComponent : Component, IAfterInteract, IUse, IExamine
|
||||
{
|
||||
[Dependency] private readonly ITileDefinitionManager _tileDefinitionManager = default!;
|
||||
[Dependency] private readonly IEntitySystemManager _entitySystemManager = default!;
|
||||
[Dependency] private readonly IMapManager _mapManager = default!;
|
||||
[Dependency] private readonly IServerEntityManager _serverEntityManager = default!;
|
||||
[Dependency] private readonly IServerNotifyManager _serverNotifyManager = default!;
|
||||
|
||||
#pragma warning disable 649
|
||||
[Dependency] private readonly ITileDefinitionManager _tileDefinitionManager;
|
||||
[Dependency] private readonly IEntitySystemManager _entitySystemManager;
|
||||
[Dependency] private readonly IMapManager _mapManager;
|
||||
[Dependency] private readonly IServerEntityManager _serverEntityManager;
|
||||
[Dependency] private IServerNotifyManager _serverNotifyManager;
|
||||
#pragma warning restore 649
|
||||
public override string Name => "RCD";
|
||||
private RcdMode _mode = 0; //What mode are we on? Can be floors, walls, deconstruct.
|
||||
private readonly RcdMode[] _modes = (RcdMode[]) Enum.GetValues(typeof(RcdMode));
|
||||
|
||||
@@ -8,11 +8,9 @@ namespace Content.Server.GameObjects.Components.Items.Storage.Fill
|
||||
[RegisterComponent]
|
||||
internal sealed class MedkitFillComponent : Component, IMapInit
|
||||
{
|
||||
public override string Name => "MedkitFill";
|
||||
[Dependency] private readonly IEntityManager _entityManager = default!;
|
||||
|
||||
#pragma warning disable 649
|
||||
[Dependency] private readonly IEntityManager _entityManager;
|
||||
#pragma warning restore 649
|
||||
public override string Name => "MedkitFill";
|
||||
|
||||
void IMapInit.MapInit()
|
||||
{
|
||||
|
||||
@@ -10,14 +10,12 @@ namespace Content.Server.GameObjects.Components.Items.Storage.Fill
|
||||
[RegisterComponent]
|
||||
internal sealed class StorageFillComponent : Component, IMapInit
|
||||
{
|
||||
[Dependency] private readonly IEntityManager _entityManager = default!;
|
||||
|
||||
public override string Name => "StorageFill";
|
||||
|
||||
private List<string> _contents = new List<string>();
|
||||
|
||||
#pragma warning disable 649
|
||||
[Dependency] private readonly IEntityManager _entityManager;
|
||||
#pragma warning restore 649
|
||||
|
||||
public override void ExposeData(ObjectSerializer serializer)
|
||||
{
|
||||
base.ExposeData(serializer);
|
||||
|
||||
@@ -10,11 +10,9 @@ namespace Content.Server.GameObjects.Components.Items.Storage.Fill
|
||||
[RegisterComponent]
|
||||
internal sealed class ToolboxElectricalFillComponent : Component, IMapInit
|
||||
{
|
||||
public override string Name => "ToolboxElectricalFill";
|
||||
[Dependency] private readonly IEntityManager _entityManager = default!;
|
||||
|
||||
#pragma warning disable 649
|
||||
[Dependency] private readonly IEntityManager _entityManager;
|
||||
#pragma warning restore 649
|
||||
public override string Name => "ToolboxElectricalFill";
|
||||
|
||||
void IMapInit.MapInit()
|
||||
{
|
||||
|
||||
@@ -10,11 +10,9 @@ namespace Content.Server.GameObjects.Components.Items.Storage.Fill
|
||||
[RegisterComponent]
|
||||
internal sealed class ToolboxEmergencyFillComponent : Component, IMapInit
|
||||
{
|
||||
public override string Name => "ToolboxEmergencyFill";
|
||||
[Dependency] private readonly IEntityManager _entityManager = default!;
|
||||
|
||||
#pragma warning disable 649
|
||||
[Dependency] private readonly IEntityManager _entityManager;
|
||||
#pragma warning restore 649
|
||||
public override string Name => "ToolboxEmergencyFill";
|
||||
|
||||
void IMapInit.MapInit()
|
||||
{
|
||||
|
||||
@@ -10,11 +10,9 @@ namespace Content.Server.GameObjects.Components.Items.Storage.Fill
|
||||
[RegisterComponent]
|
||||
internal sealed class ToolboxGoldFillComponent : Component, IMapInit
|
||||
{
|
||||
public override string Name => "ToolboxGoldFill";
|
||||
[Dependency] private readonly IEntityManager _entityManager = default!;
|
||||
|
||||
#pragma warning disable 649
|
||||
[Dependency] private readonly IEntityManager _entityManager;
|
||||
#pragma warning restore 649
|
||||
public override string Name => "ToolboxGoldFill";
|
||||
|
||||
void IMapInit.MapInit()
|
||||
{
|
||||
|
||||
@@ -8,11 +8,9 @@ namespace Content.Server.GameObjects.Components.Items.Storage.Fill
|
||||
[RegisterComponent]
|
||||
internal sealed class UtilityBeltClothingFillComponent : Component, IMapInit
|
||||
{
|
||||
public override string Name => "UtilityBeltClothingFill";
|
||||
[Dependency] private readonly IEntityManager _entityManager = default!;
|
||||
|
||||
#pragma warning disable 649
|
||||
[Dependency] private readonly IEntityManager _entityManager;
|
||||
#pragma warning restore 649
|
||||
public override string Name => "UtilityBeltClothingFill";
|
||||
|
||||
void IMapInit.MapInit()
|
||||
{
|
||||
|
||||
@@ -24,13 +24,11 @@ namespace Content.Server.GameObjects.Components.Items.Storage
|
||||
[ComponentReference(typeof(IItemComponent))]
|
||||
public class ItemComponent : StorableComponent, IInteractHand, IExAct, IEquipped, IUnequipped, IItemComponent
|
||||
{
|
||||
[Dependency] private readonly IMapManager _mapManager = default!;
|
||||
|
||||
public override string Name => "Item";
|
||||
public override uint? NetID => ContentNetIDs.ITEM;
|
||||
|
||||
#pragma warning disable 649
|
||||
[Dependency] private readonly IMapManager _mapManager;
|
||||
#pragma warning restore 649
|
||||
|
||||
private string _equippedPrefix;
|
||||
|
||||
public string EquippedPrefix
|
||||
|
||||
@@ -16,10 +16,8 @@ namespace Content.Server.GameObjects.Components.Items
|
||||
[RegisterComponent]
|
||||
public class ToysComponent : Component, IActivate, IUse, ILand
|
||||
{
|
||||
#pragma warning disable 649
|
||||
[Dependency] private readonly IPrototypeManager _prototypeManager;
|
||||
[Dependency] private readonly IRobustRandom _random;
|
||||
#pragma warning restore 649
|
||||
[Dependency] private readonly IPrototypeManager _prototypeManager = default!;
|
||||
[Dependency] private readonly IRobustRandom _random = default!;
|
||||
|
||||
public override string Name => "Toys";
|
||||
|
||||
|
||||
@@ -18,14 +18,12 @@ namespace Content.Server.GameObjects.Components.Markers
|
||||
[RegisterComponent]
|
||||
public class ConditionalSpawnerComponent : Component, IMapInit
|
||||
{
|
||||
public override string Name => "ConditionalSpawner";
|
||||
[Dependency] private readonly IGameTicker _gameTicker = default!;
|
||||
[Dependency] private readonly IReflectionManager _reflectionManager = default!;
|
||||
[Dependency] private readonly IEntityManager _entityManager = default!;
|
||||
[Dependency] private readonly IRobustRandom _robustRandom = default!;
|
||||
|
||||
#pragma warning disable 649
|
||||
[Dependency] private IGameTicker _gameTicker;
|
||||
[Dependency] private IReflectionManager _reflectionManager;
|
||||
[Dependency] private IEntityManager _entityManager;
|
||||
[Dependency] private IRobustRandom _robustRandom;
|
||||
#pragma warning restore 649
|
||||
public override string Name => "ConditionalSpawner";
|
||||
|
||||
[ViewVariables(VVAccess.ReadWrite)]
|
||||
public List<string> Prototypes { get; set; } = new List<string>();
|
||||
|
||||
@@ -12,9 +12,7 @@ namespace Content.Server.GameObjects.Components.Markers
|
||||
[ComponentReference(typeof(SharedSpawnPointComponent))]
|
||||
public sealed class SpawnPointComponent : SharedSpawnPointComponent
|
||||
{
|
||||
#pragma warning disable 649
|
||||
[Dependency] private IPrototypeManager _prototypeManager;
|
||||
#pragma warning restore 649
|
||||
[Dependency] private readonly IPrototypeManager _prototypeManager = default!;
|
||||
|
||||
[ViewVariables(VVAccess.ReadWrite)]
|
||||
private SpawnPointType _spawnType;
|
||||
|
||||
@@ -15,10 +15,8 @@ namespace Content.Server.GameObjects.Components.Markers
|
||||
[RegisterComponent]
|
||||
public class TimedSpawnerComponent : Component
|
||||
{
|
||||
#pragma warning disable 649
|
||||
[Dependency] private IEntityManager _entityManager;
|
||||
[Dependency] private IRobustRandom _robustRandom;
|
||||
#pragma warning restore 649
|
||||
[Dependency] private readonly IEntityManager _entityManager = default!;
|
||||
[Dependency] private readonly IRobustRandom _robustRandom = default!;
|
||||
|
||||
public override string Name => "TimedSpawner";
|
||||
|
||||
|
||||
@@ -14,12 +14,10 @@ namespace Content.Server.GameObjects.Components.Markers
|
||||
[RegisterComponent]
|
||||
public class TrashSpawnerComponent : ConditionalSpawnerComponent
|
||||
{
|
||||
public override string Name => "TrashSpawner";
|
||||
[Dependency] private readonly IEntityManager _entityManager = default!;
|
||||
[Dependency] private readonly IRobustRandom _robustRandom = default!;
|
||||
|
||||
#pragma warning disable 649
|
||||
[Dependency] private IEntityManager _entityManager;
|
||||
[Dependency] private IRobustRandom _robustRandom;
|
||||
#pragma warning restore 649
|
||||
public override string Name => "TrashSpawner";
|
||||
|
||||
[ViewVariables(VVAccess.ReadWrite)]
|
||||
public List<string> RarePrototypes { get; set; } = new List<string>();
|
||||
|
||||
@@ -20,9 +20,7 @@ namespace Content.Server.GameObjects.Components.Metabolism
|
||||
[RegisterComponent]
|
||||
public class MetabolismComponent : Component
|
||||
{
|
||||
#pragma warning disable 649
|
||||
[Dependency] private readonly IPrototypeManager _prototypeManager;
|
||||
#pragma warning restore 649
|
||||
[Dependency] private readonly IPrototypeManager _prototypeManager = default!;
|
||||
|
||||
public override string Name => "Metabolism";
|
||||
|
||||
|
||||
@@ -17,13 +17,11 @@ namespace Content.Server.GameObjects.Components.Mining
|
||||
[RegisterComponent]
|
||||
public class AsteroidRockComponent : Component, IInteractUsing
|
||||
{
|
||||
[Dependency] private readonly IRobustRandom _random = default!;
|
||||
|
||||
public override string Name => "AsteroidRock";
|
||||
private static readonly string[] SpriteStates = {"0", "1", "2", "3", "4"};
|
||||
|
||||
#pragma warning disable 649
|
||||
[Dependency] private readonly IRobustRandom _random;
|
||||
#pragma warning restore 649
|
||||
|
||||
public override void Initialize()
|
||||
{
|
||||
base.Initialize();
|
||||
|
||||
@@ -12,9 +12,7 @@ namespace Content.Server.GameObjects.Components.Mobs
|
||||
[ComponentReference(typeof(SharedStunnableComponent))]
|
||||
public class StunnableComponent : SharedStunnableComponent
|
||||
{
|
||||
#pragma warning disable 649
|
||||
[Dependency] private IGameTiming _gameTiming;
|
||||
#pragma warning restore 649
|
||||
[Dependency] private readonly IGameTiming _gameTiming = default!;
|
||||
|
||||
protected override void OnKnockdown()
|
||||
{
|
||||
|
||||
@@ -22,12 +22,10 @@ namespace Content.Server.GameObjects.Components.NodeContainer.NodeGroups
|
||||
|
||||
public class NodeGroupFactory : INodeGroupFactory
|
||||
{
|
||||
private readonly Dictionary<NodeGroupID, Type> _groupTypes = new Dictionary<NodeGroupID, Type>();
|
||||
[Dependency] private readonly IReflectionManager _reflectionManager = default!;
|
||||
[Dependency] private readonly IDynamicTypeFactory _typeFactory = default!;
|
||||
|
||||
#pragma warning disable 649
|
||||
[Dependency] private readonly IReflectionManager _reflectionManager;
|
||||
[Dependency] private readonly IDynamicTypeFactory _typeFactory;
|
||||
#pragma warning restore 649
|
||||
private readonly Dictionary<NodeGroupID, Type> _groupTypes = new Dictionary<NodeGroupID, Type>();
|
||||
|
||||
public void Initialize()
|
||||
{
|
||||
|
||||
@@ -29,6 +29,8 @@ namespace Content.Server.GameObjects.Components.NodeContainer.NodeGroups
|
||||
[NodeGroup(NodeGroupID.HVPower, NodeGroupID.MVPower)]
|
||||
public class PowerNetNodeGroup : BaseNetConnectorNodeGroup<BasePowerNetComponent, IPowerNet>, IPowerNet
|
||||
{
|
||||
[Dependency] private readonly IPowerNetManager _powerNetManager = default!;
|
||||
|
||||
[ViewVariables]
|
||||
private readonly List<PowerSupplierComponent> _suppliers = new List<PowerSupplierComponent>();
|
||||
|
||||
@@ -43,10 +45,6 @@ namespace Content.Server.GameObjects.Components.NodeContainer.NodeGroups
|
||||
|
||||
public static readonly IPowerNet NullNet = new NullPowerNet();
|
||||
|
||||
#pragma warning disable 649
|
||||
[Dependency] private readonly IPowerNetManager _powerNetManager;
|
||||
#pragma warning restore 649
|
||||
|
||||
public PowerNetNodeGroup()
|
||||
{
|
||||
foreach (Priority priority in Enum.GetValues(typeof(Priority)))
|
||||
|
||||
@@ -29,10 +29,9 @@ namespace Content.Server.GameObjects.Components.Nutrition
|
||||
[ComponentReference(typeof(IAfterInteract))]
|
||||
public class DrinkComponent : Component, IUse, IAfterInteract, ISolutionChange, IExamine, ILand
|
||||
{
|
||||
#pragma warning disable 649
|
||||
[Dependency] private readonly IPrototypeManager _prototypeManager;
|
||||
[Dependency] private readonly IRobustRandom _random;
|
||||
#pragma warning restore 649
|
||||
[Dependency] private readonly IPrototypeManager _prototypeManager = default!;
|
||||
[Dependency] private readonly IRobustRandom _random = default!;
|
||||
|
||||
public override string Name => "Drink";
|
||||
|
||||
[ViewVariables]
|
||||
|
||||
@@ -22,10 +22,9 @@ namespace Content.Server.GameObjects.Components.Nutrition
|
||||
[RegisterComponent]
|
||||
public sealed class FoodContainer : SharedFoodContainerComponent, IUse
|
||||
{
|
||||
#pragma warning disable 649
|
||||
[Dependency] private readonly IRobustRandom _random;
|
||||
[Dependency] private readonly IEntityManager _entityManager;
|
||||
#pragma warning restore 649
|
||||
[Dependency] private readonly IRobustRandom _random = default!;
|
||||
[Dependency] private readonly IEntityManager _entityManager = default!;
|
||||
|
||||
public override string Name => "FoodContainer";
|
||||
|
||||
private AppearanceComponent _appearance;
|
||||
|
||||
@@ -34,11 +34,8 @@ namespace Content.Server.GameObjects.Components.Power.ApcNetComponents.PowerRece
|
||||
[RegisterComponent]
|
||||
public class LightBulbComponent : Component, ILand
|
||||
{
|
||||
|
||||
#pragma warning disable 649
|
||||
[Dependency] private readonly IPrototypeManager _prototypeManager;
|
||||
[Dependency] private readonly IRobustRandom _random;
|
||||
#pragma warning restore 649
|
||||
[Dependency] private readonly IPrototypeManager _prototypeManager = default!;
|
||||
[Dependency] private readonly IRobustRandom _random = default!;
|
||||
|
||||
/// <summary>
|
||||
/// Invoked whenever the state of the light bulb changes.
|
||||
|
||||
@@ -14,10 +14,8 @@ namespace Content.Server.GameObjects.Components.Power
|
||||
[RegisterComponent]
|
||||
internal class WirePlacerComponent : Component, IAfterInteract
|
||||
{
|
||||
#pragma warning disable 649
|
||||
[Dependency] private readonly IServerEntityManager _entityManager;
|
||||
[Dependency] private readonly IMapManager _mapManager;
|
||||
#pragma warning restore 649
|
||||
[Dependency] private readonly IServerEntityManager _entityManager = default!;
|
||||
[Dependency] private readonly IMapManager _mapManager = default!;
|
||||
|
||||
/// <inheritdoc />
|
||||
public override string Name => "WirePlacer";
|
||||
|
||||
@@ -70,7 +70,7 @@ namespace Content.Server.GameObjects.Components.Research
|
||||
switch (message.Message)
|
||||
{
|
||||
case LatheQueueRecipeMessage msg:
|
||||
_prototypeManager.TryIndex(msg.ID, out LatheRecipePrototype recipe);
|
||||
PrototypeManager.TryIndex(msg.ID, out LatheRecipePrototype recipe);
|
||||
if (recipe != null!)
|
||||
for (var i = 0; i < msg.Quantity; i++)
|
||||
{
|
||||
|
||||
@@ -13,9 +13,8 @@ namespace Content.Server.GameObjects.Components.Rotatable
|
||||
[RegisterComponent]
|
||||
public class RotatableComponent : Component
|
||||
{
|
||||
#pragma warning disable 649
|
||||
[Dependency] private readonly IServerNotifyManager _notifyManager;
|
||||
#pragma warning restore 649
|
||||
[Dependency] private readonly IServerNotifyManager _notifyManager = default!;
|
||||
|
||||
public override string Name => "Rotatable";
|
||||
|
||||
private void TryRotate(IEntity user, Angle angle)
|
||||
|
||||
@@ -17,13 +17,10 @@ namespace Content.Server.GameObjects.Components.Sound
|
||||
[RegisterComponent]
|
||||
public class FootstepModifierComponent : Component
|
||||
{
|
||||
#pragma warning disable 649
|
||||
[Dependency] private readonly IPrototypeManager _prototypeManager;
|
||||
[Dependency] private readonly IRobustRandom _footstepRandom;
|
||||
#pragma warning restore 649
|
||||
/// <inheritdoc />
|
||||
///
|
||||
[Dependency] private readonly IPrototypeManager _prototypeManager = default!;
|
||||
[Dependency] private readonly IRobustRandom _footstepRandom = default!;
|
||||
|
||||
/// <inheritdoc />
|
||||
public override string Name => "FootstepModifier";
|
||||
|
||||
public string _soundCollectionName;
|
||||
|
||||
@@ -19,9 +19,7 @@ namespace Content.Server.GameObjects.Components.Stack
|
||||
[RegisterComponent]
|
||||
public class StackComponent : SharedStackComponent, IInteractUsing, IExamine
|
||||
{
|
||||
#pragma warning disable 649
|
||||
[Dependency] private readonly ISharedNotifyManager _sharedNotifyManager;
|
||||
#pragma warning restore 649
|
||||
[Dependency] private readonly ISharedNotifyManager _sharedNotifyManager = default!;
|
||||
|
||||
private bool _throwIndividually = false;
|
||||
|
||||
|
||||
@@ -13,9 +13,7 @@ namespace Content.Server.GameObjects.Components.Trigger.TimerTrigger
|
||||
[RegisterComponent]
|
||||
public class OnUseTimerTriggerComponent : Component, IUse
|
||||
{
|
||||
#pragma warning disable 649
|
||||
[Dependency] private readonly IEntitySystemManager _entitySystemManager;
|
||||
#pragma warning restore 649
|
||||
[Dependency] private readonly IEntitySystemManager _entitySystemManager = default!;
|
||||
|
||||
public override string Name => "OnUseTimerTrigger";
|
||||
|
||||
|
||||
@@ -19,10 +19,8 @@ namespace Content.Server.GameObjects.Components.Utensil
|
||||
[RegisterComponent]
|
||||
public class UtensilComponent : SharedUtensilComponent, IAfterInteract
|
||||
{
|
||||
#pragma warning disable 649
|
||||
[Dependency] private readonly IEntitySystemManager _entitySystem;
|
||||
[Dependency] private readonly IRobustRandom _random;
|
||||
#pragma warning restore 649
|
||||
[Dependency] private readonly IEntitySystemManager _entitySystem = default!;
|
||||
[Dependency] private readonly IRobustRandom _random = default!;
|
||||
|
||||
protected UtensilType _types = UtensilType.None;
|
||||
|
||||
|
||||
@@ -22,10 +22,8 @@ namespace Content.Server.GameObjects.Components.Weapon.Melee
|
||||
[RegisterComponent]
|
||||
public class FlashComponent : MeleeWeaponComponent, IUse, IExamine
|
||||
{
|
||||
#pragma warning disable 649
|
||||
[Dependency] private readonly IEntityManager _entityManager;
|
||||
[Dependency] private readonly ISharedNotifyManager _notifyManager;
|
||||
#pragma warning restore 649
|
||||
[Dependency] private readonly IEntityManager _entityManager = default!;
|
||||
[Dependency] private readonly ISharedNotifyManager _notifyManager = default!;
|
||||
|
||||
public override string Name => "Flash";
|
||||
|
||||
|
||||
@@ -23,15 +23,13 @@ namespace Content.Server.GameObjects.Components.Weapon.Melee
|
||||
[RegisterComponent]
|
||||
public class MeleeWeaponComponent : Component, IAttack
|
||||
{
|
||||
[Dependency] private readonly IMapManager _mapManager = default!;
|
||||
[Dependency] private readonly IEntitySystemManager _entitySystemManager = default!;
|
||||
[Dependency] private readonly IPhysicsManager _physicsManager = default!;
|
||||
|
||||
public override string Name => "MeleeWeapon";
|
||||
private TimeSpan _lastAttackTime;
|
||||
|
||||
#pragma warning disable 649
|
||||
[Dependency] private readonly IMapManager _mapManager;
|
||||
[Dependency] private readonly IEntitySystemManager _entitySystemManager;
|
||||
[Dependency] private readonly IPhysicsManager _physicsManager;
|
||||
#pragma warning restore 649
|
||||
|
||||
private int _damage;
|
||||
private float _range;
|
||||
private float _arcWidth;
|
||||
|
||||
@@ -30,10 +30,8 @@ namespace Content.Server.GameObjects.Components.Weapon.Melee
|
||||
[RegisterComponent]
|
||||
public class StunbatonComponent : MeleeWeaponComponent, IUse, IExamine, IMapInit, IInteractUsing
|
||||
{
|
||||
#pragma warning disable 649
|
||||
[Dependency] private IRobustRandom _robustRandom;
|
||||
[Dependency] private readonly ISharedNotifyManager _notifyManager;
|
||||
#pragma warning restore 649
|
||||
[Dependency] private readonly IRobustRandom _robustRandom = default!;
|
||||
[Dependency] private readonly ISharedNotifyManager _notifyManager = default!;
|
||||
|
||||
public override string Name => "Stunbaton";
|
||||
|
||||
|
||||
@@ -40,10 +40,8 @@ namespace Content.Server.GameObjects.Components.Weapon.Ranged.Barrels
|
||||
{
|
||||
// There's still some of py01 and PJB's work left over, especially in underlying shooting logic,
|
||||
// it's just when I re-organised it changed me as the contributor
|
||||
#pragma warning disable 649
|
||||
[Dependency] private IGameTiming _gameTiming;
|
||||
[Dependency] private IRobustRandom _robustRandom;
|
||||
#pragma warning restore 649
|
||||
[Dependency] private readonly IGameTiming _gameTiming = default!;
|
||||
[Dependency] private readonly IRobustRandom _robustRandom = default!;
|
||||
|
||||
public override FireRateSelector FireRateSelector => _fireRateSelector;
|
||||
private FireRateSelector _fireRateSelector;
|
||||
|
||||
@@ -36,11 +36,9 @@ namespace Content.Server.GameObjects.EntitySystems.AI.Pathfinding.Accessible
|
||||
* There's probably a better data structure to use though you'd need to benchmark multiple ones to compare,
|
||||
* at the very least on the memory side it could definitely be better.
|
||||
*/
|
||||
[Dependency] private readonly IMapManager _mapManager = default!;
|
||||
[Dependency] private readonly IGameTiming _gameTiming = default!;
|
||||
|
||||
#pragma warning disable 649
|
||||
[Dependency] private IMapManager _mapmanager;
|
||||
[Dependency] private IGameTiming _gameTiming;
|
||||
#pragma warning restore 649
|
||||
private PathfindingSystem _pathfindingSystem;
|
||||
|
||||
/// <summary>
|
||||
@@ -87,7 +85,7 @@ namespace Content.Server.GameObjects.EntitySystems.AI.Pathfinding.Accessible
|
||||
#if DEBUG
|
||||
SubscribeLocalEvent<PlayerAttachSystemMessage>(SendDebugMessage);
|
||||
#endif
|
||||
_mapmanager.OnGridRemoved += GridRemoved;
|
||||
_mapManager.OnGridRemoved += GridRemoved;
|
||||
}
|
||||
|
||||
private void GridRemoved(GridId gridId)
|
||||
@@ -161,7 +159,7 @@ namespace Content.Server.GameObjects.EntitySystems.AI.Pathfinding.Accessible
|
||||
/// <returns></returns>
|
||||
public bool CanAccess(IEntity entity, IEntity target, float range = 0.0f)
|
||||
{
|
||||
var targetTile = _mapmanager.GetGrid(target.Transform.GridID).GetTileRef(target.Transform.GridPosition);
|
||||
var targetTile = _mapManager.GetGrid(target.Transform.GridID).GetTileRef(target.Transform.GridPosition);
|
||||
var targetNode = _pathfindingSystem.GetNode(targetTile);
|
||||
|
||||
var collisionMask = 0;
|
||||
@@ -199,7 +197,7 @@ namespace Content.Server.GameObjects.EntitySystems.AI.Pathfinding.Accessible
|
||||
return false;
|
||||
}
|
||||
|
||||
var entityTile = _mapmanager.GetGrid(entity.Transform.GridID).GetTileRef(entity.Transform.GridPosition);
|
||||
var entityTile = _mapManager.GetGrid(entity.Transform.GridID).GetTileRef(entity.Transform.GridPosition);
|
||||
var entityNode = _pathfindingSystem.GetNode(entityTile);
|
||||
var entityRegion = GetRegion(entityNode);
|
||||
var targetRegion = GetRegion(targetNode);
|
||||
@@ -409,7 +407,7 @@ namespace Content.Server.GameObjects.EntitySystems.AI.Pathfinding.Accessible
|
||||
/// <returns></returns>
|
||||
public PathfindingRegion GetRegion(IEntity entity)
|
||||
{
|
||||
var entityTile = _mapmanager.GetGrid(entity.Transform.GridID).GetTileRef(entity.Transform.GridPosition);
|
||||
var entityTile = _mapManager.GetGrid(entity.Transform.GridID).GetTileRef(entity.Transform.GridPosition);
|
||||
var entityNode = _pathfindingSystem.GetNode(entityTile);
|
||||
return GetRegion(entityNode);
|
||||
}
|
||||
@@ -686,7 +684,7 @@ namespace Content.Server.GameObjects.EntitySystems.AI.Pathfinding.Accessible
|
||||
|
||||
private void SendRegionsDebugMessage(GridId gridId)
|
||||
{
|
||||
var grid = _mapmanager.GetGrid(gridId);
|
||||
var grid = _mapManager.GetGrid(gridId);
|
||||
// Chunk / Regions / Nodes
|
||||
var debugResult = new Dictionary<int, Dictionary<int, List<Vector2>>>();
|
||||
var chunkIdx = 0;
|
||||
@@ -709,7 +707,7 @@ namespace Content.Server.GameObjects.EntitySystems.AI.Pathfinding.Accessible
|
||||
|
||||
foreach (var node in region.Nodes)
|
||||
{
|
||||
var nodeVector = grid.GridTileToLocal(node.TileRef.GridIndices).ToMapPos(_mapmanager);
|
||||
var nodeVector = grid.GridTileToLocal(node.TileRef.GridIndices).ToMapPos(_mapManager);
|
||||
debugRegionNodes.Add(nodeVector);
|
||||
}
|
||||
|
||||
@@ -729,7 +727,7 @@ namespace Content.Server.GameObjects.EntitySystems.AI.Pathfinding.Accessible
|
||||
/// <param name="cached"></param>
|
||||
private void SendRegionCacheMessage(GridId gridId, IEnumerable<PathfindingRegion> regions, bool cached)
|
||||
{
|
||||
var grid = _mapmanager.GetGrid(gridId);
|
||||
var grid = _mapManager.GetGrid(gridId);
|
||||
var debugResult = new Dictionary<int, List<Vector2>>();
|
||||
|
||||
foreach (var region in regions)
|
||||
@@ -738,7 +736,7 @@ namespace Content.Server.GameObjects.EntitySystems.AI.Pathfinding.Accessible
|
||||
|
||||
foreach (var node in region.Nodes)
|
||||
{
|
||||
var nodeVector = grid.GridTileToLocal(node.TileRef.GridIndices).ToMapPos(_mapmanager);
|
||||
var nodeVector = grid.GridTileToLocal(node.TileRef.GridIndices).ToMapPos(_mapManager);
|
||||
|
||||
debugResult[_runningCacheIdx].Add(nodeVector);
|
||||
}
|
||||
|
||||
@@ -25,11 +25,9 @@ namespace Content.Server.GameObjects.EntitySystems.AI.Steering
|
||||
public sealed class AiSteeringSystem : EntitySystem
|
||||
{
|
||||
// http://www.red3d.com/cwr/papers/1999/gdc99steer.html for a steering overview
|
||||
[Dependency] private IMapManager _mapManager = default!;
|
||||
[Dependency] private IPauseManager _pauseManager = default!;
|
||||
|
||||
#pragma warning disable 649
|
||||
[Dependency] private IMapManager _mapManager;
|
||||
[Dependency] private IPauseManager _pauseManager;
|
||||
#pragma warning restore 649
|
||||
private PathfindingSystem _pathfindingSystem;
|
||||
|
||||
/// <summary>
|
||||
@@ -255,7 +253,7 @@ namespace Content.Server.GameObjects.EntitySystems.AI.Steering
|
||||
}
|
||||
|
||||
var entitySteering = steeringRequest as EntityTargetSteeringRequest;
|
||||
|
||||
|
||||
if (entitySteering != null && entitySteering.Target.Deleted)
|
||||
{
|
||||
controller.VelocityDir = Vector2.Zero;
|
||||
@@ -279,10 +277,10 @@ namespace Content.Server.GameObjects.EntitySystems.AI.Steering
|
||||
// Check if we have arrived
|
||||
var targetDistance = (entity.Transform.MapPosition.Position - steeringRequest.TargetMap.Position).Length;
|
||||
steeringRequest.TimeUntilInteractionCheck -= frameTime;
|
||||
|
||||
|
||||
if (targetDistance <= steeringRequest.ArrivalDistance && steeringRequest.TimeUntilInteractionCheck <= 0.0f)
|
||||
{
|
||||
if (!steeringRequest.RequiresInRangeUnobstructed ||
|
||||
if (!steeringRequest.RequiresInRangeUnobstructed ||
|
||||
InteractionChecks.InRangeUnobstructed(entity, steeringRequest.TargetMap, steeringRequest.ArrivalDistance, ignoredEnt: entity))
|
||||
{
|
||||
// TODO: Need cruder LOS checks for ranged weaps
|
||||
@@ -353,7 +351,7 @@ namespace Content.Server.GameObjects.EntitySystems.AI.Steering
|
||||
if (entitySteering != null)
|
||||
{
|
||||
// Check if target's moved too far
|
||||
if (_entityTargetPosition.TryGetValue(entity, out var targetGrid) &&
|
||||
if (_entityTargetPosition.TryGetValue(entity, out var targetGrid) &&
|
||||
(entitySteering.TargetGrid.Position - targetGrid.Position).Length >= entitySteering.TargetMaxMove)
|
||||
{
|
||||
// We'll just repath and keep following the existing one until we get a new one
|
||||
|
||||
@@ -11,9 +11,7 @@ namespace Content.Server.GameObjects.EntitySystems.Click
|
||||
{
|
||||
public class ExamineSystem : ExamineSystemShared
|
||||
{
|
||||
#pragma warning disable 649
|
||||
[Dependency] private IEntityManager _entityManager;
|
||||
#pragma warning restore 649
|
||||
[Dependency] private IEntityManager _entityManager = default!;
|
||||
|
||||
private static readonly FormattedMessage _entityNotFoundMessage;
|
||||
|
||||
|
||||
@@ -39,9 +39,7 @@ namespace Content.Server.GameObjects.EntitySystems.Click
|
||||
[UsedImplicitly]
|
||||
public sealed class InteractionSystem : SharedInteractionSystem
|
||||
{
|
||||
#pragma warning disable 649
|
||||
[Dependency] private readonly IMapManager _mapManager;
|
||||
#pragma warning restore 649
|
||||
[Dependency] private readonly IMapManager _mapManager = default!;
|
||||
|
||||
public override void Initialize()
|
||||
{
|
||||
|
||||
@@ -36,10 +36,8 @@ namespace Content.Server.GameObjects.EntitySystems
|
||||
[UsedImplicitly]
|
||||
internal class ConstructionSystem : SharedConstructionSystem
|
||||
{
|
||||
#pragma warning disable 649
|
||||
[Dependency] private readonly IPrototypeManager _prototypeManager;
|
||||
[Dependency] private readonly IMapManager _mapManager;
|
||||
#pragma warning restore 649
|
||||
[Dependency] private readonly IPrototypeManager _prototypeManager = default!;
|
||||
[Dependency] private readonly IMapManager _mapManager = default!;
|
||||
|
||||
private readonly Dictionary<string, ConstructionPrototype> _craftRecipes = new Dictionary<string, ConstructionPrototype>();
|
||||
|
||||
|
||||
@@ -27,10 +27,8 @@ namespace Content.Server.GameObjects.EntitySystems
|
||||
[UsedImplicitly]
|
||||
internal sealed class HandsSystem : EntitySystem
|
||||
{
|
||||
#pragma warning disable 649
|
||||
[Dependency] private readonly IMapManager _mapManager;
|
||||
[Dependency] private readonly IServerNotifyManager _notifyManager;
|
||||
#pragma warning restore 649
|
||||
[Dependency] private readonly IMapManager _mapManager = default!;
|
||||
[Dependency] private readonly IServerNotifyManager _notifyManager = default!;
|
||||
|
||||
private const float ThrowForce = 1.5f; // Throwing force of mobs in Newtons
|
||||
|
||||
|
||||
@@ -6,9 +6,7 @@ namespace Content.Server.GameObjects.EntitySystems
|
||||
{
|
||||
public class NodeGroupSystem : EntitySystem
|
||||
{
|
||||
#pragma warning disable 649
|
||||
[Dependency] private readonly INodeGroupManager _groupManager;
|
||||
#pragma warning restore 649
|
||||
[Dependency] private readonly INodeGroupManager _groupManager = default!;
|
||||
|
||||
public override void Update(float frameTime)
|
||||
{
|
||||
|
||||
@@ -6,9 +6,7 @@ namespace Content.Server.GameObjects.EntitySystems
|
||||
{
|
||||
public class PowerNetSystem : EntitySystem
|
||||
{
|
||||
#pragma warning disable 649
|
||||
[Dependency] private readonly IPowerNetManager _powerNetManager;
|
||||
#pragma warning restore 649
|
||||
[Dependency] private readonly IPowerNetManager _powerNetManager = default!;
|
||||
|
||||
public override void Update(float frameTime)
|
||||
{
|
||||
|
||||
@@ -10,10 +10,8 @@ namespace Content.Server.GameObjects.EntitySystems
|
||||
{
|
||||
public class RoundEndSystem : EntitySystem
|
||||
{
|
||||
#pragma warning disable 649
|
||||
[Dependency] private IGameTicker _gameTicker;
|
||||
[Dependency] private IGameTiming _gameTiming;
|
||||
#pragma warning restore 649
|
||||
[Dependency] private readonly IGameTicker _gameTicker = default!;
|
||||
[Dependency] private readonly IGameTiming _gameTiming = default!;
|
||||
|
||||
private CancellationTokenSource _roundEndCancellationTokenSource = new CancellationTokenSource();
|
||||
public bool IsRoundEndCountdownStarted { get; private set; }
|
||||
|
||||
@@ -21,11 +21,9 @@ namespace Content.Server.GameObjects.EntitySystems.StationEvents
|
||||
// Somewhat based off of TG's implementation of events
|
||||
public sealed class StationEventSystem : EntitySystem
|
||||
{
|
||||
#pragma warning disable 649
|
||||
[Dependency] private readonly IServerNetManager _netManager;
|
||||
[Dependency] private readonly IPlayerManager _playerManager;
|
||||
[Dependency] private readonly IGameTicker _gameTicker;
|
||||
#pragma warning restore 649
|
||||
[Dependency] private readonly IServerNetManager _netManager = default!;
|
||||
[Dependency] private readonly IPlayerManager _playerManager = default!;
|
||||
[Dependency] private readonly IGameTicker _gameTicker = default!;
|
||||
|
||||
public StationEvent CurrentEvent { get; private set; }
|
||||
public IReadOnlyCollection<StationEvent> StationEvents => _stationEvents;
|
||||
@@ -33,7 +31,7 @@ namespace Content.Server.GameObjects.EntitySystems.StationEvents
|
||||
private List<StationEvent> _stationEvents = new List<StationEvent>();
|
||||
|
||||
private const float MinimumTimeUntilFirstEvent = 600;
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// How long until the next check for an event runs
|
||||
/// </summary>
|
||||
@@ -77,7 +75,7 @@ namespace Content.Server.GameObjects.EntitySystems.StationEvents
|
||||
|
||||
return result.ToString();
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Admins can forcibly run events by passing in the Name
|
||||
/// </summary>
|
||||
@@ -88,14 +86,14 @@ namespace Content.Server.GameObjects.EntitySystems.StationEvents
|
||||
// Could use a dictionary but it's such a minor thing, eh.
|
||||
// Wasn't sure on whether to localize this given it's a command
|
||||
var upperName = name.ToUpperInvariant();
|
||||
|
||||
|
||||
foreach (var stationEvent in _stationEvents)
|
||||
{
|
||||
if (stationEvent.Name.ToUpperInvariant() != upperName)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
|
||||
CurrentEvent?.Shutdown();
|
||||
CurrentEvent = stationEvent;
|
||||
stationEvent.Startup();
|
||||
@@ -114,12 +112,12 @@ namespace Content.Server.GameObjects.EntitySystems.StationEvents
|
||||
{
|
||||
var availableEvents = AvailableEvents(true);
|
||||
var randomEvent = FindEvent(availableEvents);
|
||||
|
||||
|
||||
if (randomEvent == null)
|
||||
{
|
||||
return Loc.GetString("No valid events available");
|
||||
}
|
||||
|
||||
|
||||
CurrentEvent?.Shutdown();
|
||||
CurrentEvent = randomEvent;
|
||||
CurrentEvent.Startup();
|
||||
@@ -134,7 +132,7 @@ namespace Content.Server.GameObjects.EntitySystems.StationEvents
|
||||
public string StopEvent()
|
||||
{
|
||||
string resultText;
|
||||
|
||||
|
||||
if (CurrentEvent == null)
|
||||
{
|
||||
resultText = Loc.GetString("No event running currently");
|
||||
@@ -145,11 +143,11 @@ namespace Content.Server.GameObjects.EntitySystems.StationEvents
|
||||
CurrentEvent.Shutdown();
|
||||
CurrentEvent = null;
|
||||
}
|
||||
|
||||
|
||||
ResetTimer();
|
||||
return resultText;
|
||||
}
|
||||
|
||||
|
||||
public override void Initialize()
|
||||
{
|
||||
base.Initialize();
|
||||
@@ -212,7 +210,7 @@ namespace Content.Server.GameObjects.EntitySystems.StationEvents
|
||||
if (CurrentEvent != null)
|
||||
{
|
||||
CurrentEvent.Update(frameTime);
|
||||
|
||||
|
||||
// Shutdown the event and set the timer for the next event
|
||||
if (!CurrentEvent.Running)
|
||||
{
|
||||
@@ -262,14 +260,14 @@ namespace Content.Server.GameObjects.EntitySystems.StationEvents
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
|
||||
var sumOfWeights = 0;
|
||||
|
||||
foreach (var stationEvent in availableEvents)
|
||||
{
|
||||
sumOfWeights += (int) stationEvent.Weight;
|
||||
}
|
||||
|
||||
|
||||
var robustRandom = IoCManager.Resolve<IRobustRandom>();
|
||||
sumOfWeights = robustRandom.Next(sumOfWeights);
|
||||
|
||||
@@ -295,7 +293,7 @@ namespace Content.Server.GameObjects.EntitySystems.StationEvents
|
||||
{
|
||||
TimeSpan currentTime;
|
||||
var playerCount = IoCManager.Resolve<IPlayerManager>().PlayerCount;
|
||||
|
||||
|
||||
// playerCount does a lock so we'll just keep the variable here
|
||||
if (!ignoreEarliestStart)
|
||||
{
|
||||
@@ -346,7 +344,7 @@ namespace Content.Server.GameObjects.EntitySystems.StationEvents
|
||||
CurrentEvent.Shutdown();
|
||||
CurrentEvent = null;
|
||||
}
|
||||
|
||||
|
||||
foreach (var stationEvent in _stationEvents)
|
||||
{
|
||||
stationEvent.Occurrences = 0;
|
||||
|
||||
@@ -14,9 +14,7 @@ namespace Content.Server.GameObjects.EntitySystems
|
||||
{
|
||||
public class VerbSystem : EntitySystem
|
||||
{
|
||||
#pragma warning disable 649
|
||||
[Dependency] private readonly IEntityManager _entityManager;
|
||||
#pragma warning restore 649
|
||||
[Dependency] private readonly IEntityManager _entityManager = default!;
|
||||
|
||||
public override void Initialize()
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user