yaze 0.3.2
Link to the Past ROM Editor
 
Loading...
Searching...
No Matches
command_handlers_browser.cc
Go to the documentation of this file.
2
3#include <memory>
4#include <vector>
5
12
13namespace yaze {
14namespace cli {
15namespace handlers {
16
17std::vector<std::unique_ptr<resources::CommandHandler>>
19 std::vector<std::unique_ptr<resources::CommandHandler>> handlers;
20
21 // Graphics commands (supported in browser)
22 handlers.push_back(std::make_unique<HexReadCommandHandler>());
23 handlers.push_back(std::make_unique<HexWriteCommandHandler>());
24 handlers.push_back(std::make_unique<HexSearchCommandHandler>());
25
26 // Palette commands (supported in browser)
27 handlers.push_back(std::make_unique<PaletteGetColorsCommandHandler>());
28 handlers.push_back(std::make_unique<PaletteSetColorCommandHandler>());
29 handlers.push_back(std::make_unique<PaletteAnalyzeCommandHandler>());
30
31 // Dungeon commands
32 handlers.push_back(std::make_unique<DungeonListSpritesCommandHandler>());
33 handlers.push_back(std::make_unique<DungeonDescribeRoomCommandHandler>());
34 handlers.push_back(std::make_unique<DungeonExportRoomCommandHandler>());
35 handlers.push_back(std::make_unique<DungeonListObjectsCommandHandler>());
36 handlers.push_back(std::make_unique<DungeonGetRoomTilesCommandHandler>());
37 handlers.push_back(std::make_unique<DungeonSetRoomPropertyCommandHandler>());
38
39 // Overworld commands
40 handlers.push_back(std::make_unique<OverworldFindTileCommandHandler>());
41 handlers.push_back(std::make_unique<OverworldDescribeMapCommandHandler>());
42 handlers.push_back(std::make_unique<OverworldListWarpsCommandHandler>());
43 handlers.push_back(std::make_unique<OverworldListSpritesCommandHandler>());
44 handlers.push_back(std::make_unique<OverworldGetEntranceCommandHandler>());
45 handlers.push_back(std::make_unique<OverworldTileStatsCommandHandler>());
46
47 // Resource commands
48 handlers.push_back(std::make_unique<ResourceListCommandHandler>());
49 handlers.push_back(std::make_unique<ResourceSearchCommandHandler>());
50
51 // ROM commands
52 handlers.push_back(std::make_unique<RomInfoCommandHandler>());
53 handlers.push_back(std::make_unique<RomValidateCommandHandler>());
54 handlers.push_back(std::make_unique<RomDiffCommandHandler>());
55
56 return handlers;
57}
58
59std::vector<std::unique_ptr<resources::CommandHandler>>
61 std::vector<std::unique_ptr<resources::CommandHandler>> handlers;
62
63 // Note: Todo and other heavy agent commands are currently disabled in browser build.
64 // The todo commands use a function-based API (HandleTodoCommand) rather than
65 // CommandHandler classes, and are handled through the terminal bridge directly.
66 // Chat and other complex agent commands are also disabled to avoid complex
67 // dependency chains (curl, threads, etc).
68
69 return handlers;
70}
71
72std::vector<std::unique_ptr<resources::CommandHandler>>
74 std::vector<std::unique_ptr<resources::CommandHandler>> handlers;
75
76 // Add CLI handlers
77 auto cli_handlers = CreateCliCommandHandlers();
78 for (auto& handler : cli_handlers) {
79 handlers.push_back(std::move(handler));
80 }
81
82 // Add agent handlers
83 auto agent_handlers = CreateAgentCommandHandlers();
84 for (auto& handler : agent_handlers) {
85 handlers.push_back(std::move(handler));
86 }
87
88 return handlers;
89}
90
91} // namespace handlers
92} // namespace cli
93} // namespace yaze
94
std::vector< std::unique_ptr< resources::CommandHandler > > CreateAllCommandHandlers()
Factory function to create all command handlers (CLI + agent)
std::vector< std::unique_ptr< resources::CommandHandler > > CreateCliCommandHandlers()
Factory function to create all CLI-level command handlers.
std::vector< std::unique_ptr< resources::CommandHandler > > CreateAgentCommandHandlers()
Factory function to create all agent-specific command handlers.