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
23 public:
24 std::string GetName() const { return "dungeon-graph"; }
25 std::string GetDescription() const {
26 return "Generate room connectivity graph from staircase and holewarp data";
27 }
28 std::string GetUsage() const {
29 return "dungeon-graph --rom <path> [--room <room_id>] [--dungeon <id>] "
30 "[--project <code folder|.yaze>] [--format <json|text>]";
31 }
32
33 absl::Status ValidateArgs(
34 const resources::ArgumentParser& /*parser*/) override {
35 // No required args - can scan all rooms if none specified
36 return absl::OkStatus();
37 }
38
39 absl::Status Execute(Rom* rom, const resources::ArgumentParser& parser,
40 resources::OutputFormatter& formatter) override;
41};
42
51 public:
52 std::string GetName() const override { return "entrance-info"; }
53 std::string GetDescription() const {
54 return "Get entrance table data for an entrance ID";
55 }
56 std::string GetUsage() const override {
57 return "entrance-info --rom <path> --entrance <entrance_id> [--spawn] "
58 "[--format <json|text>]";
59 }
60
61 absl::Status ValidateArgs(const resources::ArgumentParser& parser) override {
62 return parser.RequireArgs({"entrance"});
63 }
64
65 absl::Status Execute(Rom* rom, const resources::ArgumentParser& parser,
66 resources::OutputFormatter& formatter) override;
67};
68
78 public:
79 std::string GetName() const override { return "dungeon-discover"; }
80 std::string GetDescription() const {
81 return "Auto-discover all rooms reachable from an entrance";
82 }
83 std::string GetUsage() const override {
84 return "dungeon-discover --rom <path> --entrance <entrance_id> "
85 "[--depth <max_depth>] [--project <code folder|.yaze>] "
86 "[--format <json|text>]";
87 }
88
89 absl::Status ValidateArgs(const resources::ArgumentParser& parser) override {
90 return parser.RequireArgs({"entrance"});
91 }
92
93 absl::Status Execute(Rom* rom, const resources::ArgumentParser& parser,
94 resources::OutputFormatter& formatter) override;
95};
96
119 public:
120 std::string GetName() const override { return "dungeon-room-graph"; }
121 std::string GetDescription() const {
122 return "Build full room graph (doors + staircases) from an entrance";
123 }
124 std::string GetUsage() const override {
125 return "dungeon-room-graph --entrance <id> [--depth <max>] "
126 "[--same-blockset] [--project <code folder|.yaze>]";
127 }
128
129 absl::Status ValidateArgs(const resources::ArgumentParser& parser) override {
130 return parser.RequireArgs({"entrance"});
131 }
132
133 absl::Status Execute(Rom* rom, const resources::ArgumentParser& parser,
134 resources::OutputFormatter& formatter) override;
135};
136
137} // namespace handlers
138} // namespace cli
139} // namespace yaze
140
141#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:49
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.