presidents-brigade/Source/PresidentsBrigade/EnemyAIController.h
2022-11-14 22:28:08 -08:00

71 lines
1.2 KiB
C++
Executable File

// Fill out your copyright notice in the Description page of Project Settings.
#pragma once
#include "CoreMinimal.h"
#include "AIController.h"
#include "BasePawn.h"
#include "EnemyAIController.generated.h"
/**
*
*/
UCLASS()
class PRESIDENTSBRIGADE_API AEnemyAIController : public AAIController
{
GENERATED_BODY()
public:
virtual void Tick(float delta_time) override;
protected:
virtual void OnMoveCompleted(FAIRequestID request_id, const FPathFollowingResult& result) override;
/**
* President class to find in level.
*/
UPROPERTY(EditAnywhere, Category = "Enemy")
TSubclassOf<ABasePawn> president_class;
UPROPERTY(EditAnywhere, Category = "Movement")
float wait_threshold;
UPROPERTY(EditAnywhere, Category = "Movement")
float overshoot_multiplier;
private:
/**
* State.
*/
enum state_t : uint8
{
init,
wait,
target,
moving,
dead
};
ABasePawn* get_president() const;
/**
* Current state.
*/
state_t current_state;
/**
* President that this enemy is targeting.
*/
ABasePawn* president;
/**
* True when last submitted move has completed.
*/
bool move_completed;
/**
* Time spent in waiting.
*/
float waiting_time;
};