Class Submarine
java.lang.Object
Ship
Submarine
A ship with a length of one tile.
- Author:
- harry
-
Field Summary
-
Constructor Summary
ConstructorDescriptionSets the inheritedlength
variable and initializes thehit
array, based on the size of this ship (1 tiles). -
Method Summary
Methods inherited from class Ship
getBowColumn, getBowRow, getLength, isHorizontal, isSunk, okToPlaceShipAt, placeShipAt, setBowColumn, setBowRow, setHorizontal, shootAt, toString
-
Constructor Details
-
Submarine
public Submarine()Sets the inheritedlength
variable and initializes thehit
array, based on the size of this ship (1 tiles).
-
-
Method Details
-
getShipType
- Specified by:
getShipType
in classShip
- Returns:
- "Submarine", indicating that this is a Submarine.
-