Package battleship.model.player
Class Computer
java.lang.Object
battleship.model.player.AbstractPlayer
battleship.model.player.Computer
- All Implemented Interfaces:
Player
- Direct Known Subclasses:
Random
public abstract class Computer extends AbstractPlayer
Computer super class, all player object which use an algorithm to calculate coordinates to use should extend from this object.
Random is the only algorithm include here but another algorithm can be easily implemented
-
Field Summary
Fields inherited from class battleship.model.player.AbstractPlayer
id, moves, ships
-
Constructor Summary
Constructors Constructor Description Computer()
-
Method Summary
Modifier and Type Method Description void
placeShipRandomly()
Methods inherited from class battleship.model.player.AbstractPlayer
addMove, areValid, getId, getMoves, getShips, setId, setShips, toString, validMoves
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
Methods inherited from interface battleship.model.player.Player
chooseMove, placeShips
-
Constructor Details
-
Computer
public Computer()
-
-
Method Details
-
placeShipRandomly
public void placeShipRandomly()
-