cz.cvut.agents.rph.reversi
Interface ReversiPlayerInterface

All Superinterfaces:
java.rmi.Remote
All Known Implementing Classes:
DummyPlayer, ReversiPlayer, WrongMovePlayer

public interface ReversiPlayerInterface
extends java.rmi.Remote

Interface for a reversi player. Extends Remote interface to be able to play remotely. Author: Ondrej Vanek Date: 10/4/12 Time: 1:11 PM


Method Summary
 void endGame()
          Signalizes end of the game.
 int getEmptySquareColor()
          Gets the color of the empty square.
 int getMyColor()
          Gets the color of the player.
 java.lang.String getName()
          Returns name of the reversi player.
 int getOpponentColor()
          Gets the color of the opponent player.
 void init(int boardWidth, int boardHeight, int myColor, int opponentColor)
          Initializes the player with game parameters.
 ReversiMove makeNextMove(int[][] board)
          This method is called by the reversi server when the player has to compute the next move.
 

Method Detail

init

void init(int boardWidth,
          int boardHeight,
          int myColor,
          int opponentColor)
          throws java.rmi.RemoteException
Initializes the player with game parameters. You can override this method to do your own initialization.

Parameters:
boardWidth - WIDTH of the board
boardHeight - HEIGHT of the board
myColor - color of the player
opponentColor - color of the opponent
Throws:
java.rmi.RemoteException

getMyColor

int getMyColor()
               throws java.rmi.RemoteException
Gets the color of the player.

Returns:
color of the player.
Throws:
java.rmi.RemoteException

getOpponentColor

int getOpponentColor()
                     throws java.rmi.RemoteException
Gets the color of the opponent player.

Returns:
color of the opponent player.
Throws:
java.rmi.RemoteException

getEmptySquareColor

int getEmptySquareColor()
                        throws java.rmi.RemoteException
Gets the color of the empty square.

Returns:
color of the empty square.
Throws:
java.rmi.RemoteException

getName

java.lang.String getName()
                         throws java.rmi.RemoteException
Returns name of the reversi player. Return your username!

Returns:
name of the reversi player
Throws:
java.rmi.RemoteException

makeNextMove

ReversiMove makeNextMove(int[][] board)
                         throws java.rmi.RemoteException
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.

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
Throws:
java.rmi.RemoteException

endGame

void endGame()
             throws java.rmi.RemoteException
Signalizes end of the game.

Throws:
java.rmi.RemoteException