89 lines
2.1 KiB
C++
89 lines
2.1 KiB
C++
#pragma once
|
|
|
|
#include "CoreMinimal.h"
|
|
#include "GameFramework/PlayerController.h"
|
|
|
|
#include "AdventurePlayerController.generated.h"
|
|
|
|
class AAdventureMap;
|
|
class AHexTile;
|
|
class AAdventureCameraPawn;
|
|
class AAdventureCharacter;
|
|
class AMapObject;
|
|
class AMovementArrow;
|
|
|
|
/**
|
|
*
|
|
*/
|
|
UCLASS()
|
|
class FRAY_API AAdventurePlayerController : public APlayerController
|
|
{
|
|
GENERATED_BODY()
|
|
|
|
public:
|
|
AAdventurePlayerController();
|
|
|
|
// General
|
|
UPROPERTY()
|
|
UWorld* World;
|
|
UPROPERTY(VisibleAnywhere, BlueprintReadWrite)
|
|
AAdventureMap* MapRef;
|
|
UPROPERTY(VisibleAnywhere, BlueprintReadWrite)
|
|
AAdventureCameraPawn* CamRef;
|
|
UPROPERTY(VisibleAnywhere, BlueprintReadWrite)
|
|
AHexTile* SpawnHex;
|
|
|
|
|
|
UPROPERTY(VisibleAnywhere, BlueprintReadWrite, Category = "Runtime")
|
|
AHexTile* CurrentHex;
|
|
|
|
|
|
UPROPERTY(BlueprintReadWrite, EditAnywhere)
|
|
AHexTile* HoveredHex;
|
|
UFUNCTION(BlueprintCallable)
|
|
void LeftClick();
|
|
|
|
|
|
UPROPERTY(BlueprintReadOnly, EditDefaultsOnly)
|
|
TSubclassOf<AMovementArrow> MoveArrowClass;
|
|
UFUNCTION(BlueprintCallable)
|
|
void MarkPath(TArray<AHexTile*> Path);
|
|
UPROPERTY(BlueprintReadWrite, VisibleAnywhere)
|
|
TArray<AMovementArrow*> PathArrows;
|
|
UFUNCTION(BlueprintCallable)
|
|
void ClearPath();
|
|
|
|
|
|
UPROPERTY(EditAnywhere, BlueprintReadWrite)
|
|
int32 VisionRadius = 6;
|
|
UFUNCTION(BlueprintCallable)
|
|
TSet<AHexTile*> Vision(int32 Radius);
|
|
UPROPERTY(EditAnywhere, BlueprintReadWrite)
|
|
TSet<AHexTile*> ExploredHexes;
|
|
|
|
protected:
|
|
virtual void BeginPlay() override;
|
|
virtual void SetupInputComponent() override;
|
|
|
|
public:
|
|
|
|
// Object Placement
|
|
UPROPERTY(BlueprintReadWrite, VisibleAnywhere)
|
|
bool bInPlacementMode;
|
|
UPROPERTY(BlueprintReadWrite, EditAnywhere)
|
|
TSubclassOf<AMapObject> PlaceObjClass;
|
|
UPROPERTY(BlueprintReadWrite, VisibleAnywhere)
|
|
AMapObject* PlaceObj;
|
|
UFUNCTION(BlueprintCallable)
|
|
void EnablePlacing();
|
|
UFUNCTION(BlueprintCallable)
|
|
void DisablePlacing();
|
|
UFUNCTION(BlueprintCallable)
|
|
void FitOnGrid(AMapObject* MapObject);
|
|
UFUNCTION()
|
|
void PlaceObject(TSubclassOf<AMapObject> MapObjClass, AHexTile* OnHex);
|
|
|
|
// Called every frame
|
|
virtual void Tick(float DeltaTime) override;
|
|
};
|