Modern Apps git
git clone https://git.maproj.org/Modern-Apps.git
main ▾

Modern-Apps.git / games / arrows / AGENTS.md

AGENTS.md3.6 KiBRenderedCodeRaw
1# AGENTS.md — games/arrows/ (':games:arrows')
2
3> Scoped supplement. Global rules in root `AGENTS.md` apply. Stay inside `games/arrows/` + allowed shared modules. Do not root-scan.
4
5_Install: ./install games/arrows (dev by default)._
6- Gradle: :games:arrows / dir: games/arrows/
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-arrows.md (present)
11- Rust: no / screenshotTest: yes
12
13## Overview
14**Purpose:** Order-clearing arrow puzzle — every arrow must fly off unblocked; redirectors from level 11; daily board + 3-hearts escape overlay. 100% offline.
15**Game shape (shared across MA games):** `ui/` board + screens → `platform/*ViewModel` (+ `UiContract`) → `domain/` pure rules/generator (+ solver where present) → `data/` progress store; achievements via `platform/*AchievementsManager` (:library) → `:sdk:games` → hub; daily boards via `:library:work`.
16**Entry points:** `Route` → `MainActivity.kt` → `Navigation.kt` → `platform/ArrowsViewModel.kt` → `domain/ArrowsRules.kt`.
17**Gotchas:** Every generated board must be clearable — generator changes need solvability checks. Every generated board with mirrors must also be unclearable without them (`ArrowsAnalysis.requiresMirrors`, checked with the real solver in the generator gate and in `ArrowsMirrorNecessityTest`/`GeneratedBoardPropertiesTest`); mirror *use* (`mirrorUseCount`) alone does not satisfy this.
18
19## Key files
20### Root — entry + navigation
21- com/vayunmathur/games/arrows/MainActivity.kt
22- com/vayunmathur/games/arrows/Navigation.kt
23- com/vayunmathur/games/arrows/Route.kt
24### data/ + domain/ — progress + pure rules
25- com/vayunmathur/games/arrows/data/ArrowModels.kt
26- com/vayunmathur/games/arrows/data/ArrowsDataStore.kt
27- com/vayunmathur/games/arrows/domain/ArrowsGenerator.kt — reverse-removal-order generator; accepts `ArrowsDifficulty` (opening cap, dependency-depth floor, piece length, depth-weighted candidate scoring), steers candidates toward forced bounces at mirror chokepoints, and verifies boards with `ArrowsRules.solve`. A board with mirrors is rejected unless `ArrowsAnalysis.requiresMirrors` holds; boards without mirrors are unaffected, and asked-for mirrors are never conceded to zero
28- com/vayunmathur/games/arrows/domain/ArrowsAnalysis.kt — `ArrowsDifficulty` tiers, `ArrowsBoardMetrics`/`dependencyDepth` analysis, mirror necessity (`requiresMirrors`: clearable with mirrors, unclearable with all mirrors removed per `ArrowsRules.solve`; `requiredMirrorCount`: individually load-bearing mirrors — use on a route is not necessity), and the level-to-difficulty mapping (CASUAL <11, STANDARD <40, EXPERT ≥40; mirrors arrive at level 11 in STANDARD, so the first single-mirror boards teach a forced bounce)
29- com/vayunmathur/games/arrows/domain/ArrowsRules.kt
30### platform/ — ViewModel + achievements
31- com/vayunmathur/games/arrows/platform/ArrowsViewModel.kt
32- com/vayunmathur/games/arrows/platform/ArrowsUiContract.kt
33- com/vayunmathur/games/arrows/platform/ArrowsAchievementsManager.kt
34- com/vayunmathur/games/arrows/platform/AppBackupAgent.kt
35### ui/ — board + screens
36- com/vayunmathur/games/arrows/ui/ArrowsGameScreen.kt
37- com/vayunmathur/games/arrows/ui/ArrowsGamePage.kt
38- com/vayunmathur/games/arrows/ui/SettingsPage.kt
39- com/vayunmathur/games/arrows/ui/components/ArrowsBoard.kt
40- com/vayunmathur/games/arrows/ui/components/ArrowsBoardDrawing.kt
41
42## Verify (this module only)
43```
44./gradlew :games:arrows:compileDevKotlin
45./gradlew :games:arrows:lint
46./gradlew :games:arrows:checkMetadata
47```