refactor(editor): extract --info-{zone,project}-water into cli_info_water.cpp

Moves the two water-layer audit handlers (--info-zone-water,
--info-project-water) out of main.cpp into a new
cli_info_water.{hpp,cpp} module. Both aggregate liquid data
(water/ocean/magma/slime) across MH2O chunks; the project
variant rolls per-zone counts into a project-wide total with
height range and per-type histogram.

main.cpp shrinks by 209 lines (7,463 to 7,254). Both --json
output modes preserved for capacity-planning pipelines.
This commit is contained in:
Kelsi 2026-05-09 07:28:15 -07:00
parent 8d71618c28
commit a25961e2dd
4 changed files with 281 additions and 213 deletions

View file

@ -0,0 +1,22 @@
#pragma once
namespace wowee {
namespace editor {
namespace cli {
// Dispatch the water-layer audit handlers — aggregate liquid
// data (water/ocean/magma/slime) across a zone or project.
// Useful for confirming a 'lake zone' actually carries water,
// or for budget planning when many zones share liquid types.
// --info-zone-water drill into one zone's MH2O layers
// --info-project-water project-wide rollup with per-zone rows
//
// Both support an optional trailing `--json` flag for
// machine-readable reports.
//
// Returns true if matched; outRc holds the exit code.
bool handleInfoWater(int& i, int argc, char** argv, int& outRc);
} // namespace cli
} // namespace editor
} // namespace wowee