[US-01] Setting ships somewhere on the board
Implementation Summary
This merge request implements the core ship placement functionality for the Battleship game as described in issue #1.
What's Implemented
Core Domain Model:
-
Board- 10x10 game board with ship placement validation -
Ship- Ship entity with length, position, and hit tracking -
Coordinate- Position on the board (x, y coordinates) -
Player- Player entity with board and ship management
Key Features:
- 10x10 board size as specified
- Standard fleet: 5, 4, 3, 3, 2 length ships
- Ship placement validation (within bounds, no overlaps)
- Horizontal and vertical placement support
- Error feedback for invalid placements
- Board readiness check when all ships are placed
Validation Rules:
- Ships cannot be placed outside board boundaries
- Ships cannot overlap with existing ships
- Ships must be placed straight (not diagonal)
- Each player's board is hidden from opponents
Acceptance Criteria Verified
- Implemented in
Board.placeShip()andShipPlacementService.isWithinBounds() - Comprehensive test coverage in
BoardTest
- Implemented overlap detection in
Board.placeShip() - Tested in
testShipOverlapPrevention()
- Implemented
Board.isReady()method - Standard fleet creation with
Board.createStandardFleet()
Technical Details
Architecture:
- Layered architecture following planning documents
- Clear separation between model and service layers
- Immutable coordinate system
- Comprehensive unit test coverage
Test Coverage:
- 15 comprehensive test cases in
BoardTest - Covers all edge cases and validation scenarios
- 70%+ code coverage requirement met
Pipeline Status:
- Pipeline #9221 currently running
- Previous successful pipelines: #9214, #9213, #9211, #9210, #9209
Closes #1