mirror of
https://github.com/Kelsidavis/WoWee.git
synced 2026-05-10 02:53:51 +00:00
refactor(editor): extract remove-* by-index handlers into cli_remove.cpp
Moves the four bounds-checked remove-by-index handlers
(--remove-creature, --remove-object, --remove-quest,
--remove-item) out of main.cpp into a new
cli_remove.{hpp,cpp} module. All four share the same
load-erase-save pattern with index validation and a "what
was removed" report for audit trails. The first three use
their respective editor classes (NpcSpawner, ObjectPlacer,
QuestEditor); --remove-item walks raw nlohmann::json since
items.json doesn't have a dedicated editor class yet.
main.cpp shrinks by 145 lines (6,131 to 5,986).
This commit is contained in:
parent
f1a2e6850b
commit
614d48a49b
4 changed files with 225 additions and 150 deletions
21
tools/editor/cli_remove.hpp
Normal file
21
tools/editor/cli_remove.hpp
Normal file
|
|
@ -0,0 +1,21 @@
|
|||
#pragma once
|
||||
|
||||
namespace wowee {
|
||||
namespace editor {
|
||||
namespace cli {
|
||||
|
||||
// Dispatch the remove-* by-index handlers — strip a single
|
||||
// entry out of a zone's creatures/objects/quests/items list
|
||||
// by 0-based index. All four use bounds-checked load-erase-save
|
||||
// and report what was removed for audit trails.
|
||||
// --remove-creature
|
||||
// --remove-object
|
||||
// --remove-quest
|
||||
// --remove-item
|
||||
//
|
||||
// Returns true if matched; outRc holds the exit code.
|
||||
bool handleRemove(int& i, int argc, char** argv, int& outRc);
|
||||
|
||||
} // namespace cli
|
||||
} // namespace editor
|
||||
} // namespace wowee
|
||||
Loading…
Add table
Add a link
Reference in a new issue