public interface Fleet
extends java.io.Serializable
Modifier and Type | Method and Description |
---|---|
void |
addShip(Ship ship)
Adds a ship to the fleet.
|
java.util.List<Ship> |
getAllNonPlacedShips()
Returns all non placed ships.
|
java.util.List<Ship> |
getAllShips()
Returns a list of all ships.
|
java.util.List<Ship> |
getAllShipsByType(Ruleset.ShipRules shipType)
Returns all ships of a type.
|
ShipFactory |
getFactory()
Returns a ship factory.
|
java.util.Optional<Ship> |
getNextNonPlacedShip()
Returns the next non placed ship.
|
java.util.Optional<Ship> |
getNextShipByType(Ruleset.ShipRules shipType)
Returns the next ship of a type.
|
boolean |
isReady()
Returns
true if all the ships of the current fleet were placed and
the game can start. |
boolean |
isSunk()
Returns
true if the fleet was sunk. |
void |
resetFleetPlacement()
Resets the fleet placement.
|
void addShip(Ship ship)
ship
- ship to addvoid resetFleetPlacement()
java.util.List<Ship> getAllNonPlacedShips()
java.util.List<Ship> getAllShips()
java.util.List<Ship> getAllShipsByType(Ruleset.ShipRules shipType)
shipType
- Ruleset.ShipRules
java.util.Optional<Ship> getNextNonPlacedShip()
java.util.Optional<Ship> getNextShipByType(Ruleset.ShipRules shipType)
shipType
- Ruleset.ShipRules
boolean isReady()
true
if all the ships of the current fleet were placed and
the game can start. false
otherwisetrue
if the fleet is readyboolean isSunk()
true
if the fleet was sunk. So all the ships it contains
were sunk.true
if the fleet was sunkShipFactory getFactory()
ShipFactory