Modern-Apps.git
Publicgit clone https://git.maproj.org/Modern-Apps.gitModern-Apps.git / games / pipes / AGENTS.md
| 1 | # AGENTS.md — games/pipes/ (':games:pipes') |
| 2 | |
| 3 | > Scoped supplement. Global rules in root `AGENTS.md` apply. Stay inside `games/pipes/` + allowed shared modules. Do not root-scan. |
| 4 | |
| 5 | _Install: ./install games/pipes (dev by default)._ |
| 6 | - Gradle: :games:pipes / dir: games/pipes/ |
| 7 | - Package roots present: ui, data, domain, platform |
| 8 | - Entry files: MainActivity.kt, Route.kt, Navigation.kt |
| 9 | - Deps: :library:work |
| 10 | - Metadata: metadata_data/games-pipes.md (present) |
| 11 | - Rust: no / screenshotTest: yes |
| 12 | |
| 13 | ## Overview |
| 14 | **Purpose:** Numberlink-style pipe connection — connect colors to fill the board; packs + levels + shared daily board. 100% offline. |
| 15 | **Game shape:** `ui/` board + pack/level screens + daily → `platform/PipesViewModel` → `domain/` generator + solver → `data/` completed-levels + models; dailies via `:library:work`; achievements via :library's AchievementsManager → `:sdk:games` → hub. |
| 16 | **Entry points:** `Route` → `MainActivity.kt` → `Navigation.kt` → `ui/GameBoardScreen.kt` → `platform/PipesViewModel.kt` → `domain/LevelGenerator.kt`. |
| 17 | **Gotchas:** Daily boards derive from the date — same date must yield the same board on every device. |
| 18 | |
| 19 | ## Key files |
| 20 | ### Root — entry + navigation |
| 21 | - com/vayunmathur/games/pipes/MainActivity.kt |
| 22 | - com/vayunmathur/games/pipes/Navigation.kt |
| 23 | - com/vayunmathur/games/pipes/Route.kt |
| 24 | ### data/ + domain/ — levels + generation |
| 25 | - com/vayunmathur/games/pipes/data/PipeModels.kt |
| 26 | - com/vayunmathur/games/pipes/data/CompletedLevelsRepository.kt |
| 27 | - com/vayunmathur/games/pipes/domain/LevelGenerator.kt — carve-cover generator with `PipesDifficulty` tiers (CASUAL/STANDARD/EXPERT shaping flow length, turn rate, flow count and anti-greedy pressure), seeded split points, solver-verified UNIQUE boards, and `PipesLevelMetrics`/`generateSeeded` for deterministic generation. Harder tiers steer carves off edges, away from their start and alongside rival flows, then reject levels whose greedy fraction, interior-endpoint fraction or decoy adjacencies miss the tier gates. Generation is bounded per tier (500/1000/1200 attempts) and is an offline asset tool, never a runtime path |
| 28 | - com/vayunmathur/games/pipes/domain/GreedySolver.kt — deterministic no-backtracking greedy simulator (edge endpoints first, forced/uncontested extensions, same-flow corridors); `GreedyResult.filledFraction`/`solved` score how much of a level the greedy edge strategy fills |
| 29 | - com/vayunmathur/games/pipes/domain/NumberlinkSolver.kt |
| 30 | - com/vayunmathur/games/pipes/domain/DailyLevels.kt |
| 31 | ### platform/ — ViewModel + achievements |
| 32 | - com/vayunmathur/games/pipes/platform/PipesViewModel.kt |
| 33 | - com/vayunmathur/games/pipes/platform/PipesUiContract.kt |
| 34 | - com/vayunmathur/games/pipes/platform/PipesAchievementsManager.kt |
| 35 | - com/vayunmathur/games/pipes/platform/AppBackupAgent.kt |
| 36 | ### ui/ — board, packs, daily |
| 37 | - com/vayunmathur/games/pipes/ui/GameBoardScreen.kt |
| 38 | - com/vayunmathur/games/pipes/ui/GameBoard.kt |
| 39 | - com/vayunmathur/games/pipes/ui/GameScreen.kt |
| 40 | - com/vayunmathur/games/pipes/ui/LevelScreen.kt |
| 41 | - com/vayunmathur/games/pipes/ui/PackScreen.kt |
| 42 | - com/vayunmathur/games/pipes/ui/PackListScreen.kt |
| 43 | - com/vayunmathur/games/pipes/ui/DailyLevelScreen.kt |
| 44 | - com/vayunmathur/games/pipes/ui/SettingsScreen.kt |
| 45 | - com/vayunmathur/games/pipes/ui/PipeRenderer.kt |
| 46 | - com/vayunmathur/games/pipes/ui/PipeColors.kt |
| 47 | - com/vayunmathur/games/pipes/ui/Theme.kt |
| 48 | - com/vayunmathur/games/pipes/ui/components/LevelThumbnail.kt |
| 49 | |
| 50 | ## Verify (this module only) |
| 51 | ``` |
| 52 | ./gradlew :games:pipes:compileDevKotlin |
| 53 | ./gradlew :games:pipes:lint |
| 54 | ./gradlew :games:pipes:checkMetadata |
| 55 | ``` |