CatStation/Content.Shared/VendingMachines/VendingMachineInventoryEntry.cs
AndrewFenriz e934829cb3
VendingMachine refactor (systems. UI, components) (#44896)
* 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
2026-08-01 15:44:49 +00:00

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;
}