new algorithm draft for diag moves; committed missing files
This commit is contained in:
@@ -45,10 +45,12 @@ void AAdventurePlayerController::LeftClick()
|
||||
if (bInPlacementMode) { PlaceObject(PlaceObjClass, HoveredHex); }
|
||||
}
|
||||
|
||||
TArray<AHexTile*> AAdventurePlayerController::Vision()
|
||||
TArray<AHexTile*> AAdventurePlayerController::Vision(int32 Radius)
|
||||
{
|
||||
TArray<AHexTile*> Results;
|
||||
TSet<AHexTile*> Visible = MapRef->BreadthFirstSearch(CurrentHex, 4);
|
||||
TSet<AHexTile*> Visible;
|
||||
if (CurrentHex->bDiagMove) { Radius = FMath::FloorToInt(float(Radius) * (2.f / 3.f)); }
|
||||
Visible = MapRef->BreadthFirstSearch(CurrentHex, Radius);
|
||||
for (auto& Hex : Visible) {
|
||||
if (ExploredHexes.Contains(Hex)) { continue; }
|
||||
Results.Add(Hex);
|
||||
|
||||
Reference in New Issue
Block a user