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

Parses natural language commands into structured GUI actions. More...

#include <ai_action_parser.h>

Static Public Member Functions

static absl::StatusOr< std::vector< AIAction > > ParseCommand (const std::string &command)
 
static std::string ActionToString (const AIAction &action)
 

Static Private Member Functions

static AIActionType ParseActionType (const std::string &verb)
 
static std::map< std::string, std::string > ExtractParameters (const std::string &command, AIActionType type)
 
static bool MatchesPlaceTilePattern (const std::string &command, std::map< std::string, std::string > *params)
 
static bool MatchesSelectTilePattern (const std::string &command, std::map< std::string, std::string > *params)
 
static bool MatchesOpenEditorPattern (const std::string &command, std::map< std::string, std::string > *params)
 

Detailed Description

Parses natural language commands into structured GUI actions.

Understands commands like:

  • "Place tile 0x42 at overworld position (5, 7)"
  • "Open the overworld editor"
  • "Select tile 100 from the tile selector"

Definition at line 53 of file ai_action_parser.h.

Member Function Documentation

◆ ParseCommand()

absl::StatusOr< std::vector< AIAction > > yaze::cli::ai::AIActionParser::ParseCommand ( const std::string &  command)
static

Parse a natural language command into a sequence of AI actions

Parameters
commandThe command to parse
Returns
Vector of actions, or error status

Definition at line 52 of file ai_action_parser.cc.

References yaze::cli::ai::kClickButton, yaze::cli::ai::kOpenEditor, yaze::cli::ai::kPlaceTile, yaze::cli::ai::kSaveTile, yaze::cli::ai::kSelectTile, MatchesOpenEditorPattern(), MatchesPlaceTilePattern(), and MatchesSelectTilePattern().

Referenced by yaze::cli::ai::AIGUIController::ExecuteCommand().

Here is the call graph for this function:

◆ ActionToString()

◆ ParseActionType()

static AIActionType yaze::cli::ai::AIActionParser::ParseActionType ( const std::string &  verb)
staticprivate

◆ ExtractParameters()

static std::map< std::string, std::string > yaze::cli::ai::AIActionParser::ExtractParameters ( const std::string &  command,
AIActionType  type 
)
staticprivate

◆ MatchesPlaceTilePattern()

bool yaze::cli::ai::AIActionParser::MatchesPlaceTilePattern ( const std::string &  command,
std::map< std::string, std::string > *  params 
)
staticprivate

Definition at line 152 of file ai_action_parser.cc.

Referenced by ParseCommand().

◆ MatchesSelectTilePattern()

bool yaze::cli::ai::AIActionParser::MatchesSelectTilePattern ( const std::string &  command,
std::map< std::string, std::string > *  params 
)
staticprivate

Definition at line 203 of file ai_action_parser.cc.

Referenced by ParseCommand().

◆ MatchesOpenEditorPattern()

bool yaze::cli::ai::AIActionParser::MatchesOpenEditorPattern ( const std::string &  command,
std::map< std::string, std::string > *  params 
)
staticprivate

Definition at line 236 of file ai_action_parser.cc.

Referenced by ParseCommand().


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