mirror of
https://github.com/space-syndicate/space-station-14.git
synced 2026-10-09 10:21:18 +03:00
* better * VendingMachineComponent upd * move components * small fix * move some fields to VendingMachineEjectComponent * move some fields to VendingMachineVisualsComponent * fix * move some fields to VendingMachineDispenseOnHitComponent * move NextEmpEject to VendingMachineEjectComponent * upd * split shared system to eject * no more dummies for name * fix contraband inventory * small fix * and again * move VendingMachineDispenseOnHitComponent to server * upd dispense * upd * move visuals to client * fix * move canshoot to server * fix client * fix * upd * fix merge * fix * upd1 * afterhandlestate * upd * more docs and protoid * upd visuals * upd components * reorganize * Entity<> * revert AfterAutoHandleState
41 lines
1 KiB
C#
41 lines
1 KiB
C#
using Robust.Shared.Prototypes;
|
|
using Robust.Shared.Serialization;
|
|
|
|
namespace Content.Shared.VendingMachines;
|
|
|
|
[Serializable, NetSerializable, DataDefinition]
|
|
public sealed partial class VendingMachineInventoryEntry(InventoryType type, EntProtoId id, uint amount)
|
|
{
|
|
[DataField]
|
|
public InventoryType Type = type;
|
|
|
|
[DataField]
|
|
public EntProtoId ID = id;
|
|
|
|
[DataField]
|
|
public uint Amount = amount;
|
|
|
|
public VendingMachineInventoryEntry(VendingMachineInventoryEntry entry) : this(entry.Type, entry.ID, entry.Amount) { }
|
|
}
|
|
|
|
[Serializable, NetSerializable]
|
|
public enum InventoryType : byte
|
|
{
|
|
Regular,
|
|
Emagged,
|
|
Contraband
|
|
}
|
|
|
|
[Serializable, NetSerializable]
|
|
public sealed class VendingMachineComponentState : ComponentState
|
|
{
|
|
public Dictionary<string, VendingMachineInventoryEntry> Inventory = new();
|
|
|
|
public Dictionary<string, VendingMachineInventoryEntry> EmaggedInventory = new();
|
|
|
|
public Dictionary<string, VendingMachineInventoryEntry> ContrabandInventory = new();
|
|
|
|
public bool Contraband;
|
|
|
|
public bool Broken;
|
|
}
|