unreal/AdventurePlayerController.h

72 lines
1.8 KiB
C
Raw Normal View History

2022-01-11 11:07:17 +01:00
// 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;
2022-01-11 11:07:17 +01:00
/**
*
*/
UCLASS()
class FRAY_API AAdventurePlayerController : public APlayerController
{
GENERATED_BODY()
public:
AAdventurePlayerController();
// General
UPROPERTY()
UWorld* World;
UPROPERTY(VisibleAnywhere, BlueprintReadWrite)
AAdventureMap* MapRef;
2022-01-26 16:48:58 +01:00
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();
2022-01-26 16:48:58 +01:00
UPROPERTY(EditAnywhere, BlueprintReadWrite)
TSet<AHexTile*> ExploredHexes;
UPROPERTY(EditAnywhere, BlueprintReadWrite)
int32 VisionRadius = 6;
2022-01-26 16:48:58 +01:00
UFUNCTION(BlueprintCallable)
TArray<AHexTile*> Vision(int32 Radius);
2022-01-26 16:48:58 +01:00
protected:
virtual void BeginPlay() override;
virtual void SetupInputComponent() override;
2022-01-11 11:07:17 +01:00
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;
2022-01-11 11:07:17 +01:00
};