#pragma once #include "TmxMap.h" #include #include #include #include struct TmxWorldIndex { std::map mapsByName; }; struct MapSummary { std::string name; std::filesystem::path path; int widthPixels = 0; int heightPixels = 0; int spawnCount = 0; int warpCount = 0; }; struct WarpEdge { std::string fromMap; std::string toMap; std::string objectName; int tileX = 0; int tileY = 0; bool resolved = false; }; struct WarpTarget { std::string mapName; std::string originalMapName; int tileX = 0; int tileY = 0; bool aliased = false; }; struct TmxObjectBounds { float x = 0.0f; float y = 0.0f; float width = 0.0f; float height = 0.0f; }; struct TmxObjectPosition { float x = 0.0f; float y = 0.0f; }; struct WorldAudit { int mapCount = 0; int spawnCount = 0; int warpCount = 0; int resolvedWarpCount = 0; int missingWarpCount = 0; int manualWarpCount = 0; int missingIndoorWarpCount = 0; }; TmxWorldIndex BuildTmxWorldIndex(const std::filesystem::path& mapsRoot); TmxMap LoadNamedMap(const TmxWorldIndex& index, const std::string& mapName); bool IsSpawnObject(const TmxObject& object); bool IsWarpObject(const TmxObject& object); bool IsCollectibleSpawnObject(const TmxObject& object); std::string SpawnDisplayName(const TmxObject& object); std::string SpawnStateName(const TmxObject& object); TmxObjectPosition SpawnObjectPosition(const TmxObject& object); bool WarpAutoWarps(const TmxObject& warp); float TriggerRadiusForObject(const TmxObject& object, float fallback); TmxObjectBounds WarpTriggerBounds(const TmxObject& warp); WarpTarget ReadWarpTarget(const TmxObject& warp); bool WarpHasExplicitTileDestination(const TmxObject& warp); std::string IndoorAliasMapName(); bool WarpTargetResolved(const TmxWorldIndex& index, const TmxObject& warp); bool PointLooksLikeTonoriBuildingEntrance(const TmxMap& map, float x, float y); std::string MapDisplayName(const TmxMap& map); std::vector ListMapsSorted(const TmxWorldIndex& index); std::vector BuildWarpGraph(const TmxWorldIndex& index); std::vector MissingWarpEdges(const std::vector& graph); std::vector MissingWarpEdges(const TmxWorldIndex& index); std::vector ReachableMaps(const TmxWorldIndex& index, const std::vector& graph, const std::string& startMapName); std::vector ReachableMaps(const TmxWorldIndex& index, const std::string& startMapName); std::vector AdjacentMaps(const TmxWorldIndex& index, const std::vector& graph, const std::string& mapName); std::vector AdjacentMaps(const TmxWorldIndex& index, const std::string& mapName, const std::vector& graph); std::vector AdjacentMaps(const TmxWorldIndex& index, const std::string& mapName); WorldAudit BuildWorldAudit(const TmxWorldIndex& index);