#include "Level/Map/GameMapActor.h" #include "Level/Map/Components/StaticResourceLayerComponent.h" DEFINE_LOG_CATEGORY(LogMapGenerate); AGameMapActor::AGameMapActor() { SceneComp = CreateDefaultSubobject(TEXT("SceneComp")); TerrainLayer = CreateDefaultSubobject(TEXT("TerrainLayer")); ResourceLayer = CreateDefaultSubobject(TEXT("ResourceLayer")); this->RootComponent = SceneComp; } void AGameMapActor::GetMapSize_Implementation(int32& OutWidth, int32& OutHeight) { OutWidth = MapWidth; OutHeight = MapHeight; } FGameplayTag AGameMapActor::GetTerrainAt_Implementation(const float X, const float Y) { return TerrainLayer->GetTerrainAt(X, Y); } int32 AGameMapActor::GetMapFieldSize_Implementation() { return MapFieldSize; } void AGameMapActor::BeginPlay() { Super::BeginPlay(); ResourceLayer->GenerateResources(); } void AGameMapActor::EndPlay(const EEndPlayReason::Type EndPlayReason) { Super::EndPlay(EndPlayReason); }