Skip to content

[US-01] Place fleet on a concealed board

Ivan Esau requested to merge feature/issue-1-us-01-place-fleet-on-a-conceal into master

Implementation Summary

This merge request implements the foundation user story for the Battleship game - placing a fleet on a concealed board.

Requirements Implemented

10×10 grid per player - Board class with 10x10 grid implementation Standard fleet with ship lengths - ShipType enum with Carrier (5), Battleship (4), Destroyer (3), Submarine (3), Patrol Boat (2) Placement validation - Horizontal/vertical placement with rejection of diagonal, overlapping, or out-of-bounds placements Concealed ship locations - Each player's ship locations remain hidden from opponent

Core Entities Created

  • Board: 10x10 grid with ship placement and shot tracking
  • Ship: Individual ship with type, positions, and damage tracking
  • Coordinate: Grid position management
  • ShipType: Enum with standard fleet ship types and lengths
  • Game: Main game controller (foundation for future stories)
  • Player: Base player class
  • GameState: Game state management

Acceptance Criteria Verified

AC1: Given a ship partly outside the grid, when placement is attempted, then the system rejects it with an error and no placement occurs AC2: Given two ships sharing any square, when the second is placed, then placement is rejected and existing ships remain unchanged AC3: Given a valid layout, when all ships are placed, then the board is marked ready and remains hidden from the opponent

Technical Details

  • Java 21 with Maven build system
  • JUnit 5 tests with comprehensive coverage
  • Layered architecture following planning documents
  • All tests passing in successful pipeline #6565

Closes #1

Merge request reports

Loading