Skip to content

[US-02] Alternating shooting with feedback

Ivan Esau requested to merge feature/issue-2-us-02-alternating-shooting-wit into master

Description

Implements alternating shooting functionality for the Battleship game as described in issue #2.

Changes

  • Added Game class to manage game state and alternating turns
  • Added Player class to represent players and handle shooting logic
  • Enhanced Board class with shot tracking and validation
  • Added comprehensive tests for alternating shooting functionality
  • Fixed compilation issues with missing Orientation enum and constructor in Ship class

Features Implemented

  • Players take turns shooting at each other's boards
  • Shot validation prevents duplicate shots and invalid coordinates
  • Feedback provided for hits, misses, and invalid shots
  • Game state tracks current player and game over conditions
  • All acceptance criteria from issue #2 are met

Acceptance Criteria Verified

When firing at A1 for the first time, a message appears showing hit or miss, and that field becomes marked When the same field is targeted again, the shot does not go through, and the next player acts After one shot cycle finishes, the control changes so that only the other player can continue

Closes #2

Merge request reports

Loading