2022-01-11 11:07:17 +01:00
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#include "CoreMinimal.h"
|
|
|
|
#include "GameFramework/PlayerController.h"
|
|
|
|
|
|
|
|
#include "AdventurePlayerController.generated.h"
|
|
|
|
|
|
|
|
class AAdventureMap;
|
|
|
|
class AHexTile;
|
|
|
|
class AAdventureCameraPawn;
|
|
|
|
class AAdventureCharacter;
|
2022-01-24 21:26:06 +01:00
|
|
|
class AMapObject;
|
2022-06-01 20:25:33 +02:00
|
|
|
class AMovementArrow;
|
|
|
|
|
2022-01-11 11:07:17 +01:00
|
|
|
/**
|
|
|
|
*
|
|
|
|
*/
|
|
|
|
UCLASS()
|
|
|
|
class FRAY_API AAdventurePlayerController : public APlayerController
|
|
|
|
{
|
|
|
|
GENERATED_BODY()
|
|
|
|
|
|
|
|
public:
|
|
|
|
AAdventurePlayerController();
|
|
|
|
|
2022-01-24 21:26:06 +01:00
|
|
|
// General
|
2022-01-16 21:19:34 +01:00
|
|
|
UPROPERTY()
|
|
|
|
UWorld* World;
|
2022-01-25 18:30:49 +01:00
|
|
|
UPROPERTY(VisibleAnywhere, BlueprintReadWrite)
|
2022-01-16 21:19:34 +01:00
|
|
|
AAdventureMap* MapRef;
|
2022-01-26 16:48:58 +01:00
|
|
|
UPROPERTY(VisibleAnywhere, BlueprintReadWrite)
|
|
|
|
AAdventureCameraPawn* CamRef;
|
2022-01-25 18:30:49 +01:00
|
|
|
UPROPERTY(VisibleAnywhere, BlueprintReadWrite)
|
2022-01-16 21:19:34 +01:00
|
|
|
AHexTile* SpawnHex;
|
2022-06-01 20:25:33 +02:00
|
|
|
|
|
|
|
|
2022-01-16 21:19:34 +01:00
|
|
|
UPROPERTY(VisibleAnywhere, BlueprintReadWrite, Category = "Runtime")
|
|
|
|
AHexTile* CurrentHex;
|
2022-06-01 20:25:33 +02:00
|
|
|
|
|
|
|
|
2022-01-24 21:26:06 +01:00
|
|
|
UPROPERTY(BlueprintReadWrite, EditAnywhere)
|
|
|
|
AHexTile* HoveredHex;
|
|
|
|
UFUNCTION(BlueprintCallable)
|
|
|
|
void LeftClick();
|
2022-01-16 21:19:34 +01:00
|
|
|
|
2022-06-01 20:25:33 +02:00
|
|
|
|
|
|
|
UPROPERTY(BlueprintReadOnly, EditDefaultsOnly)
|
|
|
|
TSubclassOf<AMovementArrow> MoveArrowClass;
|
|
|
|
UFUNCTION(BlueprintCallable)
|
|
|
|
void MarkPath(TArray<AHexTile*> Path);
|
|
|
|
UPROPERTY(BlueprintReadWrite, VisibleAnywhere)
|
|
|
|
TArray<AMovementArrow*> PathArrows;
|
|
|
|
UFUNCTION(BlueprintCallable)
|
|
|
|
void ClearPath();
|
|
|
|
|
|
|
|
|
2022-01-26 16:48:58 +01:00
|
|
|
UPROPERTY(EditAnywhere, BlueprintReadWrite)
|
2022-02-03 01:11:06 +01:00
|
|
|
int32 VisionRadius = 6;
|
2022-01-26 16:48:58 +01:00
|
|
|
UFUNCTION(BlueprintCallable)
|
2022-02-03 01:11:06 +01:00
|
|
|
TArray<AHexTile*> Vision(int32 Radius);
|
2022-06-01 20:25:33 +02:00
|
|
|
UPROPERTY(EditAnywhere, BlueprintReadWrite)
|
|
|
|
TSet<AHexTile*> ExploredHexes;
|
2022-01-26 16:48:58 +01:00
|
|
|
|
2022-01-16 21:19:34 +01:00
|
|
|
protected:
|
|
|
|
virtual void BeginPlay() override;
|
|
|
|
virtual void SetupInputComponent() override;
|
|
|
|
|
2022-01-11 11:07:17 +01:00
|
|
|
public:
|
2022-01-24 21:26:06 +01:00
|
|
|
|
|
|
|
// Object Placement
|
|
|
|
UPROPERTY(BlueprintReadWrite, VisibleAnywhere)
|
|
|
|
bool bInPlacementMode;
|
|
|
|
UPROPERTY(BlueprintReadWrite, EditAnywhere)
|
|
|
|
TSubclassOf<AMapObject> PlaceObjClass;
|
|
|
|
UPROPERTY(BlueprintReadWrite, VisibleAnywhere)
|
|
|
|
AMapObject* PlaceObj;
|
|
|
|
UFUNCTION(BlueprintCallable)
|
2022-06-01 20:25:33 +02:00
|
|
|
void EnablePlacing();
|
|
|
|
UFUNCTION(BlueprintCallable)
|
|
|
|
void DisablePlacing();
|
2022-01-24 21:26:06 +01:00
|
|
|
UFUNCTION(BlueprintCallable)
|
|
|
|
void FitOnGrid(AMapObject* MapObject);
|
|
|
|
UFUNCTION()
|
|
|
|
void PlaceObject(TSubclassOf<AMapObject> MapObjClass, AHexTile* OnHex);
|
|
|
|
|
|
|
|
// Called every frame
|
|
|
|
virtual void Tick(float DeltaTime) override;
|
2022-01-11 11:07:17 +01:00
|
|
|
};
|