org.atmosphere.samples.tictactoe
Class TTTGame
java.lang.Object
org.atmosphere.samples.tictactoe.TTTGame
public class TTTGame
- extends Object
|
Field Summary |
static int |
O
|
static int |
X
|
|
Method Summary |
String |
getJSON()
Create a JSON representation of the game state. |
boolean |
turn(int cell)
|
int |
win()
|
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
X
public static final int X
- See Also:
- Constant Field Values
O
public static final int O
- See Also:
- Constant Field Values
TTTGame
public TTTGame()
turn
public boolean turn(int cell)
win
public int win()
getJSON
public String getJSON()
- Create a JSON representation of the game state. It will look something like this:
{ "win": "-1", "board": ["0","0","0","0","0","0","0","0","0"] }
- Returns:
- json
Copyright © 2011. All Rights Reserved.