Cleaner BoundUserInterfaces (#17736)
This commit is contained in:
@@ -1,28 +1,17 @@
|
||||
using System.Linq;
|
||||
using Content.Server.Anomaly;
|
||||
using Content.Server.Cargo.Components;
|
||||
using Content.Server.Cargo.Systems;
|
||||
using Content.Server.GameTicking;
|
||||
using Content.Server.GameTicking.Rules.Components;
|
||||
using Content.Server.Station.Components;
|
||||
using Content.Server.Station.Systems;
|
||||
using Content.Server.StationEvents.Components;
|
||||
using Content.Shared.Access.Components;
|
||||
using Content.Shared.Administration.Logs;
|
||||
using Content.Shared.Cargo;
|
||||
using Content.Shared.Cargo.Prototypes;
|
||||
using Content.Shared.Database;
|
||||
using Robust.Shared.Prototypes;
|
||||
using Robust.Shared.Random;
|
||||
using Robust.Shared.Utility;
|
||||
|
||||
namespace Content.Server.StationEvents.Events;
|
||||
|
||||
public sealed class CargoGiftsRule : StationEventSystem<CargoGiftsRuleComponent>
|
||||
{
|
||||
[Dependency] private readonly CargoSystem _cargoSystem = default!;
|
||||
[Dependency] private readonly StationSystem _stationSystem = default!;
|
||||
[Dependency] private readonly ISharedAdminLogManager _adminLogger = default!;
|
||||
[Dependency] private readonly IPrototypeManager _prototypeManager = default!;
|
||||
[Dependency] private readonly GameTicker _ticker = default!;
|
||||
|
||||
@@ -61,7 +50,7 @@ public sealed class CargoGiftsRule : StationEventSystem<CargoGiftsRuleComponent>
|
||||
}
|
||||
|
||||
// Add some presents
|
||||
int outstanding = _cargoSystem.GetOutstandingOrderCount(cargoDb);
|
||||
var outstanding = CargoSystem.GetOutstandingOrderCount(cargoDb);
|
||||
while (outstanding < cargoDb.Capacity - component.OrderSpaceToLeave && component.Gifts.Count > 0)
|
||||
{
|
||||
// I wish there was a nice way to pop this
|
||||
@@ -71,13 +60,15 @@ public sealed class CargoGiftsRule : StationEventSystem<CargoGiftsRuleComponent>
|
||||
var product = _prototypeManager.Index<CargoProductPrototype>(productId);
|
||||
|
||||
if (!_cargoSystem.AddAndApproveOrder(
|
||||
cargoDb,
|
||||
station!.Value,
|
||||
product.Product,
|
||||
product.PointCost,
|
||||
qty,
|
||||
Loc.GetString(component.Sender),
|
||||
Loc.GetString(component.Description),
|
||||
Loc.GetString(component.Dest)))
|
||||
Loc.GetString(component.Dest),
|
||||
cargoDb
|
||||
))
|
||||
{
|
||||
break;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user