unreal/AdventurePlayerController.h

72 lines
1.8 KiB
C++

// Fill out your copyright notice in the Description page of Project Settings.
#pragma once
#include "CoreMinimal.h"
#include "GameFramework/PlayerController.h"
#include "AdventurePlayerController.generated.h"
class AAdventureMap;
class AHexTile;
class AAdventureCameraPawn;
class AAdventureCharacter;
class AMapObject;
/**
*
*/
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(EditAnywhere, BlueprintReadWrite)
TSet<AHexTile*> ExploredHexes;
UPROPERTY(EditAnywhere, BlueprintReadWrite)
int32 VisionRadius = 7;
UFUNCTION(BlueprintCallable)
TArray<AHexTile*> Vision();
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 TogglePlacing();
UFUNCTION(BlueprintCallable)
void FitOnGrid(AMapObject* MapObject);
UFUNCTION()
void PlaceObject(TSubclassOf<AMapObject> MapObjClass, AHexTile* OnHex);
// Called every frame
virtual void Tick(float DeltaTime) override;
};