Browse Source

update

main
fdai4581 2 years ago
parent
commit
d1ee2fe878
  1. 9
      src/main/java/BattleShip/Ship.java

9
src/main/java/BattleShip/Ship.java

@ -23,4 +23,13 @@ public class Ship {
public boolean isKilled() { public boolean isKilled() {
return kill; 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;
}
} }
Loading…
Cancel
Save