[US-02] Take turns firing with hit/miss feedback
Implementation Summary
This merge request implements the turn-based firing mechanics for the Battleship game as specified in Issue #2.
Requirements Implemented
- Enforce alternating turns - Game logic ensures players take turns
- Target coordinate selection - Players can select coordinates on opponent's grid
- Hit/miss feedback - Immediate feedback with ShotResult class
- Prevent duplicate firing - Coordinate tracking prevents repeated shots
Key Features Added
-
ShotResultclass to encapsulate shot outcomes (HIT, MISS, ALREADY_TARGETED) - Turn management in
Gameclass - Coordinate validation and tracking
- Comprehensive test coverage for all acceptance criteria
Acceptance Criteria Verified
-
✅ Given A1 has not been targeted, when the player fires at A1, then the result is shown (hit/miss) and A1 becomes marked as used -
✅ Given A1 is already targeted, when the player attempts A1 again, then the system blocks the action and preserves turn order rules -
✅ Given a turn completes, when control passes, then only the next player can act
Pipeline Status
- Previous successful pipeline: #6603
✅ - Current pipeline: #6616 (running)
Closes #2