Generalized Store System (#10201)

This commit is contained in:
Nemanja
2022-08-17 00:34:25 -04:00
committed by GitHub
parent 1b50928d50
commit 2152914acc
68 changed files with 2493 additions and 1568 deletions

View File

@@ -0,0 +1,20 @@
using Content.Shared.Store;
namespace Content.Server.Store.Conditions;
/// <summary>
/// Only allows a listing to be purchased a certain amount of times.
/// </summary>
public sealed class ListingLimitedStockCondition : ListingCondition
{
/// <summary>
/// The amount of times this listing can be purchased.
/// </summary>
[DataField("stock", required: true)]
public int Stock;
public override bool Condition(ListingConditionArgs args)
{
return args.Listing.PurchaseAmount < Stock;
}
}