tron
Interface TronStateInterface

All Known Implementing Classes:
TronState

public interface TronStateInterface

This is the interface that your TronState class must implement. April 2010

Author:
bederson

Method Summary
 int[][] getBoard()
          Returns a copy of the array representing the board of the game.
 Cell getHead(int playerNum)
          Returns the head of the specified player.
 java.util.ArrayList<TronObstacle> getObstacles()
          Returns the list of obstacles on the board.
 void setCell(int row, int col, int value)
          Sets the specified cell of the board to the specified value.
 void setHead(int playerNum, Cell head)
          Sets the head position for the specified player.
 

Method Detail

getBoard

int[][] getBoard()
Returns a copy of the array representing the board of the game. Cells are -1 if unplayed, or player number if played

Returns:
the board

setCell

void setCell(int row,
             int col,
             int value)
Sets the specified cell of the board to the specified value. The cell is specified by the row and col parameters

Parameters:
row - is row of the cell to set
col - is column of the cell to set
value - is new value of the cell

getObstacles

java.util.ArrayList<TronObstacle> getObstacles()
Returns the list of obstacles on the board.

Returns:
the list of obstacles
See Also:
TronObstacle

getHead

Cell getHead(int playerNum)
Returns the head of the specified player.

Parameters:
playerNum - the player number to get the head row of (always 0 or 1)
Returns:
the cell where the head is

setHead

void setHead(int playerNum,
             Cell head)
Sets the head position for the specified player.

Parameters:
playerNum - the player number to get the head column of (always 0 or 1)
head - the position of the head


Web Accessibility