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

#pragma once

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

#include "InworldGraphRuntimeData_CharacterProfile.generated.h"

/**
 * @class UInworldGraphRuntimeData_CharacterProfile
 * @brief Runtime data component for managing character personality and dialogue style.
 *
 * This runtime data component stores and provides access to a character's profile,
 * including personality traits, backstory, dialogue style, and behavioral characteristics.
 * The profile data is used by LLM nodes to generate contextually appropriate and
 * character-consistent responses during conversations.
 */
UCLASS(BlueprintType, meta = (DisplayName = "CharacterProfile Data"))
class INWORLDCHARACTER_API UInworldGraphRuntimeData_CharacterProfile : public UInworldGraphRuntimeData
{
	GENERATED_BODY()

public:
	/**
	 * @brief Default constructor for the character profile runtime data.
	 */
	UInworldGraphRuntimeData_CharacterProfile();

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

	/**
	 * @brief Retrieves the current character profile.
	 * @return Const reference to the character profile data.
	 */
	const FInworldCharacterProfile& Get() const
	{
		return CharacterProfile;
	}

	/**
	 * @brief Updates the character profile with new data.
	 * @param InCharacterProperties The new character profile data to store.
	 */
	UFUNCTION(BlueprintCallable, Category = "Inworld|Character Profile Runtime Data")
	void Set(const FInworldCharacterProfile& InCharacterProperties)
	{
		CharacterProfile = InCharacterProperties;
	}

protected:
	/** The character profile defining personality, backstory, and dialogue style */
	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Character Profile Runtime Data",
		meta = (ExposeOnSpawn = "true", ToolTip = "The character profile defining personality, backstory, and dialogue style"))
	FInworldCharacterProfile CharacterProfile;
};
