yaze 0.3.2
Link to the Past ROM Editor
 
Loading...
Searching...
No Matches
overworld_commands.h
Go to the documentation of this file.
1#ifndef YAZE_SRC_CLI_HANDLERS_OVERWORLD_COMMANDS_H_
2#define YAZE_SRC_CLI_HANDLERS_OVERWORLD_COMMANDS_H_
3
5
6namespace yaze {
7namespace cli {
8namespace handlers {
9
11 public:
12 std::string GetName() const { return "overworld-get-tile"; }
13 std::string GetDescription() const {
14 return "Read the tile16 id at an overworld area position. --map is a hex "
15 "screen id; x/y are decimal (or 0x-hex) tile16 coordinates "
16 "relative to the top-left of the screen's parent area: 0-31 for a "
17 "small area, 0-63 on each doubled axis of a large/wide/tall area";
18 }
19 std::string GetUsage() const {
20 return "overworld-get-tile --map <hex> --x <area_tile_x> --y <area_tile_y> "
21 "[--format <json|text>]";
22 }
23
24 absl::Status ValidateArgs(const resources::ArgumentParser& parser) override {
25 return parser.RequireArgs({"map", "x", "y"});
26 }
27
28 absl::Status Execute(Rom* rom, const resources::ArgumentParser& parser,
29 resources::OutputFormatter& formatter) override;
30};
31
34 public:
35 std::string GetName() const { return "overworld-inspect-special-entrances"; }
36 std::string GetDescription() const {
37 return "Inspect verified four-row special-area tile triggers in the loaded "
38 "ROM";
39 }
40 std::string GetUsage() const {
41 return "overworld-inspect-special-entrances --map <hex> [--format "
42 "<json|text>]";
43 }
44 absl::Status ValidateArgs(const resources::ArgumentParser& parser) override {
45 return parser.RequireArgs({"map"});
46 }
47 absl::Status Execute(Rom* rom, const resources::ArgumentParser& parser,
48 resources::OutputFormatter& formatter) override;
49};
50
52 public:
53 std::string GetName() const { return "overworld-set-tile"; }
54 std::string GetDescription() const {
55 return "Write one tile16 id at an overworld area position (dry-run by "
56 "default). Coordinates match overworld-get-tile. --write rebuilds "
57 "tile32/map data, verifies a fresh reload, saves with a required "
58 "backup, and refuses ROMs inside an Oracle checkout unless "
59 "--allow-project-rom";
60 }
61 std::string GetUsage() const {
62 return "overworld-set-tile --map <hex> --x <area_tile_x> --y <area_tile_y> "
63 "--tile <hex> [--write] [--allow-project-rom] [--format "
64 "<json|text>]";
65 }
66
67 absl::Status ValidateArgs(const resources::ArgumentParser& parser) override {
68 return parser.RequireArgs({"map", "x", "y", "tile"});
69 }
70
71 absl::Status Execute(Rom* rom, const resources::ArgumentParser& parser,
72 resources::OutputFormatter& formatter) override;
73 absl::Status ExecuteWithContext(
74 Rom* rom, const resources::ArgumentParser& parser,
76 const resources::CommandInvocationContext& invocation_context) override;
77};
78
83 public:
84 std::string GetName() const { return "overworld-find-tile"; }
85 std::string GetDescription() const {
86 return "Find tiles by ID in overworld maps";
87 }
88 std::string GetUsage() const {
89 return "overworld-find-tile --tile <hex> [--map <hex>] "
90 "[--world <light|dark|special>] [--format <json|text>]";
91 }
92
93 absl::Status ValidateArgs(const resources::ArgumentParser& parser) override {
94 return parser.RequireArgs({"tile"});
95 }
96
97 absl::Status Execute(Rom* rom, const resources::ArgumentParser& parser,
98 resources::OutputFormatter& formatter) override;
99};
100
105 public:
106 std::string GetName() const { return "overworld-describe-map"; }
107 std::string GetDescription() const {
108 return "Get detailed description of an overworld map";
109 }
110 std::string GetUsage() const {
111 return "overworld-describe-map --screen <hex> [--format <json|text>]";
112 }
113
114 absl::Status ValidateArgs(const resources::ArgumentParser& parser) override {
115 return parser.RequireArgs({"screen"});
116 }
117
118 absl::Status Execute(Rom* rom, const resources::ArgumentParser& parser,
119 resources::OutputFormatter& formatter) override;
120};
121
126 public:
127 std::string GetName() const { return "overworld-list-warps"; }
128 std::string GetDescription() const {
129 return "List all warps in overworld maps";
130 }
131 std::string GetUsage() const {
132 return "overworld-list-warps [--screen <screen_id>] [--format <json|text>]";
133 }
134
135 absl::Status ValidateArgs(const resources::ArgumentParser& parser) override {
136 return absl::OkStatus(); // No required args
137 }
138
139 absl::Status Execute(Rom* rom, const resources::ArgumentParser& parser,
140 resources::OutputFormatter& formatter) override;
141};
142
147 public:
148 std::string GetName() const { return "overworld-list-sprites"; }
149 std::string GetDescription() const {
150 return "List all sprites in overworld maps";
151 }
152 std::string GetUsage() const {
153 return "overworld-list-sprites [--screen <screen_id>] [--phase <0|1|2>] "
154 "[--format <json|text>]";
155 }
156
157 absl::Status ValidateArgs(const resources::ArgumentParser& parser) override {
158 return absl::OkStatus(); // No required args
159 }
160
161 absl::Status Execute(Rom* rom, const resources::ArgumentParser& parser,
162 resources::OutputFormatter& formatter) override;
163};
164
169 public:
170 std::string GetName() const { return "overworld-list-items"; }
171 std::string GetDescription() const {
172 return "List all hidden item placements in overworld maps";
173 }
174 std::string GetUsage() const {
175 return "overworld-list-items [--screen <screen_id>] [--format "
176 "<json|text>]";
177 }
178
179 absl::Status ValidateArgs(const resources::ArgumentParser& parser) override {
180 return absl::OkStatus(); // No required args
181 }
182
183 absl::Status Execute(Rom* rom, const resources::ArgumentParser& parser,
184 resources::OutputFormatter& formatter) override;
185};
186
191 public:
192 std::string GetName() const { return "overworld-get-entrance"; }
193 std::string GetDescription() const {
194 return "Get entrance information from overworld";
195 }
196 std::string GetUsage() const {
197 return "overworld-get-entrance --entrance <entrance_id> [--format "
198 "<json|text>]";
199 }
200
201 absl::Status ValidateArgs(const resources::ArgumentParser& parser) override {
202 return parser.RequireArgs({"entrance"});
203 }
204
205 absl::Status Execute(Rom* rom, const resources::ArgumentParser& parser,
206 resources::OutputFormatter& formatter) override;
207};
208
213 public:
214 std::string GetName() const { return "overworld-tile-stats"; }
215 std::string GetDescription() const {
216 return "Count tile16 usage per screen, per world and per tile16 id";
217 }
218 std::string GetUsage() const {
219 return "overworld-tile-stats [--screen <hex>|--map <hex>] "
220 "[--world <light|dark|special>] [--tile <hex>] [--top <n>] "
221 "[--format <json|text>]";
222 }
223
224 absl::Status ValidateArgs(const resources::ArgumentParser& parser) override {
225 return absl::OkStatus(); // No required args
226 }
227
228 absl::Status Execute(Rom* rom, const resources::ArgumentParser& parser,
229 resources::OutputFormatter& formatter) override;
230};
231
232} // namespace handlers
233} // namespace cli
234} // namespace yaze
235
236#endif // YAZE_SRC_CLI_HANDLERS_OVERWORLD_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 describing overworld maps.
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
Get the command name.
std::string GetUsage() const
Get the command usage string.
Command handler for finding tiles in overworld.
absl::Status Execute(Rom *rom, const resources::ArgumentParser &parser, resources::OutputFormatter &formatter) override
Execute the command business logic.
std::string GetUsage() const
Get the command usage string.
std::string GetName() const
Get the command name.
absl::Status ValidateArgs(const resources::ArgumentParser &parser) override
Validate command arguments.
Command handler for getting entrance information.
absl::Status Execute(Rom *rom, const resources::ArgumentParser &parser, resources::OutputFormatter &formatter) override
Execute the command business logic.
std::string GetUsage() const
Get the command usage string.
absl::Status ValidateArgs(const resources::ArgumentParser &parser) override
Validate command arguments.
std::string GetName() const
Get the command name.
std::string GetName() const
Get the command name.
std::string GetUsage() const
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.
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 GetUsage() const
Get the command usage string.
Command handler for listing items in overworld.
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 GetUsage() const
Get the command usage string.
std::string GetName() const
Get the command name.
Command handler for listing sprites in overworld.
std::string GetName() const
Get the command name.
absl::Status Execute(Rom *rom, const resources::ArgumentParser &parser, resources::OutputFormatter &formatter) override
Execute the command business logic.
std::string GetUsage() const
Get the command usage string.
absl::Status ValidateArgs(const resources::ArgumentParser &parser) override
Validate command arguments.
Command handler for listing warps in overworld.
std::string GetUsage() const
Get the command usage string.
absl::Status ValidateArgs(const resources::ArgumentParser &parser) override
Validate command arguments.
absl::Status Execute(Rom *rom, const resources::ArgumentParser &parser, resources::OutputFormatter &formatter) override
Execute the command business logic.
std::string GetName() const
Get the command name.
absl::Status ValidateArgs(const resources::ArgumentParser &parser) override
Validate command arguments.
std::string GetName() const
Get the command name.
absl::Status ExecuteWithContext(Rom *rom, const resources::ArgumentParser &parser, resources::OutputFormatter &formatter, const resources::CommandInvocationContext &invocation_context) override
Execute with immutable, invocation-scoped ROM path identity.
std::string GetUsage() const
Get the command usage string.
absl::Status Execute(Rom *rom, const resources::ArgumentParser &parser, resources::OutputFormatter &formatter) override
Execute the command business logic.
Command handler for getting tile statistics.
absl::Status Execute(Rom *rom, const resources::ArgumentParser &parser, resources::OutputFormatter &formatter) override
Execute the command business logic.
std::string GetName() const
Get the command name.
absl::Status ValidateArgs(const resources::ArgumentParser &parser) override
Validate command arguments.
std::string GetUsage() const
Get the command usage string.
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.