cz.cvut.agents.rph.reversi.players
Class DummyPlayer
java.lang.Object
cz.cvut.agents.rph.reversi.ReversiPlayer
cz.cvut.agents.rph.reversi.players.DummyPlayer
- All Implemented Interfaces:
- ReversiPlayerInterface, java.rmi.Remote
public class DummyPlayer
- extends ReversiPlayer
Dummy player is an example of implementation of the player. It plays random and after each move it checks
if the move is valid ("real" player should always check validity of the turn by itself).
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
RANDOM_MOVES_NUMBER
private final int RANDOM_MOVES_NUMBER
- Constant defining maximum number of tried moves. If it is exceeded, player systematically tries all moves.
- See Also:
- Constant Field Values
DummyPlayer
public DummyPlayer()
getName
public java.lang.String getName()
- Description copied from class:
ReversiPlayer
- Returns name of the reversi player. Return your username!
- Specified by:
getName
in interface ReversiPlayerInterface
- Specified by:
getName
in class ReversiPlayer
- Returns:
- name of the reversi player
makeNextMove
public ReversiMove makeNextMove(int[][] board)
- Description copied from class:
ReversiPlayer
- This method is called by the reversi server when the player has to compute the next move.
The method returns a
ReversiMove
class encapsulating the coordinates of the stone to be put on the board.
- Specified by:
makeNextMove
in interface ReversiPlayerInterface
- Specified by:
makeNextMove
in class ReversiPlayer
- Parameters:
board
- - contains actual map of the board represented by two-dimensional matrix.
Each sqaure contains number of -1 representing empty square and number 0 and 1 representing players' stones.
- Returns:
- specific reversiMove
isCorrectMove
public boolean isCorrectMove(int[][] board,
ReversiPlayer player,
ReversiMove move)
isCorrectMoveInDirection
private boolean isCorrectMoveInDirection(int[][] board,
int player,
int dirX,
int dirY,
int x,
int y)