unreal/AdventureMap.h

51 lines
1.4 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(EditAnywhere, BlueprintReadOnly, Category = "Config")
int32 GridSize = 100; // squared is the number of Tiles
UPROPERTY(EditAnywhere, BlueprintReadOnly, Category = "Config")
int32 TileSize = 100;
UPROPERTY(VisibleInstanceOnly, BlueprintReadWrite, Category = "MapData")
TArray<AHexTile*> Grid;
UFUNCTION(BlueprintCallable)
int32 GridIndex(int32 q, int32 r);
// Player spawn section
UPROPERTY(VisibleAnywhere, BlueprintReadWrite)
APawn* CameraPawn;
UPROPERTY(VisibleAnywhere, BlueprintReadWrite)
AAdventureCharacter* PlayerCharacter;
UFUNCTION(BlueprintCallable)
void MakeGrid();
UFUNCTION(BlueprintCallable)
AHexTile* RandomHex();
protected:
// Called when the game starts or when spawned
virtual void BeginPlay() override;
};