using Content.Shared.Mind;
using Content.Shared.Store;
using Content.Server._DV.Objectives.Systems;
namespace Content.Server._DV.Store.Conditions;
///
/// Requires that the buyer have an objective that unlocks this listing.
///
public sealed partial class ObjectiveUnlockCondition : ListingCondition
{
public override bool Condition(ListingConditionArgs args)
{
var ent = args.EntityManager;
if (!ent.TryGetComponent(args.Buyer, out var mind))
return false;
var unlocker = ent.System();
return unlocker.IsUnlocked(mind, args.Listing.ID);
}
}