// Fill out your copyright notice in the Description page of Project Settings. #pragma once #include "CoreMinimal.h" #include "GameFramework/Character.h" #include "LMEnemy.generated.h" UENUM(BlueprintType) enum class EEnemyState : uint8 { EES_Chasing UMETA(DisplayName = "Chasing"), EES_Attacking UMETA(DisplayName = "Attacking") }; UCLASS() class LEGUMEMIX_API ALMEnemy : public ACharacter { GENERATED_BODY() public: ALMEnemy(); virtual void Tick(float DeltaTime) override; virtual void SetupPlayerInputComponent(class UInputComponent* PlayerInputComponent) override; protected: virtual void BeginPlay() override; UPROPERTY(EditAnywhere, BlueprintReadWrite, meta = (AllowPrivateAccess = "true"), Category = "Legumix") EEnemyState EnemyState; UPROPERTY(EditAnywhere, BlueprintReadWrite, meta = (AllowPrivateAccess = "true"), Category = "Legumix") double AttackingRadius; /** * Returns the distance between the enemy and a target. * @param TargetedActor * @returns the distance */ UFUNCTION(BlueprintCallable, Category="Legumix", meta=(ReturnDisplayName="Distance", DefaultToSelf="TargetedActor")) double GetDistanceToTarget(const AActor* TargetedActor); /** * Returns the distance between the enemy and a target. * @param TargetedPawn * @returns */ UFUNCTION(BlueprintCallable, Category="Legumix", meta=(DefaultToSelf="TargetedPawn")) virtual void Attack(const APawn* TargetedPawn); };