// © 2025 Naked People Team. All Rights Reserved.

#pragma once

#include "CoreMinimal.h"
#include "GameplayTagContainer.h"
#include "NakedDesire/Commissions/CommissionConstraint.h"
#include "LocationConstraint.generated.h"

class ULocationData;
class ULocationSubsystem;

// Holds while the player occupies a location matching (or nesting under) RequiredLocation.
UCLASS(EditInlineNew, DisplayName = "While At Location")
class NAKEDDESIRE_API ULocationConstraint : public UCommissionConstraint
{
	GENERATED_BODY()

public:
	virtual bool IsMet() const override;
	virtual FText GetDescription() const override;

protected:
	virtual void OnActivate() override;
	virtual void OnDeactivate() override;

private:
	UPROPERTY(EditDefaultsOnly)
	FGameplayTag RequiredLocation;

	UFUNCTION()
	void HandleLocationChanged(ULocationData* Location);

	ULocationSubsystem* GetLocations() const;
};