Package battleship
Interface IShip
public interface IShip
The interface Ship.
-
Method Summary
Modifier and TypeMethodDescriptionGets positions.Gets bearing.intGets bottom most pos.Gets category.intGets left most pos.Gets position.Gets positions.intGets right most pos.getSize()Gets size.intGets top most pos.booleanOccupies boolean.voidShoot.voidsink()Sink.booleanStill floating boolean.booleantooCloseTo(IPosition pos) Too close to boolean.booleantooCloseTo(IShip other) Too close to boolean.
-
Method Details
-
getCategory
String getCategory()Gets category.- Returns:
- the category
-
getSize
Integer getSize()Gets size.- Returns:
- the size
-
getPositions
Gets positions.- Returns:
- the positions
-
getAdjacentPositions
Gets positions.- Returns:
- the adjacent positions
-
getPosition
IPosition getPosition()Gets position.- Returns:
- the position
-
getBearing
Compass getBearing()Gets bearing.- Returns:
- the bearing
-
stillFloating
boolean stillFloating()Still floating boolean.- Returns:
- the boolean
-
getTopMostPos
int getTopMostPos()Gets top most pos.- Returns:
- the top most pos
-
getBottomMostPos
int getBottomMostPos()Gets bottom most pos.- Returns:
- the bottom most pos
-
getLeftMostPos
int getLeftMostPos()Gets left most pos.- Returns:
- the left most pos
-
getRightMostPos
int getRightMostPos()Gets right most pos.- Returns:
- the right most pos
-
occupies
Occupies boolean.- Parameters:
pos- the pos- Returns:
- the boolean
-
tooCloseTo
Too close to boolean.- Parameters:
other- the other- Returns:
- the boolean
-
tooCloseTo
Too close to boolean.- Parameters:
pos- the pos- Returns:
- the boolean
-
shoot
Shoot.- Parameters:
pos- the pos
-
sink
void sink()Sink.
-