Files
Delta-v/Content.Server/Store/Conditions/BuyerWhitelistCondition.cs
T
slarticodefast 23c832b185 Remove blacklist methods in EntityWhitelistSystem (#40932)
* replace blacklist methods

* VS is trolling me
2026-01-26 19:25:30 +01:00

35 lines
944 B
C#

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