mirror of
https://github.com/Kelsidavis/WoWee.git
synced 2026-05-09 18:43:51 +00:00
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).
20 lines
709 B
C++
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
|