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

#pragma once

#include "InworldBasePlayerComponent.h"

#include "InworldSimplePlayerComponent.generated.h"

/**
 * Simple implementation of Inworld player component with player profile support.
 *
 * This component extends the base player functionality by adding player profile management,
 * which allows for personalized interactions and character behavior based on player data.
 * It overrides core messaging methods to integrate with the player profile system.
 *
 * Key Features:
 * - Player profile integration
 * - Enhanced text and audio messaging with profile context
 * - Spawnable in Blueprint editor
 * - Ready-to-use implementation for basic player interactions
 */
UCLASS(ClassGroup = (Inworld), BlueprintType, Blueprintable, Meta = (BlueprintSpawnableComponent))
class INWORLDCHARACTER_API UInworldSimplePlayerComponent : public UInworldBasePlayerComponent
{
	GENERATED_BODY()

public:
	/**
	 * Sends a message to the player's conversation target.
	 * @param Message The message to send.
	 */
	virtual void SendMessage(const FInworldDataHandle& Message) override;

protected:
	/**
	 * Called when audio is captured from the microphone.
	 * @param AudioCapture The audio capture instance
	 * @param AudioData The captured audio data
	 * @param VAD Voice Activity Detection state
	 */
	virtual void OnAudioCapture(const UInworldAudioCapture* AudioCapture, const FInworldData_Audio& AudioData, bool VAD) override;

public:
	/**
	 * Player profile data used to personalize interactions.
	 * Contains player-specific information that influences character behavior.
	 */
	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Inworld",
		Meta = (ToolTip =
					"Player profile data used to personalize interactions. Contains player-specific information that influences character behavior"))
	FInworldPlayerProfile PlayerProfile;
};
