56 lines
1.7 KiB
C++
56 lines
1.7 KiB
C++
// Fill out your copyright notice in the Description page of Project Settings.
|
|
|
|
#pragma once
|
|
|
|
#include "CoreMinimal.h"
|
|
#include "GameFramework/Actor.h"
|
|
#include "AdventureMap.generated.h"
|
|
|
|
class AHexTile;
|
|
class AAdventureCharacter;
|
|
|
|
UCLASS()
|
|
class FRAY_API AAdventureMap : public AActor
|
|
{
|
|
GENERATED_BODY()
|
|
|
|
public:
|
|
// Sets default values for this actor's properties
|
|
AAdventureMap();
|
|
|
|
UPROPERTY(EditDefaultsOnly, BlueprintReadOnly, Category = "Config")
|
|
TSubclassOf<AHexTile> BaseTileClass;
|
|
UPROPERTY(EditDefaultsOnly, BlueprintReadOnly, Category = "Config")
|
|
TSubclassOf<ACharacter> BasePartyCharacterClass;
|
|
UPROPERTY(EditDefaultsOnly, BlueprintReadOnly, Category = "Config")
|
|
int32 GridSize = 100; // squared is the number of Tiles
|
|
UPROPERTY(EditDefaultsOnly, BlueprintReadOnly, Category = "Config")
|
|
int32 TileSize = 100;
|
|
|
|
UFUNCTION(BlueprintCallable, Category = "Generation")
|
|
void MakeGrid();
|
|
UPROPERTY(BlueprintReadOnly, Category = "Generation")
|
|
bool bHexGridReady;
|
|
UPROPERTY(VisibleInstanceOnly, BlueprintReadWrite, Category = "Generation")
|
|
TArray<AHexTile*> Grid;
|
|
|
|
UFUNCTION(BlueprintCallable, Category = "Runtime")
|
|
int32 GridIndex(int32 q, int32 r);
|
|
UFUNCTION(BlueprintCallable, Category = "Runtime")
|
|
AHexTile* RandomHex();
|
|
UFUNCTION(BlueprintCallable, Category = "Runtime")
|
|
TArray<AHexTile*> Neighbors(AHexTile* OfHex);
|
|
UFUNCTION(BlueprintCallable, Category = "Runtime")
|
|
TArray<AHexTile*> FindPathAStar(AHexTile* Start, AHexTile* Goal);
|
|
|
|
// Player spawn section
|
|
UPROPERTY(VisibleAnywhere, BlueprintReadWrite)
|
|
APawn* CameraPawn;
|
|
UPROPERTY(VisibleAnywhere, BlueprintReadWrite)
|
|
AAdventureCharacter* PlayerCharacter;
|
|
|
|
protected:
|
|
// Called when the game starts or when spawned
|
|
virtual void BeginPlay() override;
|
|
};
|