/**
 * Copyright 2022-2025 Theai, Inc. dba Inworld AI
 */

#pragma once

#include "CoreMinimal.h"
#include "Graph/InworldGraphRuntimeData.h"
#include "InworldCharacterTypes.h"

#include "InworldGraphRuntimeData_KnowledgeFilter.generated.h"

/**
 * @class UInworldGraphRuntimeData_KnowledgeFilter
 * @brief Runtime data component for managing character knowledge filtering.
 *
 * This runtime data component stores and manages knowledge filter settings that
 * constrain the amount and scope of knowledge available to a character during
 * conversations. Knowledge filters can be used to limit responses based on
 * character awareness, permissions, or narrative requirements.
 */
UCLASS(BlueprintType, meta = (DisplayName = "Knowledge Filter Data"))
class INWORLDCHARACTER_API UInworldGraphRuntimeData_KnowledgeFilter : public UInworldGraphRuntimeData
{
	GENERATED_BODY()

public:
	/**
	 * @brief Default constructor for the knowledge filter runtime data.
	 */
	UInworldGraphRuntimeData_KnowledgeFilter();

	/**
	 * @brief Retrieves the knowledge filter as a data handle for graph processing.
	 * @return Data handle containing the knowledge filter configuration.
	 */
	virtual FInworldDataHandle GetData() override;

	/**
	 * @brief Updates the knowledge filter configuration.
	 * @param NewKnowledgeFilter The new knowledge filter settings to apply.
	 */
	UFUNCTION(BlueprintCallable, Category = "Inworld|Graph")
	void Set(UPARAM(Ref) const FInworldKnowledgeFilter& NewKnowledgeFilter)
	{
		KnowledgeFilter = NewKnowledgeFilter;
	}

	/**
	 * @brief Retrieves the current knowledge filter configuration.
	 * @return Const reference to the knowledge filter settings.
	 */
	UFUNCTION(BlueprintCallable, Category = "Inworld|Graph")
	const FInworldKnowledgeFilter& GetKnowledgeFilter() const
	{
		return KnowledgeFilter;
	}

protected:
	/** Knowledge filter configuration constraining character's knowledge access */
	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Knowledge Filter Runtime Data",
		meta = (ToolTip = "Knowledge filters are used to constrain the amount of knowledge a character has",
			ExposeOnSpawn = "true"))
	FInworldKnowledgeFilter KnowledgeFilter;
};
