yaze 0.3.2
Link to the Past ROM Editor
 
Loading...
Searching...
No Matches
overworld_sprite_edit_commands.h
Go to the documentation of this file.
1#ifndef YAZE_SRC_CLI_HANDLERS_GAME_OVERWORLD_SPRITE_EDIT_COMMANDS_H_
2#define YAZE_SRC_CLI_HANDLERS_GAME_OVERWORLD_SPRITE_EDIT_COMMANDS_H_
3
4#include <filesystem>
5
7
8namespace yaze {
9namespace cli {
10namespace handlers {
11
13
14// True when `rom_path` is a ROM inside an Oracle of Secrets source checkout
15// (<checkout>/Roms/<rom> next to <checkout>/Oracle_main.asm). Overworld sprite
16// writes refuse such ROMs unless --allow-project-rom is passed.
17bool IsOracleProjectRomPath(const std::filesystem::path& rom_path);
18
19// Shared implementation for overworld-add-sprite / -move-sprite /
20// -remove-sprite. Dry-run by default: prints the list before/after, the
21// minimal-diff strategy, and every PC/SNES byte range the write would change.
22// --write applies through the fenced sprite writer, saves with a required
23// backup, then reopens the saved file and verifies the change.
25 public:
28
29 std::string GetName() const override;
30 std::string GetDescription() const;
31 std::string GetUsage() const override;
32
33 absl::Status ValidateArgs(const resources::ArgumentParser& parser) override;
34 absl::Status Execute(Rom* rom, const resources::ArgumentParser& parser,
35 resources::OutputFormatter& formatter) override;
36 absl::Status ExecuteWithContext(
37 Rom* rom, const resources::ArgumentParser& parser,
39 const resources::CommandInvocationContext& invocation_context) override;
40
41 private:
42 std::string GetDefaultFormat() const override { return "json"; }
43 std::string GetOutputTitle() const override {
44 return "Overworld Sprite Edit";
45 }
47};
48
67
68} // namespace handlers
69} // namespace cli
70} // namespace yaze
71
72#endif // YAZE_SRC_CLI_HANDLERS_GAME_OVERWORLD_SPRITE_EDIT_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
std::string GetDefaultFormat() const override
Get the default output format ("json" or "text")
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.
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 override
Get the command name.
std::string GetOutputTitle() const override
Get the output title for formatting.
std::string GetUsage() const override
Get the command usage string.
Utility for parsing common CLI argument patterns.
Base class for CLI command handlers.
Utility for consistent output formatting across commands.
bool IsOracleProjectRomPath(const std::filesystem::path &rom_path)