[US-05] Saving and restoring the game
Description
Implements save/load functionality for the Battleship game as specified in Issue #5 (closed).
Changes
- Added
GameStateclass for serializable game state - Created
SaveServicefor save/load operations with error handling - Added
FileUtilutility class for file operations - Comprehensive test coverage for all acceptance criteria
Features Implemented
Acceptance Criteria Verified
-
✅ If game is saved and loaded right away, all visible parts and internal values are identical -
✅ If corrupted file is loaded, error is displayed and game remains unchanged -
✅ If completed game is saved and loaded, it stays finished and waits for new start
Technical Details
- Uses Java serialization for game state persistence
- Comprehensive error handling and validation
- Test coverage for all edge cases
- Follows layered architecture pattern
Closes #5 (closed)