|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectcs131test.tron.TronSoln
public class TronSoln
A sample solution to Tron. April 2010
| Constructor Summary | |
|---|---|
TronSoln()
|
|
| Method Summary | |
|---|---|
java.lang.String |
getPlayerName()
Specifies the name of the player playing this game. |
void |
move(game.GameState state)
Generates the next move for the game by modifying the game state. |
void |
setPlayerNum(int playerNum)
Lets the game know which player number they are (always either 0 or 1). |
| Methods inherited from class java.lang.Object |
|---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public TronSoln()
| Method Detail |
|---|
public java.lang.String getPlayerName()
getPlayerName in interface game.Gamepublic void setPlayerNum(int playerNum)
setPlayerNum in interface game.GameplayerNum - The player number (0 or 1).TronStatepublic void move(game.GameState state)
TronStateInterface tronState = (TronStateInterface)state;
int[][] board = tronState.getBoard();
move in interface game.Gamestate - The current game state before this move is played.
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||