#include <overworld_sprite_edit_commands.h>
Public Member Functions | |
| OverworldSpriteEditCommandHandler (OverworldSpriteEditAction action) | |
| std::string | GetName () const override |
| Get the command name. | |
| std::string | GetDescription () const |
| std::string | GetUsage () const override |
| 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. | |
| 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. | |
Public Member Functions inherited from yaze::cli::resources::CommandHandler | |
| virtual | ~CommandHandler ()=default |
| absl::Status | Run (const std::vector< std::string > &args, Rom *rom_context, std::string *captured_output=nullptr) |
| Execute the command. | |
| virtual Descriptor | Describe () const |
| Provide metadata for TUI/help summaries. | |
| virtual bool | RequiresRom () const |
| Check if the command requires a loaded ROM. | |
| virtual bool | RequiresLabels () const |
| Check if the command requires ROM labels. | |
| virtual void | SetProjectContext (project::YazeProject *project) |
| Set the YazeProject context. Default implementation does nothing, override if tool needs project info. | |
| virtual void | SetAsarWrapper (core::AsarWrapper *asar_wrapper) |
| Set the AsarWrapper context. Default implementation does nothing, override if tool needs Asar access. | |
| virtual void | SetRomContext (Rom *rom) |
| Set the ROM context for tools that need ROM access. Default implementation stores the ROM pointer for subclass use. | |
| virtual void | SetAssemblySymbolTable (const std::map< std::string, core::AsarSymbol > *table) |
| Optional Asar symbol table for assembly-aware tools. | |
| virtual void | SetSymbolProvider (emu::debug::SymbolProvider *provider) |
| Set the SymbolProvider context. | |
Private Member Functions | |
| std::string | GetDefaultFormat () const override |
| Get the default output format ("json" or "text") | |
| std::string | GetOutputTitle () const override |
| Get the output title for formatting. | |
Private Attributes | |
| OverworldSpriteEditAction | action_ |
Additional Inherited Members | |
Protected Attributes inherited from yaze::cli::resources::CommandHandler | |
| Rom * | rom_ = nullptr |
| emu::debug::SymbolProvider * | symbol_provider_ = nullptr |
| project::YazeProject * | project_ = nullptr |
| core::AsarWrapper * | asar_wrapper_ = nullptr |
| const std::map< std::string, core::AsarSymbol > * | assembly_symbol_table_ |
Definition at line 24 of file overworld_sprite_edit_commands.h.
|
inlineexplicit |
Definition at line 26 of file overworld_sprite_edit_commands.h.
|
overridevirtual |
Get the command name.
Override this to provide a unique identifier for the command. This is used for command registration and lookup.
Implements yaze::cli::resources::CommandHandler.
Definition at line 102 of file overworld_sprite_edit_commands.cc.
References action_, yaze::cli::handlers::kAdd, yaze::cli::handlers::kMove, and yaze::cli::handlers::kRemove.
Referenced by ExecuteWithContext().
| std::string yaze::cli::handlers::OverworldSpriteEditCommandHandler::GetDescription | ( | ) | const |
Definition at line 114 of file overworld_sprite_edit_commands.cc.
References action_, yaze::cli::handlers::kAdd, yaze::cli::handlers::kMove, and yaze::cli::handlers::kRemove.
|
overridevirtual |
Get the command usage string.
Implements yaze::cli::resources::CommandHandler.
Definition at line 127 of file overworld_sprite_edit_commands.cc.
References action_, yaze::cli::handlers::kAdd, yaze::cli::handlers::kMove, and yaze::cli::handlers::kRemove.
|
overridevirtual |
Validate command arguments.
Implements yaze::cli::resources::CommandHandler.
Definition at line 147 of file overworld_sprite_edit_commands.cc.
References action_, yaze::cli::handlers::kAdd, yaze::cli::handlers::kMove, yaze::cli::handlers::kRemove, yaze::cli::resources::ArgumentParser::RequireArgs(), and RETURN_IF_ERROR.
Referenced by ExecuteWithContext().
|
overridevirtual |
Execute the command business logic.
Override this to implement command-specific functionality. The ROM is guaranteed to be loaded and labels initialized.
Implements yaze::cli::resources::CommandHandler.
Definition at line 161 of file overworld_sprite_edit_commands.cc.
References yaze::cli::resources::CommandInvocationContext::active_rom_path, ExecuteWithContext(), yaze::Rom::filename(), and yaze::cli::resources::CommandInvocationContext::source_rom_path.
|
overridevirtual |
Execute with immutable, invocation-scoped ROM path identity.
Handlers that protect filesystem outputs from aliasing a source or sandbox ROM can override this hook. Existing handlers continue through Execute() without carrying mutable state on singleton handler instances.
Reimplemented from yaze::cli::resources::CommandHandler.
Definition at line 172 of file overworld_sprite_edit_commands.cc.
References action_, yaze::cli::resources::CommandInvocationContext::active_rom_path, yaze::cli::resources::OutputFormatter::AddArrayItem(), yaze::cli::resources::OutputFormatter::AddField(), yaze::zelda3::ApplyOverworldSpriteSave(), ASSIGN_OR_RETURN, yaze::cli::resources::OutputFormatter::BeginArray(), yaze::cli::resources::OutputFormatter::BeginObject(), yaze::ScopedRomTransaction::Commit(), yaze::cli::resources::OutputFormatter::EndArray(), yaze::cli::resources::OutputFormatter::EndObject(), yaze::Rom::filename(), GetName(), yaze::zelda3::GetOverworldSpriteLayout(), yaze::cli::resources::ArgumentParser::GetString(), yaze::cli::resources::ArgumentParser::HasFlag(), yaze::Rom::is_loaded(), yaze::cli::handlers::IsOracleProjectRomPath(), yaze::cli::handlers::kAdd, yaze::cli::handlers::kMove, yaze::cli::handlers::kRemove, yaze::zelda3::LargeArea, yaze::zelda3::Overworld::Load(), yaze::Rom::LoadFromFile(), yaze::zelda3::Overworld::overworld_map(), yaze::zelda3::OverworldSpriteEditStrategyName(), yaze::zelda3::PlanOverworldSpriteListEdit(), yaze::zelda3::ReadOverworldSpriteList(), yaze::Rom::SaveSettings::require_backup, yaze::zelda3::ResolveSpriteName(), RETURN_IF_ERROR, yaze::Rom::SaveToFile(), yaze::cli::overworld::SpritePhaseName(), yaze::zelda3::TallArea, ValidateArgs(), yaze::Rom::vector(), and yaze::zelda3::WideArea.
Referenced by Execute().
|
inlineoverrideprivatevirtual |
Get the default output format ("json" or "text")
Reimplemented from yaze::cli::resources::CommandHandler.
Definition at line 42 of file overworld_sprite_edit_commands.h.
|
inlineoverrideprivatevirtual |
Get the output title for formatting.
Reimplemented from yaze::cli::resources::CommandHandler.
Definition at line 43 of file overworld_sprite_edit_commands.h.
|
private |
Definition at line 46 of file overworld_sprite_edit_commands.h.
Referenced by ExecuteWithContext(), GetDescription(), GetName(), GetUsage(), and ValidateArgs().