Interface Player


public interface Player

The interface Player for initializing a player's position and getting a player's move.


Method Summary
 Position getInitialPosition(int i)
          The method getInitialPosition returns the initial position of a given player.
 Position move()
          The method move returns the new position of a pawn that was moved.
 

Method Detail

getInitialPosition

public Position getInitialPosition(int i)
The method getInitialPosition returns the initial position of a given player.

Parameters:
i - an int value corresponding to the player's pawn's number.
Returns:
an Position value corresponding to the new position of the player. IMPORTANT: The parameter i here denotes the player's pawn number and the method should return a Position object. Example of a piece of code of a class implementing this interface: public Position getInitialPosition(int i){ return new Position(iRowPosition, iColPosition); }

move

public Position move()
The method move returns the new position of a pawn that was moved.

Returns:
an Object value corresponding to the new position of the pawn. IMPORTANT: The method should return a Position object. Example of a piece of code of a class implementing this interface: public Position move(){ return new Position(iRowPosition, iColPosition); } Note: Remember a pawn can only move to an unoccupied cell and if a pawn just cannot move, then return null. A pawn cannot move out of the board.