// Fill out your copyright notice in the Description page of Project Settings.

#pragma once

#include "CoreMinimal.h"
#include "EnemyCharacter.h"
#include "GameFramework/Actor.h"
#include "AIControlHub.generated.h"

UCLASS()
class ENDLESSVENDETTA_API AAIControlHub : public AActor
{
	GENERATED_BODY()

public:
	// Sets default values for this actor's properties
	AAIControlHub();

	DECLARE_EVENT_OneParam(AAIControlHub, FAlertLevelEvent, int);
	FAlertLevelEvent AlertLevelEvent;
	DECLARE_EVENT_OneParam(AAIControlHub, FHuntPlayer, FVector);
	FHuntPlayer HuntPlayerEvent;

protected:
	// Called when the game starts or when spawned
	virtual void BeginPlay() override;

public:
	// Called every frame
	virtual void Tick(float DeltaTime) override;

	void IncreaseAlertLevel();
	void DecreaseAlertLevel();
	void SetAlertLevel(int NewAlertLevel);
	int GetAlertLevel() const;
	void OnAlertLevelChanged();
	void SetPlayerLastKnownLocation(FVector Location = FVector(0, 0, 0));
	void RemoveEnemyActor(AEnemyCharacter* EnemyActor);

private:
	int AlertLevel = 0;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "AI", meta = (AllowPrivateAccess = "true"))
	TArray<AEnemyCharacter*> EnemyActors;

	UPROPERTY()
	FVector PlayerLastKnownLocation;
};
