Package battleship.model.player
Class Human
java.lang.Object
battleship.model.player.AbstractPlayer
battleship.model.player.Human
- All Implemented Interfaces:
Player
public class Human extends AbstractPlayer
This object do nothing itself, it just an interface to know the type of player (Human or not),
each view interact with the player with its methods
-
Field Summary
Fields inherited from class battleship.model.player.AbstractPlayer
id, moves, ships
-
Constructor Summary
Constructors Constructor Description Human()
-
Method Summary
Modifier and Type Method Description Pair<java.lang.Integer,java.lang.Integer>
chooseMove()
Used by computer onlyvoid
placeShips()
Used byComputer
instances to place shipsMethods 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
-
Constructor Details
-
Human
public Human()
-
-
Method Details
-
chooseMove
Description copied from interface:Player
Used by computer only- Returns:
- coords in its opponent grid to play a move
- See Also:
Random.chooseMove()
-
placeShips
public void placeShips()Description copied from interface:Player
Used byComputer
instances to place ships
-