75 lines
1.3 KiB
C++
Executable File
75 lines
1.3 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 "LevelLocation.h"
|
|
#include "PresidentAIController.generated.h"
|
|
|
|
/**
|
|
*
|
|
*/
|
|
UCLASS()
|
|
class PRESIDENTSBRIGADE_API APresidentAIController : public AAIController
|
|
{
|
|
GENERATED_BODY()
|
|
|
|
public:
|
|
APresidentAIController();
|
|
|
|
virtual void Tick(float delta) override;
|
|
|
|
protected:
|
|
virtual void BeginPlay() override;
|
|
virtual void OnMoveCompleted(FAIRequestID request_id, const FPathFollowingResult& result) override;
|
|
|
|
UPROPERTY(EditAnywhere, Category = "Movement")
|
|
UClass* marker_class;
|
|
|
|
UPROPERTY(EditAnywhere, Category = "Movement")
|
|
float wait_threshold;
|
|
private:
|
|
enum state_t : uint8 {
|
|
init,
|
|
idle,
|
|
moving,
|
|
waiting
|
|
};
|
|
|
|
/**
|
|
* Level location tracker.
|
|
*/
|
|
TUniquePtr<LevelLocation> level_location;
|
|
|
|
/**
|
|
* Random number stream.
|
|
*/
|
|
FRandomStream random;
|
|
|
|
/**
|
|
* Current state.
|
|
*/
|
|
state_t current_state = state_t::init;
|
|
|
|
/**
|
|
* Move completed.
|
|
*/
|
|
bool move_completed;
|
|
|
|
/**
|
|
* Starting location.
|
|
*/
|
|
FVector starting_location;
|
|
|
|
/**
|
|
* Target location.
|
|
*/
|
|
FVector target_location;
|
|
|
|
/**
|
|
* Time spent in waiting.
|
|
*/
|
|
float waiting_time;
|
|
};
|