Modern-Apps.git
Publicgit clone https://git.maproj.org/Modern-Apps.gitModern-Apps.git / games / nonogram / AGENTS.md
| 1 | # AGENTS.md — games/nonogram/ (':games:nonogram') |
| 2 | |
| 3 | > Scoped supplement. Global rules in root `AGENTS.md` apply. Stay inside `games/nonogram/` + allowed shared modules. Do not root-scan. |
| 4 | |
| 5 | _Install: ./install games/nonogram (dev by default)._ |
| 6 | - Gradle: :games:nonogram / dir: games/nonogram/ |
| 7 | - Package roots present: ui, data, domain, platform |
| 8 | - Entry files: MainActivity.kt, Route.kt, Navigation.kt |
| 9 | - Deps: :sdk:games, :library:work |
| 10 | - Metadata: metadata_data/games-nonogram.md (present) |
| 11 | - Rust: no / screenshotTest: yes |
| 12 | |
| 13 | ## Overview |
| 14 | **Purpose:** Picture-logic puzzles — fill from number clues to reveal the picture; gated levels + shared daily board; every puzzle solvable by reasoning alone. 100% offline. |
| 15 | **Game shape:** `ui/` board + settings → `platform/NonogramViewModel` → `domain/` generator + solver → `data/` store; dailies via `:library:work`; achievements → `:sdk:games` → hub. |
| 16 | **Entry points:** `Route` → `MainActivity.kt` → `Navigation.kt` → `ui/NonogramGameScreen.kt` → `platform/NonogramViewModel.kt` → `domain/NonogramGenerator.kt`. |
| 17 | **Clue greying:** `domain/NonogramClues.kt` derives per-clue greyed state from the placed fills (display-only, recomputed by `ui/components/BoardClues.kt`, never persisted). A clue greys only as part of an exact prefix/suffix run match. |
| 18 | **Auto-crosses:** When a row/column's placed fills equal its clue sum, `NonogramClues.withAutoCrosses` (applied by the ViewModel on every commit and on load) fills its remaining blank cells into `NonogramGameState.autoCrossed` — real persisted cell state, kept apart from the player's own `crossed` so re-derivation never removes a manual cross. Noting an auto-crossed cell promotes it to a manual cross. |
| 19 | **Gotchas:** Solvability-by-reasoning is the guarantee — generator changes must pass the solver check. |
| 20 | |
| 21 | ## Key files |
| 22 | ### Root — entry + navigation |
| 23 | - com/vayunmathur/games/nonogram/MainActivity.kt |
| 24 | - com/vayunmathur/games/nonogram/Navigation.kt |
| 25 | - com/vayunmathur/games/nonogram/Route.kt |
| 26 | ### data/ + domain/ — puzzles + generation |
| 27 | - com/vayunmathur/games/nonogram/data/NonogramModels.kt |
| 28 | - com/vayunmathur/games/nonogram/data/NonogramPuzzle.kt |
| 29 | - com/vayunmathur/games/nonogram/data/NonogramDataStore.kt |
| 30 | - com/vayunmathur/games/nonogram/domain/NonogramGenerator.kt |
| 31 | - com/vayunmathur/games/nonogram/domain/NonogramSolver.kt |
| 32 | - com/vayunmathur/games/nonogram/domain/NonogramClues.kt |
| 33 | - com/vayunmathur/games/nonogram/domain/NonogramMoves.kt |
| 34 | - com/vayunmathur/games/nonogram/domain/NonogramStrokes.kt |
| 35 | ### platform/ — ViewModel + achievements |
| 36 | - com/vayunmathur/games/nonogram/platform/NonogramViewModel.kt |
| 37 | - com/vayunmathur/games/nonogram/platform/NonogramUiContract.kt |
| 38 | - com/vayunmathur/games/nonogram/platform/NonogramAchievementsManager.kt |
| 39 | - com/vayunmathur/games/nonogram/platform/AppBackupAgent.kt |
| 40 | ### ui/ — board + settings |
| 41 | - com/vayunmathur/games/nonogram/ui/NonogramGameScreen.kt |
| 42 | - com/vayunmathur/games/nonogram/ui/NonogramGamePage.kt |
| 43 | - com/vayunmathur/games/nonogram/ui/SettingsPage.kt |
| 44 | - com/vayunmathur/games/nonogram/ui/components/NonogramBoard.kt |
| 45 | |
| 46 | ## Verify (this module only) |
| 47 | ``` |
| 48 | ./gradlew :games:nonogram:compileDevKotlin |
| 49 | ./gradlew :games:nonogram:testDevUnitTest |
| 50 | ./gradlew :games:nonogram:lint |
| 51 | ./gradlew :games:nonogram:checkMetadata |
| 52 | ``` |