fix: TileRegistry floor-range warning, GroupViewsByFloor tests, stopwatch cleanup

This commit is contained in:
2026-05-14 01:15:48 +02:00
parent 49c9a7904d
commit 67df6bf6d6
3 changed files with 30 additions and 4 deletions

View File

@@ -42,8 +42,8 @@ namespace Infrastructure.Unity
yield return GenerateFloorAsync(0, MapPatterns.GenerateSquare(gridSizeX, gridSizeY), soundManager, registry, camera, rumble, stopwatch);
yield return GenerateFloorAsync(1, MapPatterns.GenerateDonut(gridSizeX, Mathf.FloorToInt(gridSizeX / 3f)), soundManager, registry, camera, rumble, stopwatch);
yield return GenerateFloorAsync(2, MapPatterns.GenerateCircle(gridSizeX), soundManager, registry, camera, rumble, stopwatch);
stopwatch?.Stop();
stopwatch.Stop();
onComplete?.Invoke();
}

View File

@@ -1,6 +1,7 @@
using System;
using System.Collections.Generic;
using Core.Domain;
using UnityEngine;
namespace Infrastructure.Unity
{
@@ -30,7 +31,12 @@ namespace Infrastructure.Unity
foreach (var tile in _tiles)
{
if (tile.Floor < floorCount && _views.TryGetValue(tile.Id, out var view))
if (tile.Floor >= floorCount)
{
Debug.LogWarning($"TileRegistry: tile '{tile.Id}' floor {tile.Floor} >= floorCount {floorCount}, skipping");
continue;
}
if (_views.TryGetValue(tile.Id, out var view))
floors[tile.Floor].Add(view);
}