[US-05] Save, load, and resume a match
Implementation Summary
This merge request implements the save, load, and resume functionality for the Battleship game as specified in issue #5.
Features Implemented
- Complete Game State Persistence: Save all game state including board configurations, ship placements, shot history, sunk statuses, current turn, difficulty mode, and timer values
- File Validation: Comprehensive validation for file integrity, version compatibility, and corruption detection
- Idempotent Round-trip: Save and load operations preserve exact game state without modification
- User File Selection: Allow users to choose file locations and names for save/load operations
- Error Handling: Graceful error handling for corrupted, missing, or incompatible files
Technical Implementation
- Serialization: JSON-based serialization for human-readable save files
- State Management: Complete game state capture and restoration
- File I/O: Robust file operations with comprehensive error handling
- Validation: Version checking and data integrity validation
Acceptance Criteria Met
-
✅ Mid-game state preservation: Save and load maintains exact game state -
✅ Corrupted file handling: Error reporting without modifying current game -
✅ Finished game preservation: Loaded finished games remain in completed state
Closes #5