Files
crystall-punk-14/Content.Server/Cargo/Components/StationCargoOrderDatabaseComponent.cs

57 lines
1.8 KiB
C#
Raw Permalink Normal View History

using Content.Server.Station.Components;
2022-06-23 14:36:47 +10:00
using Content.Shared.Cargo;
using Content.Shared.Cargo.Components;
2022-07-15 14:11:41 +10:00
using Content.Shared.Cargo.Prototypes;
using Robust.Shared.Prototypes;
2022-07-15 14:11:41 +10:00
using Robust.Shared.Serialization.TypeSerializers.Implementations.Custom.Prototype;
2022-06-23 14:36:47 +10:00
namespace Content.Server.Cargo.Components;
/// <summary>
/// Stores all of cargo orders for a particular station.
/// </summary>
[RegisterComponent]
public sealed partial class StationCargoOrderDatabaseComponent : Component
2022-06-23 14:36:47 +10:00
{
/// <summary>
/// Maximum amount of orders a station is allowed, approved or not.
/// </summary>
[ViewVariables(VVAccess.ReadWrite), DataField("capacity")]
public int Capacity = 20;
[ViewVariables(VVAccess.ReadWrite), DataField("orders")]
public List<CargoOrderData> Orders = new();
2022-06-23 14:36:47 +10:00
/// <summary>
/// Used to determine unique order IDs
2022-06-23 14:36:47 +10:00
/// </summary>
public int NumOrdersCreated;
2022-06-23 14:36:47 +10:00
2023-05-31 11:13:02 +10:00
// TODO: Can probably dump this
2022-06-23 14:36:47 +10:00
/// <summary>
/// The cargo shuttle assigned to this station.
/// </summary>
[DataField("shuttle")]
2022-06-23 14:36:47 +10:00
public EntityUid? Shuttle;
/// <summary>
/// The paper-type prototype to spawn with the order information.
/// </summary>
[DataField]
public EntProtoId PrinterOutput = "PaperCargoInvoice";
2022-06-23 14:36:47 +10:00
}
/// <summary>
/// Event broadcast before a cargo order is fulfilled, allowing alternate systems to fulfill the order.
/// </summary>
[ByRefEvent]
public record struct FulfillCargoOrderEvent(Entity<StationDataComponent> Station, CargoOrderData Order, Entity<CargoOrderConsoleComponent> OrderConsole)
{
public Entity<CargoOrderConsoleComponent> OrderConsole = OrderConsole;
public Entity<StationDataComponent> Station = Station;
public CargoOrderData Order = Order;
public EntityUid? FulfillmentEntity;
public bool Handled = false;
}