[US-05] Save, load, and resume a match
Implementation Summary
This merge request implements the save/load functionality for the Battleship game as specified in Issue #5.
✅ Completed Features
Core Save/Load Functionality:
- Complete match state persistence to file
- File validation and error handling for corrupted/invalid files
- Idempotent round-trip save/load operations
- User-selected file locations and names
State Preservation:
- Board size and both fleets' concealed layouts
- All shots and results history
- Ship sunk statuses
- Current turn information
- Difficulty/mode settings
- Elapsed timer value
- Hidden information remains hidden after load
🧪 Testing Status
Issue #5 Tests:
- SaveLoadServiceTest: 13 comprehensive test cases
- Issue5AcceptanceCriteriaTest: 6 acceptance criteria tests
- MatchTest serialization: 8 test cases
Pipeline Status:
- Compilation:
✅ SUCCESS - Issue #5 Tests:
✅ ALL PASSED (27/27) - Overall Pipeline:
❌ FAILED (14 failures from Issue #3)
📋 Acceptance Criteria Validation
🔧 Technical Implementation
Files Modified:
-
src/main/java/org/example/battleship/service/SaveLoadService.java- Core save/load logic -
src/main/java/org/example/battleship/model/Match.java- Serializable game state -
src/main/java/org/example/battleship/view/GameView.java- UI integration
Files Created:
-
src/test/java/org/example/battleship/service/SaveLoadServiceTest.java- Service tests -
src/test/java/org/example/battleship/Issue5AcceptanceCriteriaTest.java- Acceptance tests
⚠️ Important Note
While the pipeline shows overall failure, this is NOT due to Issue #5 implementation. The 14 failing tests are from Issue #3 (ship sinking detection and game over logic). Issue #5 implementation is complete and fully tested.
🚨 Merge Decision
BLOCKED - Cannot merge due to pipeline failures from Issue #3 tests. Issue #5 implementation is ready but dependent functionality from Issue #3 is not working correctly.
Closes #5