mirror of
https://github.com/Kelsidavis/WoWee.git
synced 2026-05-10 02:53:51 +00:00
refactor(editor): extract random-* / gen-random-* into cli_random.cpp
Moves the four random-population handlers (--random-populate-zone,
--random-populate-items, --gen-random-zone, --gen-random-project)
out of main.cpp into a new cli_random.{hpp,cpp} module. All four
use the same seeded LCG so re-runs reproduce the same content;
the gen-random-* pair shells out to scaffold-zone +
random-populate-zone + random-populate-items so the simpler
single-purpose handlers stay the source of truth.
main.cpp shrinks by 439 lines (5,788 to 5,349). The inline word
lexicons (creature names, object paths, item prefixes/nouns) move
with random-populate-zone and -items into the new module.
This commit is contained in:
parent
a953142b50
commit
05350becbc
4 changed files with 525 additions and 443 deletions
21
tools/editor/cli_random.hpp
Normal file
21
tools/editor/cli_random.hpp
Normal file
|
|
@ -0,0 +1,21 @@
|
|||
#pragma once
|
||||
|
||||
namespace wowee {
|
||||
namespace editor {
|
||||
namespace cli {
|
||||
|
||||
// Dispatch the random-* / gen-random-* zone-population handlers.
|
||||
// All four use a seeded LCG so re-runs reproduce the same
|
||||
// content; they're intended for playtest scenarios where you
|
||||
// want bulk-populated zones without hand-typing every spawn.
|
||||
// --random-populate-zone add N creatures + M objects to a zone
|
||||
// --random-populate-items add N item records to items.json
|
||||
// --gen-random-zone scaffold + populate + items in one shot
|
||||
// --gen-random-project spawn N gen-random-zones in a raster
|
||||
//
|
||||
// Returns true if matched; outRc holds the exit code.
|
||||
bool handleRandom(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