Skip to content

[US-03] Track ship damage, announce sunk, and end the game

Ivan Esau requested to merge feature/issue-3-us-03-track-ship-damage-announ into master

Implementation Status: BLOCKED - Pipeline Failed

Issue: #3 - Track ship damage, announce sunk, and end the game

Current State

  • Implementation partially complete but contains critical bugs
  • Pipeline #6820 FAILED with 11 test failures
  • Core ship sinking and game ending functionality broken

Requirements Analysis

System Requirements:

  1. Track hits per ship and determine when all squares of a ship are hit - PARTIAL
  2. Upon completion, announce the ship as 'sunk' - BROKEN
  3. When all ships of a player are sunk, declare victory for the opponent and disable further input - BROKEN
  4. Provide New Game to start a fresh match - IMPLEMENTED

Acceptance Criteria Status

AC1: Given the last undamaged square of a ship is hit, when the result is processed, then that ship is announced 'sunk' - FAILING AC2: Given the final enemy ship is sunk, when the board updates, then the match ends, the winner is indicated, and no further shots are allowed - FAILING AC3: Given a finished match, when New Game is chosen, then both boards reset to covered, unplaced state - PASSING

Technical Issues Identified

  1. Ship Sinking Detection: Ships not marked as sunk when all positions hit
  2. Game Ending Logic: Game continues even when all ships destroyed
  3. Shot Result Logic: Always returns HIT instead of SUNK/SUNK_AND_VICTORY
  4. Fleet Destruction: isFleetDestroyed() method not working correctly

Test Results

  • Total Tests: 75
  • Failures: 11
  • Success Rate: 85.3%
  • Critical Failures: All acceptance criteria tests failing

Required Fixes

  1. Fix ship sinking detection in GameService.fireShot()
  2. Implement proper game ending when fleet destroyed
  3. Correct shot result logic for SUNK and SUNK_AND_VICTORY
  4. Ensure fleet destruction detection works correctly

Merge Decision

🚫 BLOCKED - Pipeline failures prevent merge. Implementation requires fixes from Coding Agent.

Closes #3

Merge request reports

Loading