org.atmosphere.samples.tictactoe
Class TTTGame

java.lang.Object
  extended by org.atmosphere.samples.tictactoe.TTTGame

public class TTTGame
extends Object


Field Summary
static int O
           
static int X
           
 
Constructor Summary
TTTGame()
           
 
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
 

Field Detail

X

public static final int X
See Also:
Constant Field Values

O

public static final int O
See Also:
Constant Field Values
Constructor Detail

TTTGame

public TTTGame()
Method Detail

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 © 2012. All Rights Reserved.