using Content.Shared.Whitelist; using Robust.Shared.Analyzers; using Robust.Shared.Audio; using Robust.Shared.GameObjects; using Robust.Shared.GameStates; using Robust.Shared.Prototypes; using Robust.Shared.Serialization; namespace Content.Shared.SmartFridge; [RegisterComponent, NetworkedComponent, AutoGenerateComponentState(true)] [Access(typeof(SharedSmartFridgeSystem))] public sealed partial class SmartFridgeComponent : Component { /// /// The container ID that this SmartFridge stores its inventory in /// [DataField] public string Container = "smart_fridge_inventory"; /// /// Whitelist for what entities can be inserted /// [DataField] public EntityWhitelist? Whitelist; /// /// Blacklist for what entities can be inserted /// [DataField] public EntityWhitelist? Blacklist; /// /// The sound played on inserting an item into the fridge /// [DataField] public SoundSpecifier? InsertSound = new SoundCollectionSpecifier("MachineInsert"); /// /// A list of entries to display in the UI /// [DataField, AutoNetworkedField] public List Entries = new(); /// /// A mapping of smart fridge entries to the actual contained contents /// [DataField, AutoNetworkedField] [Access(typeof(SharedSmartFridgeSystem), Other = AccessPermissions.ReadExecute)] public Dictionary> ContainedEntries = new(); /// /// The flavour text displayed at the bottom of the SmartFridge's UI /// [DataField] public LocId FlavorText = "smart-fridge-request-generic"; /// /// Sound that plays when ejecting an item /// [DataField] public SoundSpecifier SoundVend = new SoundCollectionSpecifier("VendingDispense") { Params = new AudioParams { Volume = -4f, Variation = 0.15f } }; /// /// Sound that plays when an item can't be ejected /// [DataField] public SoundSpecifier SoundDeny = new SoundCollectionSpecifier("VendingDeny"); } /// /// A single entry in the smart fridge UI. /// May contain multiple items of the same type. /// [Serializable, NetSerializable, DataRecord] public partial record struct SmartFridgeEntry { public string Name; public SmartFridgeEntry(string name) { Name = name; } } [Serializable, NetSerializable] public enum SmartFridgeUiKey : byte { Key, } /// /// Send by the client when trying to dispense an item inside the fridge. /// [Serializable, NetSerializable] public sealed class SmartFridgeDispenseItemMessage(SmartFridgeEntry entry) : BoundUserInterfaceMessage { public SmartFridgeEntry Entry = entry; } /// /// Send by the client when trying to remove an empty smart fridge entry from the list of items in the UI. /// [Serializable, NetSerializable] public sealed class SmartFridgeRemoveEntryMessage(SmartFridgeEntry entry) : BoundUserInterfaceMessage { public SmartFridgeEntry Entry = entry; }