using Content.Shared.FixedPoint; using Content.Shared.Store; using Robust.Shared.GameStates; using Robust.Shared.Prototypes; using Robust.Shared.Serialization; namespace Content.Shared.StoreDiscount.Components; /// /// Partner-component for adding discounts functionality to StoreSystem using StoreDiscountSystem. /// [RegisterComponent, NetworkedComponent] public sealed partial class StoreDiscountComponent : Component { /// /// Discounts for items in . /// [ViewVariables, DataField] public IReadOnlyList Discounts = Array.Empty(); } /// /// Container for listing item discount state. /// [Serializable, NetSerializable, DataDefinition] public sealed partial class StoreDiscountData { /// /// Id of listing item to be discounted. /// [DataField(required: true)] public ProtoId ListingId; /// /// Amount of discounted items. Each buy will decrement this counter. /// [DataField] public int Count; /// /// Discount category that provided this discount. /// [DataField(required: true)] public ProtoId DiscountCategory; /// /// Map of currencies to flat amount of discount. /// [DataField] public Dictionary, FixedPoint2> DiscountAmountByCurrency = new(); }