yaze 0.3.2
Link to the Past ROM Editor
 
Loading...
Searching...
No Matches
yaze::cli::handlers::OverworldExportGraphCommandHandler Class Reference

Command handler for exporting overworld connectivity graph. More...

#include <overworld_graph_commands.h>

Inheritance diagram for yaze::cli::handlers::OverworldExportGraphCommandHandler:
Collaboration diagram for yaze::cli::handlers::OverworldExportGraphCommandHandler:

Classes

struct  AreaConnection
 
struct  AreaInfo
 
struct  EntranceInfo
 
struct  ExitInfo
 

Public Member Functions

std::string GetName () const override
 Get the command name.
 
std::string GetDescription () const
 
std::string GetUsage () const override
 Get the command usage string.
 
- 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 SetSymbolProvider (emu::debug::SymbolProvider *provider)
 Set the SymbolProvider context.
 

Protected Member Functions

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.
 
- Protected Member Functions inherited from yaze::cli::resources::CommandHandler
virtual std::string GetDefaultFormat () const
 Get the default output format ("json" or "text")
 
virtual std::string GetOutputTitle () const
 Get the output title for formatting.
 

Additional Inherited Members

- Protected Attributes inherited from yaze::cli::resources::CommandHandler
Romrom_ = nullptr
 
emu::debug::SymbolProvidersymbol_provider_ = nullptr
 
project::YazeProjectproject_ = nullptr
 
core::AsarWrapperasar_wrapper_ = nullptr
 

Detailed Description

Command handler for exporting overworld connectivity graph.

Extracts world graph data from ROM including:

  • Area definitions (ID, name, world, grid position, bounds)
  • Area connections (from transition tables)
  • Entrances (overworld to underworld warps)
  • Exits (underworld to overworld returns)

Output format is JSON suitable for pathfinding navigation systems.

Definition at line 24 of file overworld_graph_commands.h.

Member Function Documentation

◆ GetName()

std::string yaze::cli::handlers::OverworldExportGraphCommandHandler::GetName ( ) const
inlineoverridevirtual

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 26 of file overworld_graph_commands.h.

◆ GetDescription()

std::string yaze::cli::handlers::OverworldExportGraphCommandHandler::GetDescription ( ) const
inline

Definition at line 27 of file overworld_graph_commands.h.

◆ GetUsage()

std::string yaze::cli::handlers::OverworldExportGraphCommandHandler::GetUsage ( ) const
inlineoverridevirtual

Get the command usage string.

Implements yaze::cli::resources::CommandHandler.

Definition at line 30 of file overworld_graph_commands.h.

◆ ValidateArgs()

absl::Status yaze::cli::handlers::OverworldExportGraphCommandHandler::ValidateArgs ( const resources::ArgumentParser & parser)
inlineoverrideprotectedvirtual

Validate command arguments.

Implements yaze::cli::resources::CommandHandler.

Definition at line 36 of file overworld_graph_commands.h.

◆ Execute()

absl::Status yaze::cli::handlers::OverworldExportGraphCommandHandler::Execute ( Rom * rom,
const resources::ArgumentParser & parser,
resources::OutputFormatter & formatter )
overrideprotectedvirtual

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 102 of file overworld_graph_commands.cc.

References yaze::cli::resources::OutputFormatter::AddField(), yaze::cli::handlers::OverworldExportGraphCommandHandler::EntranceInfo::area_id, ASSIGN_OR_RETURN, yaze::cli::resources::OutputFormatter::BeginArray(), yaze::cli::resources::OutputFormatter::BeginObject(), yaze::cli::handlers::OverworldExportGraphCommandHandler::AreaConnection::bidirectional, yaze::cli::handlers::OverworldExportGraphCommandHandler::EntranceInfo::dest_room_id, yaze::cli::handlers::OverworldExportGraphCommandHandler::AreaConnection::direction, yaze::cli::handlers::OverworldExportGraphCommandHandler::AreaConnection::edge_x, yaze::cli::handlers::OverworldExportGraphCommandHandler::AreaConnection::edge_y, yaze::cli::resources::OutputFormatter::EndArray(), yaze::cli::resources::OutputFormatter::EndObject(), yaze::zelda3::Overworld::entrances(), yaze::zelda3::Overworld::exits(), yaze::cli::handlers::OverworldExportGraphCommandHandler::AreaConnection::from_area, yaze::cli::resources::ArgumentParser::GetString(), yaze::cli::handlers::OverworldExportGraphCommandHandler::AreaInfo::grid_x, yaze::cli::handlers::OverworldExportGraphCommandHandler::AreaInfo::grid_y, yaze::zelda3::Overworld::holes(), yaze::cli::handlers::OverworldExportGraphCommandHandler::AreaInfo::id, yaze::cli::handlers::OverworldExportGraphCommandHandler::EntranceInfo::id, yaze::cli::handlers::OverworldExportGraphCommandHandler::EntranceInfo::is_hole, yaze::zelda3::kEntranceNames, yaze::zelda3::kEntranceRoom, yaze::zelda3::kNumOverworldMaps, yaze::zelda3::kTransitionTargetNorth, yaze::zelda3::kTransitionTargetWest, yaze::zelda3::LargeArea, yaze::zelda3::Overworld::Load(), yaze::cli::handlers::OverworldExportGraphCommandHandler::AreaInfo::max_x, yaze::cli::handlers::OverworldExportGraphCommandHandler::AreaInfo::max_y, yaze::cli::handlers::OverworldExportGraphCommandHandler::AreaInfo::min_x, yaze::cli::handlers::OverworldExportGraphCommandHandler::AreaInfo::min_y, yaze::cli::handlers::OverworldExportGraphCommandHandler::AreaInfo::name, yaze::cli::handlers::OverworldExportGraphCommandHandler::EntranceInfo::name, yaze::cli::handlers::OverworldExportGraphCommandHandler::ExitInfo::name, yaze::zelda3::Overworld::overworld_map(), yaze::cli::handlers::OverworldExportGraphCommandHandler::AreaInfo::parent_id, yaze::cli::handlers::OverworldExportGraphCommandHandler::EntranceInfo::position_x, yaze::cli::handlers::OverworldExportGraphCommandHandler::EntranceInfo::position_y, yaze::Rom::ReadWord(), yaze::cli::handlers::OverworldExportGraphCommandHandler::ExitInfo::return_area_id, RETURN_IF_ERROR, yaze::cli::handlers::OverworldExportGraphCommandHandler::ExitInfo::return_x, yaze::cli::handlers::OverworldExportGraphCommandHandler::ExitInfo::return_y, yaze::cli::handlers::OverworldExportGraphCommandHandler::ExitInfo::room_id, yaze::cli::handlers::OverworldExportGraphCommandHandler::AreaInfo::size, yaze::zelda3::TallArea, yaze::Rom::title(), yaze::cli::handlers::OverworldExportGraphCommandHandler::AreaConnection::to_area, yaze::zelda3::WideArea, and yaze::cli::handlers::OverworldExportGraphCommandHandler::AreaInfo::world.


The documentation for this class was generated from the following files: