Implement Overworld Map Inspection Commands

- Added `OverworldDescribeMap` command to summarize metadata for a specified overworld map.
- Introduced `OverworldListWarps` command to list overworld entrances and holes with their coordinates.
- Refactored existing `overworld.cc` to utilize new helper functions for parsing and validation.
- Created `overworld_inspect.cc` and `overworld_inspect.h` to encapsulate map and warp-related functionalities.
- Updated `ModernCLI` to register new commands and handle their execution.
- Modified `tool_dispatcher.cc` to support dispatching the new commands.
- Updated CMake configuration to include new source files for the inspection commands.
This commit is contained in:
scawful
2025-10-03 15:39:04 -04:00
parent 720d55fc43
commit 8935363eae
11 changed files with 1256 additions and 68 deletions

View File

@@ -210,6 +210,24 @@ void ModernCLI::SetupCommands() {
}
};
commands_["overworld describe-map"] = {
.name = "overworld describe-map",
.description = "Summarize metadata for an overworld map",
.usage = "z3ed overworld describe-map --map <map_id> [--format json|text]",
.handler = [this](const std::vector<std::string>& args) -> absl::Status {
return HandleOverworldDescribeMapCommand(args);
}
};
commands_["overworld list-warps"] = {
.name = "overworld list-warps",
.description = "List overworld entrances and holes with coordinates",
.usage = "z3ed overworld list-warps [--map <map_id>] [--world light|dark|special] [--type entrance|hole|exit|all] [--format json|text]",
.handler = [this](const std::vector<std::string>& args) -> absl::Status {
return HandleOverworldListWarpsCommand(args);
}
};
commands_["overworld set-tile"] = {
.name = "overworld set-tile",
.description = "Set a tile in the overworld",
@@ -448,6 +466,16 @@ absl::Status ModernCLI::HandleOverworldFindTileCommand(const std::vector<std::st
return handler.Run(args);
}
absl::Status ModernCLI::HandleOverworldDescribeMapCommand(const std::vector<std::string>& args) {
OverworldDescribeMap handler;
return handler.Run(args);
}
absl::Status ModernCLI::HandleOverworldListWarpsCommand(const std::vector<std::string>& args) {
OverworldListWarps handler;
return handler.Run(args);
}
absl::Status ModernCLI::HandleOverworldSetTileCommand(const std::vector<std::string>& args) {
OverworldSetTile handler;
return handler.Run(args);