Class AttackReport

java.lang.Object
battleship.model.game.AttackReport

public class AttackReport extends Object
  • Constructor Details

  • Method Details

    • getPointsOccupiedByShip

      public List<Point> getPointsOccupiedByShip()
      Returns:
      List of points occupied by ship
    • getShip

      public Ship getShip()
      Ship which was under attack
      Returns:
      null if missed, ship type if sunk
    • getResult

      public AttackReport.HitResult getResult()
      Returns:
      HitResult
    • getPosition

      public Point getPosition()
      Get the position being attacked.
      Returns:
      Point (x, y)
    • getFleetHealthRemaining

      public int getFleetHealthRemaining()
      Returns:
      total health remaining.
    • getResult

      public static AttackReport.HitResult getResult(int health)
      Parameters:
      health - health remaining of the ship.
      Returns:
      HitResult
    • getMissedResult

      public static AttackReport.HitResult getMissedResult()
      Returns:
      HitResult.MISS