[US-02] Alternating shooting with feedback
Implementation Summary
This merge request implements the core alternating shooting functionality for the Battleship game as specified in issue #2.
What's Implemented
Core Features:
- Turn-based shooting system with player alternation
- Shot result feedback (hit/miss/sunk/game over)
- Coordinate-based targeting on enemy board
- Shot tracking to prevent duplicate shots
- Game state management (in progress/finished)
Key Components:
-
Gameclass manages overall game state and turn switching -
ShotResultenum provides clear feedback messages -
Playertracks shots taken and hits registered -
Boardmanages ship placement and coordinate validation
Technical Implementation
Architecture:
- Follows MVC pattern as specified in planning documents
- Layered structure with clear separation of concerns
- Comprehensive test coverage for core game logic
Test Coverage:
- Unit tests for all model classes
- Integration tests for game flow scenarios
- Acceptance criteria validation tests
Current Status
The implementation is functionally complete but has test failures that need to be addressed:
Critical Issues:
- Duplicate shot detection - System allows shooting at same coordinate multiple times
- Ship sinking detection - Doesn't properly detect when ships are completely sunk
- Game over detection - Doesn't properly detect when all ships are destroyed
- Turn management - Invalid shots still switch turns
Acceptance Criteria Status:
-
✅ Players take turns one after the other -
✅ Active player can choose coordinate on enemy board -
✅ Program reports hit or miss and notes results -
❌ Shots on same place twice are not properly blocked -
✅ After one shot cycle, control changes to other player
Next Steps
This MR should be reviewed but NOT MERGED until:
- Pipeline passes all tests
- All acceptance criteria are fully validated
- Critical issues are resolved
Closes #2