mirror of
https://github.com/Kelsidavis/WoWee.git
synced 2026-05-09 18:43:51 +00:00
Moves the three items.json mutation handlers (--set-item,
--copy-zone-items, --clone-item) out of main.cpp into a new
cli_items_mutate.{hpp,cpp} module. All three operate on the
same {"items": [...]} schema; --set-item supports both
id-lookup ("123") and index-lookup ("#0") with strict
"only changed fields are written" semantics, --copy-zone-items
has replace and --merge modes, --clone-item auto-assigns the
smallest unused id.
main.cpp shrinks by 316 lines (5,087 to 4,771) and finally
drops below 5K. items.json now has its full mutation surface
in one focused module instead of scattered through the
megafile.
18 lines
572 B
C++
18 lines
572 B
C++
#pragma once
|
|
|
|
namespace wowee {
|
|
namespace editor {
|
|
namespace cli {
|
|
|
|
// Dispatch the items.json mutation handlers — edit / duplicate /
|
|
// transfer item records in a zone's items.json.
|
|
// --set-item edit fields on an existing item by id or #idx
|
|
// --copy-zone-items copy items between zones (replace or merge)
|
|
// --clone-item duplicate an item with a fresh id
|
|
//
|
|
// Returns true if matched; outRc holds the exit code.
|
|
bool handleItemsMutate(int& i, int argc, char** argv, int& outRc);
|
|
|
|
} // namespace cli
|
|
} // namespace editor
|
|
} // namespace wowee
|