[US-03] Track ship damage, announce sunk, and end the game
Description
Implements ship damage tracking, sunk announcements, and game ending functionality for Battleship game.
Changes
- Added ship damage tracking with hit recording
- Implemented ship sunk detection and announcements
- Added game ending logic when all ships are sunk
- Implemented new game functionality
- Added comprehensive test coverage
Requirements Implemented
Acceptance Criteria Validated
Technical Details
- Added
Ship.isSunk()method to detect when all positions are hit - Enhanced
Game.processShot()to handle sunk ships and game ending - Added
Player.hasLost()to check if all ships are sunk - Implemented
Game.newGame()for reset functionality - Comprehensive test coverage in
ShipTest.javaandGameTest.java
Closes #3