Brings the Katan rules engine into dev; supersedes closed PR #1 ("Will merge to dev later, then to main").
Katan engine, board, model and heuristic AI (game/catan/*), 51 unit tests, docs/RULES-catan.md.
Shared code: adds Engine.isLegalMove() (default move in legalMoves(...), so existing games are unchanged) and switches MatchController to call it. Catan overrides it because trade offers are too combinatorial to enumerate.
Katan catalogue entry restored (GameCatalog.CATAN, available = false): Coming soon on dev builds, hidden from production until the screen lands. CatalogTest updated to match. This had been dropped with Gitea's old 5c797c8 during the GitHub-lineage migration; CatanRules.kt does not compile without it.
docs/README.md conflict resolved: engine's docs index kept, dead CI.md link pointed at the root README.
Testing
CI dispatched on this branch (run 24): build, unit tests (incl. Catan suite) and lint all green. Nothing published.
Review notes
Not yet reviewed line by line: CatanRules.kt (905 lines).
Merging to dev triggers a dev-channel build and Cloudflare deploy of this code; no playable Katan UI yet.
Worth a dev install to confirm no regression in the other games, since MatchController changed.
## Summary
Brings the Katan rules engine into `dev`; supersedes closed PR #1 ("Will merge to dev later, then to main").
- Katan engine, board, model and heuristic AI (`game/catan/*`), 51 unit tests, `docs/RULES-catan.md`.
- Shared code: adds `Engine.isLegalMove()` (default `move in legalMoves(...)`, so existing games are unchanged) and switches `MatchController` to call it. Catan overrides it because trade offers are too combinatorial to enumerate.
- Katan catalogue entry restored (`GameCatalog.CATAN`, `available = false`): *Coming soon* on dev builds, hidden from production until the screen lands. `CatalogTest` updated to match. This had been dropped with Gitea's old `5c797c8` during the GitHub-lineage migration; `CatanRules.kt` does not compile without it.
- `docs/README.md` conflict resolved: engine's docs index kept, dead `CI.md` link pointed at the root README.
## Testing
CI dispatched on this branch ([run 24](https://git.wallacenet.ca/devadmin/ProLibertateGames/actions/runs/24)): build, unit tests (incl. Catan suite) and lint all green. Nothing published.
## Review notes
- Not yet reviewed line by line: `CatanRules.kt` (905 lines).
- Merging to `dev` triggers a dev-channel build and Cloudflare deploy of this code; no playable Katan UI yet.
- Worth a dev install to confirm no regression in the other games, since `MatchController` changed.
Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01JdMNbY5hLR7FjtfEE712xG
The island game as a pure-Kotlin state machine under game/catan/, wired to
the upstream GameRules / GameAi contract and fully unit-tested on the JVM.
- game/catan/: CatanModel (state, moves, phases), CatanBoard (19-hex
geometry, seeded island generation with the 6/8 separation rule, shared
vertex/edge graph), CatanRules (setup, production, the seven and the
robber, domestic and maritime trade, building, development cards,
Longest Road, Largest Army, win detection), CatanAi (a heuristic opponent
that reads only public information).
- GameRules.isLegalMove: a defaulted structural legality check so a game
with a combinatorial move space (Catan's trade offers) is gated the same
way as one with an enumerated move list; MatchController uses it.
- GameCatalog.CATAN: the catalogue entry, listed but not yet available
(descriptor and screen land with the screen task).
- Tests: 51 across CatanBoardTest, CatanRulesTest and CatanAiTest —
geometry invariants, generation balance, setup, production, the
seven/robber, both trade types, development-card timing, Longest Road
edge cases, Largest Army, win detection, and AI games played to a result.
- docs/RULES-catan.md, in the per-game style, with the rule choices and
the known gaps called out.
Two real engine bugs found and fixed while getting the suite green:
VERTEX_EDGES counted each shared edge once per adjacent hex, so an
interior vertex looked like it had six edges (which also double-counted
segments in the Longest Road search and duplicated setup moves); and the
applyRoll seven-transition was a discarded expression, so a seven never
left AWAIT_ROLL. Three test fixtures rolled from the PLAYING phase and two
assumed a two-seat rotation; corrected to the phases and seat order the
engine actually uses.
Verified: ./gradlew :app:testDebugUnitTest --offline — 679 tests, 0 failures.
Co-Authored-By: Paperclip <[email protected]>
Brings in the Katan rules engine, board, model and AI (WALA-119), its 51 unit
tests and docs/RULES-catan.md. Only conflict was docs/README.md, which the
GitHub-lineage migration had dropped: kept the engine branch's index and
pointed the CI link (docs/CI.md no longer exists) at the root README.
Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01JdMNbY5hLR7FjtfEE712xG
The Option 2 migration dropped Gitea's 5c797c8, which added GameCatalog.CATAN
and a Katan entry (available = false: Coming soon on dev, hidden from
production). CatanRules.kt references GameCatalog.CATAN, so the merge did not
compile without it. Taken verbatim from feature/catan-engine, with the
matching CatalogTest assertions.
Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01JdMNbY5hLR7FjtfEE712xG
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
Summary
Brings the Katan rules engine into
dev; supersedes closed PR #1 ("Will merge to dev later, then to main").game/catan/*), 51 unit tests,docs/RULES-catan.md.Engine.isLegalMove()(defaultmove in legalMoves(...), so existing games are unchanged) and switchesMatchControllerto call it. Catan overrides it because trade offers are too combinatorial to enumerate.GameCatalog.CATAN,available = false): Coming soon on dev builds, hidden from production until the screen lands.CatalogTestupdated to match. This had been dropped with Gitea's old5c797c8during the GitHub-lineage migration;CatanRules.ktdoes not compile without it.docs/README.mdconflict resolved: engine's docs index kept, deadCI.mdlink pointed at the root README.Testing
CI dispatched on this branch (run 24): build, unit tests (incl. Catan suite) and lint all green. Nothing published.
Review notes
CatanRules.kt(905 lines).devtriggers a dev-channel build and Cloudflare deploy of this code; no playable Katan UI yet.MatchControllerchanged.Co-Authored-By: Claude Sonnet 5.5 [email protected]
Claude-Session: https://claude.ai/code/session_01JdMNbY5hLR7FjtfEE712xG