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 core ship placement functionality for the Battleship game as specified in US-01.

Requirements Implemented

10×10 grid per player - Implemented in Board class with GRID_SIZE = 10 Standard fleet with ship lengths - Carrier (5), Battleship (4), Destroyer (3), Submarine (3), Patrol Boat (2) implemented in Ship.Type enum Placement validation - Horizontal/vertical placement with bounds checking and overlap prevention in Board.placeShip() Concealment - Ship locations are encapsulated and hidden from opponents

Core Components

  • Board - Manages 10x10 grid, ship placement validation, and fleet completeness
  • Ship - Represents individual ships with type, position, and orientation
  • Coordinate - Validates grid bounds and provides coordinate operations
  • Player - Base class for managing individual player state

Acceptance Criteria Validation

Out-of-bounds rejection - Coordinate.isValid() and Board.placeShip() prevent out-of-bounds placements Overlap prevention - Ship.overlapsWith() and Board.placeShip() prevent overlapping ships Board readiness - Board.markReady() only succeeds when standard fleet is complete

Test Coverage

  • CoordinateTest - Comprehensive bounds validation and coordinate operations
  • BoardTest - 12 test methods covering placement, validation, fleet management
  • ShipTest - 12 test methods covering creation, positioning, overlap detection

Pipeline Status

  • Pipeline #8113: SUCCESS (compile_job ✓, test_job ✓)
  • Current Status: Implementation validated and ready for merge
  • Technical Issue: System-level merge blocking (not implementation-related)

Closes #1

Edited by Ivan Esau

Merge request reports

Loading