using Content.Shared.Store; using Content.Shared.Whitelist; namespace Content.Server.Store.Conditions; /// /// Filters out an entry based on the components or tags on an entity. /// public sealed partial class BuyerWhitelistCondition : ListingCondition { /// /// A whitelist of tags or components. /// [DataField("whitelist")] public EntityWhitelist? Whitelist; /// /// A blacklist of tags or components. /// [DataField("blacklist")] public EntityWhitelist? Blacklist; public override bool Condition(ListingConditionArgs args) { var ent = args.EntityManager; if (Whitelist != null) { if (!Whitelist.IsValid(args.Buyer, ent)) return false; } if (Blacklist != null) { if (Blacklist.IsValid(args.Buyer, ent)) return false; } return true; } }