Kelsidavis-WoWee/tools/editor/cli_add.hpp
Kelsi 7af7534dc6 refactor(editor): extract add-* append handlers into cli_add.cpp
Moves the three add-* coordinate-based append handlers
(--add-object, --add-creature, --add-item) out of main.cpp
into a new cli_add.{hpp,cpp} module. All three append a
single entry to a zone's JSON file with optional positional
args after the required ones. --add-item handles raw
nlohmann::json (no dedicated editor class) and auto-assigns
the smallest unused id when the user passes 0 / nothing.

main.cpp shrinks by 198 lines (5,986 to 5,788).
2026-05-09 08:16:52 -07:00

20 lines
709 B
C++

#pragma once
namespace wowee {
namespace editor {
namespace cli {
// Dispatch the add-* append-by-coords handlers — append a
// single creature spawn / object placement / item record to a
// zone's JSON files. Useful for batch-populating zones via
// shell scripts without launching the GUI placement tool.
// --add-object <zone> <m2|wmo> <gamePath> <x> <y> <z> [scale]
// --add-creature <zone> <name> <x> <y> <z> [displayId] [level]
// --add-item <zone> <name> [id] [quality] [displayId] [itemLevel]
//
// Returns true if matched; outRc holds the exit code.
bool handleAdd(int& i, int argc, char** argv, int& outRc);
} // namespace cli
} // namespace editor
} // namespace wowee