Detect castle moves via MoveValidator.isCastle and dispatch to
Board.withCastle so both king and rook are moved atomically.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- gameStatus now accepts GameContext instead of Board so legalMoves
(which already requires GameContext for castling) is called directly
without discarding castling rights
- All four existing gameStatus call sites in GameRulesTest migrated to ctx(...)
- New test: castling as sole legal move returns Normal, not Drawn
- GameController.processMove updated to wrap newBoard in GameContext at
the gameStatus call site (full ctx propagation deferred to Task 6)
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Switch legalMoves to the context-aware MoveValidator.legalTargets(ctx, from)
so castling destinations are included, and simulate castle moves via withCastle
when filtering for self-check.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Introduces GameContext (board + per-side CastlingRights), CastleSide enum,
and a Board.withCastle extension method. Also pins missing verification
checksums for com.fasterxml:oss-parent:41 and org.junit:junit-bom:5.9.2.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- Add BlackKing/WhiteKing to capture board in 'legal capture returns Moved'
so the position is not treated as stalemate after the capture.
- Move WhiteKing from A3 to C3 in three MovedInCheck tests so it no
longer blocks the rook's path along file A.
- Remove Console.withOut(System.out) from withInput so it no longer
overrides the ByteArrayOutputStream installed by captureOutput.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Replace stub branches with GameRules.gameStatus dispatch in processMove
and fill in MovedInCheck/Checkmate/Stalemate cases in gameLoop.
Document 6 pre-existing test bugs in docs/unresolved.md.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>