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

#pragma once

#include "CoreMinimal.h"
#include "NakedDesire/Commissions/CommissionConstraint.h"
#include "NakedDesire/Global/TimeOfDaySubsystem.h"
#include "DayPhaseConstraint.generated.h"

// Holds only during the chosen day phase (§10.1).
UCLASS(EditInlineNew, DisplayName = "During Day Phase")
class NAKEDDESIRE_API UDayPhaseConstraint : 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)
	EDayPhase RequiredPhase = EDayPhase::Night;

	UFUNCTION()
	void HandlePhaseChanged(EDayPhase NewPhase);

	UTimeOfDaySubsystem* GetTime() const;
};