Class RandomPlayer
java.lang.Object
castle.comp3021.assignment.protocol.Player
castle.comp3021.assignment.player.RandomPlayer
- All Implemented Interfaces:
java.lang.Cloneable
public class RandomPlayer extends Player
A computer player that makes a move randomly.
-
Field Summary
-
Constructor Summary
Constructors Constructor Description RandomPlayer(java.lang.String name)
RandomPlayer(java.lang.String name, Color color)
-
Method Summary
-
Constructor Details
-
RandomPlayer
-
RandomPlayer
public RandomPlayer(java.lang.String name)
-
-
Method Details
-
nextMove
Choose a move from available moves. This method will be called byGame
object to get the move that the player wants to make when it is the player's turn.RandomPlayer
chooses a move from available ones randomly.Attention: Student should make sure the
Move
returned is valid.
-