yaze 0.3.2
Link to the Past ROM Editor
 
Loading...
Searching...
No Matches
dungeon_graph_commands.h
Go to the documentation of this file.
1#ifndef YAZE_SRC_CLI_HANDLERS_DUNGEON_GRAPH_COMMANDS_H_
2#define YAZE_SRC_CLI_HANDLERS_DUNGEON_GRAPH_COMMANDS_H_
3
4#include <string>
5
6#include "absl/status/status.h"
8
9namespace yaze {
10namespace cli {
11namespace handlers {
12
21 public:
22 std::string GetName() const { return "dungeon-graph"; }
23 std::string GetDescription() const {
24 return "Generate room connectivity graph from staircase and holewarp data";
25 }
26 std::string GetUsage() const {
27 return "dungeon-graph --rom <path> [--room <room_id>] [--dungeon <id>] "
28 "[--format <json|text>]";
29 }
30
31 absl::Status ValidateArgs(
32 const resources::ArgumentParser& /*parser*/) override {
33 // No required args - can scan all rooms if none specified
34 return absl::OkStatus();
35 }
36
37 absl::Status Execute(Rom* rom, const resources::ArgumentParser& parser,
38 resources::OutputFormatter& formatter) override;
39};
40
49 public:
50 std::string GetName() const override { return "entrance-info"; }
51 std::string GetDescription() const {
52 return "Get entrance table data for an entrance ID";
53 }
54 std::string GetUsage() const override {
55 return "entrance-info --rom <path> --entrance <entrance_id> [--spawn] "
56 "[--format <json|text>]";
57 }
58
59 absl::Status ValidateArgs(const resources::ArgumentParser& parser) override {
60 return parser.RequireArgs({"entrance"});
61 }
62
63 absl::Status Execute(Rom* rom, const resources::ArgumentParser& parser,
64 resources::OutputFormatter& formatter) override;
65};
66
75 public:
76 std::string GetName() const override { return "dungeon-discover"; }
77 std::string GetDescription() const {
78 return "Auto-discover all rooms reachable from an entrance";
79 }
80 std::string GetUsage() const override {
81 return "dungeon-discover --rom <path> --entrance <entrance_id> "
82 "[--depth <max_depth>] [--format <json|text>]";
83 }
84
85 absl::Status ValidateArgs(const resources::ArgumentParser& parser) override {
86 return parser.RequireArgs({"entrance"});
87 }
88
89 absl::Status Execute(Rom* rom, const resources::ArgumentParser& parser,
90 resources::OutputFormatter& formatter) override;
91};
92
111 public:
112 std::string GetName() const override { return "dungeon-room-graph"; }
113 std::string GetDescription() const {
114 return "Build full room graph (doors + staircases) from an entrance";
115 }
116 std::string GetUsage() const override {
117 return "dungeon-room-graph --entrance <id> [--depth <max>] "
118 "[--same-blockset]";
119 }
120
121 absl::Status ValidateArgs(const resources::ArgumentParser& parser) override {
122 return parser.RequireArgs({"entrance"});
123 }
124
125 absl::Status Execute(Rom* rom, const resources::ArgumentParser& parser,
126 resources::OutputFormatter& formatter) override;
127};
128
129} // namespace handlers
130} // namespace cli
131} // namespace yaze
132
133#endif // YAZE_SRC_CLI_HANDLERS_DUNGEON_GRAPH_COMMANDS_H_
The Rom class is used to load, save, and modify Rom data. This is a generic SNES ROM container and do...
Definition rom.h:28
Command handler for auto-discovering dungeon rooms.
std::string GetUsage() const override
Get the command usage string.
absl::Status Execute(Rom *rom, const resources::ArgumentParser &parser, resources::OutputFormatter &formatter) override
Execute the command business logic.
absl::Status ValidateArgs(const resources::ArgumentParser &parser) override
Validate command arguments.
std::string GetName() const override
Get the command name.
Command handler for generating a room connectivity graph.
std::string GetUsage() const
Get the command usage string.
std::string GetName() const
Get the command name.
absl::Status ValidateArgs(const resources::ArgumentParser &) override
Validate command arguments.
absl::Status Execute(Rom *rom, const resources::ArgumentParser &parser, resources::OutputFormatter &formatter) override
Execute the command business logic.
Full room connectivity graph including door edges.
std::string GetName() const override
Get the command name.
std::string GetUsage() const override
Get the command usage string.
absl::Status Execute(Rom *rom, const resources::ArgumentParser &parser, resources::OutputFormatter &formatter) override
Execute the command business logic.
absl::Status ValidateArgs(const resources::ArgumentParser &parser) override
Validate command arguments.
Command handler for reading entrance table data.
std::string GetUsage() const override
Get the command usage string.
absl::Status ValidateArgs(const resources::ArgumentParser &parser) override
Validate command arguments.
std::string GetName() const override
Get the command name.
absl::Status Execute(Rom *rom, const resources::ArgumentParser &parser, resources::OutputFormatter &formatter) override
Execute the command business logic.
Utility for parsing common CLI argument patterns.
absl::Status RequireArgs(const std::vector< std::string > &required) const
Validate that required arguments are present.
Base class for CLI command handlers.
Utility for consistent output formatting across commands.