|
|||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--sg.edu.nus.comp.cs3243.pipedream.Driver
Driver is the class that is used to create an instance of the game. It implements the accessor functions needed in creating your player agent. It can also be used to test your game playing agent.
$Log: Action.java,v $
Constructor Summary | |
Driver()
constructor for the pipedream package game driver |
Method Summary | |
char[][] |
getBoard()
An accessor function to return a 2-d array of characters, giving the current state of the board |
int |
getFill(int x,
int y)
An accessor function to check the fill status of the board piece at x,y |
boolean |
getIsEmpty(int x,
int y)
An accessor function to check whether the board piece at x,y is empty. |
int |
getNextOozeDirection()
An accessor function to return the Y coordinate of the next spot that the ooze will move to |
int |
getNextOozeSpotX()
An accessor function to return the X coordinate of the next spot that the ooze will move to |
int |
getNextOozeSpotY()
An accessor function to return the Y coordinate of the next spot that the ooze will move to |
char[] |
getQueue()
An accessor function to return an array of characters, giving the queue of tiles to be placed |
int |
getScore()
An accessor function to return the agent's score |
char |
getTile(int x,
int y)
An accessor function to check the type of board piece at x,y |
int |
getTime()
An accessor function to return the number of time units elapsed since the start of the game |
int |
getTimeToNextOoze()
An accessor function to return the time to the next move of the ooze. |
void |
printBoard()
A method to print the board to stdout |
void |
printQueue()
A method to print the queue of pieces to stdout |
boolean |
processTurn(Action a)
The method used to execute a turn on the board. |
Methods inherited from class java.lang.Object |
clone,
equals,
finalize,
getClass,
hashCode,
notify,
notifyAll,
toString,
wait,
wait,
wait |
Constructor Detail |
public Driver()
Method Detail |
public int getScore()
public int getTime()
public char getTile(int x, int y)
Constants.EMPTY_PIECE
,
Constants.CROSS_PIECE
,
Constants.HORIZONTAL_PIECE
,
Constants.VERTICAL_PIECE
,
Constants.TOP_LEFT_ELBOW_PIECE
,
Constants.TOP_RIGHT_ELBOW_PIECE
,
Constants.BOTTOM_LEFT_ELBOW_PIECE
,
Constants.BOTTOM_LEFT_ELBOW_PIECE
,
Constants.START_TOP_PIECE
public int getFill(int x, int y)
Constants.NOT_FILLED
,
Constants.FILLED
,
Constants.FILLED_EW_ONLY
,
Constants.FILLED_NS_ONLY
public boolean getIsEmpty(int x, int y)
Constants.EMPTY_PIECE
public int getNextOozeDirection()
Constants.FLOWING_NORTH
,
Constants.FLOWING_EAST
,
Constants.FLOWING_SOUTH
,
Constants.FLOWING_WEST
,
getNextOozeSpotX()
,
getNextOozeSpotY()
,
getTimeToNextOoze()
public int getTimeToNextOoze()
getNextOozeSpotX()
,
getNextOozeSpotY()
,
getNextOozeDirection()
public int getNextOozeSpotX()
getNextOozeSpotY()
,
getNextOozeDirection()
,
getTimeToNextOoze()
public int getNextOozeSpotY()
getNextOozeSpotX()
,
getNextOozeDirection()
,
getTimeToNextOoze()
public char[][] getBoard()
public char[] getQueue()
public void printBoard()
public void printQueue()
public boolean processTurn(Action a)
a
- filled Action objectAction
|
|||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |