public interface FieldCell
extends java.io.Serializable
State
Modifier and Type | Method and Description |
---|---|
java.util.Optional<Ship> |
getShip()
Returns an Optional of Ship.
|
boolean |
isEmpty()
Returns
true if this field cell is empty. |
boolean |
isHit()
Returns
true if a Ship is hit. |
boolean |
isMissed()
Returns
true if the field cell was hit but it was empty. |
boolean |
isPresent()
Returns
true if a Ship is present, false otherwise. |
void |
placeShip(Ship ship)
Places a ship in the field cell.
|
void |
shoot(Shot shot)
Tries to shoot this field cell.
|
boolean isEmpty()
true
if this field cell is empty.true
if this field cell is emptyboolean isMissed()
true
if the field cell was hit but it was empty.true
if the field cell was hit but it was emptyboolean isPresent()
true
if a Ship
is present, false otherwise.true
if a Ship
is presentjava.util.Optional<Ship> getShip()