[US-04] Single-player mode vs. computer opponent
Implementation Summary
This merge request implements single-player mode against a computer opponent with the following features:
Core Requirements Implemented:
- Single-Player Mode: Computer places a legal fleet automatically (no overlaps/out-of-bounds, standard sizes)
- Computer Turn Logic: Computer selects valid untargeted coordinates and avoids repeats
-
Difficulty Options:
- Easy: Random shots
- Standard: After a hit, preferentially targets adjacent cells until ship is sunk
Key Components:
-
ComputerPlayerclass with automatic ship placement and shot generation -
SinglePlayerGameServiceextending base game service for single-player flow -
Difficultyenum for Easy/Standard difficulty levels - Comprehensive test coverage for acceptance criteria
Acceptance Criteria Verified:
-
✅ AC1: Single-player game initializes with computer fleet that exists, is legal, and hidden -
✅ AC2: Computer takes turns with untargeted coordinates (never repeats shots) -
✅ AC3: Standard difficulty targets adjacent cells after hits until ship is sunk
Technical Implementation:
- Layered architecture following planning documents
- Model-View-Controller pattern
- Java 21 with Maven build system
- JUnit 5 test framework with JaCoCo coverage
Closes #4