diff --git a/src/main/java/BattleShip/Ship.java b/src/main/java/BattleShip/Ship.java index 292d55d..40c9648 100644 --- a/src/main/java/BattleShip/Ship.java +++ b/src/main/java/BattleShip/Ship.java @@ -23,4 +23,13 @@ public class Ship { public boolean isKilled() { return kill; } + + public boolean counter() { + //Count hits until number of hits equals ship length, then mark as killed. + numOfHits++; + if(numOfHits == length) { + kill = true; + } + return kill; + } }