最终整理版

This commit is contained in:
2026-06-03 17:04:06 +08:00
commit 959055ce90
1240 changed files with 80570 additions and 0 deletions
+88
View File
@@ -0,0 +1,88 @@
#pragma once
#include "TmxMap.h"
#include <filesystem>
#include <map>
#include <string>
#include <vector>
struct TmxWorldIndex {
std::map<std::string, std::filesystem::path> 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<MapSummary> ListMapsSorted(const TmxWorldIndex& index);
std::vector<WarpEdge> BuildWarpGraph(const TmxWorldIndex& index);
std::vector<WarpEdge> MissingWarpEdges(const std::vector<WarpEdge>& graph);
std::vector<WarpEdge> MissingWarpEdges(const TmxWorldIndex& index);
std::vector<std::string> ReachableMaps(const TmxWorldIndex& index, const std::vector<WarpEdge>& graph, const std::string& startMapName);
std::vector<std::string> ReachableMaps(const TmxWorldIndex& index, const std::string& startMapName);
std::vector<std::string> AdjacentMaps(const TmxWorldIndex& index, const std::vector<WarpEdge>& graph, const std::string& mapName);
std::vector<std::string> AdjacentMaps(const TmxWorldIndex& index, const std::string& mapName, const std::vector<WarpEdge>& graph);
std::vector<std::string> AdjacentMaps(const TmxWorldIndex& index, const std::string& mapName);
WorldAudit BuildWorldAudit(const TmxWorldIndex& index);