net.bluebones.tictactoe
Class Move

java.lang.Object
  extended by net.bluebones.tictactoe.Move

public class Move
extends Object

Represents a move in a game of tic-tac-toe.

Version:
1.1
Author:
Thomas David Baker, bakert+tictactoe@gmail.com

Field Summary
 byte x
          x-coordinate this move takes place at
 byte y
          y-coordinate this move takes place at
 
Constructor Summary
Move(byte x, byte y, byte color)
          Creates a move with the specified coordinates for the specified player.
 
Method Summary
 byte color()
          Gets the type of piece placed by this move.
 String toString()
          Gets a human-readable String representation of this move.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

x

public byte x
x-coordinate this move takes place at


y

public byte y
y-coordinate this move takes place at

Constructor Detail

Move

public Move(byte x,
            byte y,
            byte color)
Creates a move with the specified coordinates for the specified player.

Parameters:
x - int x-coordinate of this move.
y - int y-coordinate of this move.
color - int type of piece played by this player (either TicTacToe.NOUGHTS or TicTacToe.CROSSES)
Method Detail

color

public byte color()
Gets the type of piece placed by this move.

Returns:
int, either TicTacToe.NOUGHTS or TicTacToe.CROSSES

toString

public String toString()
Gets a human-readable String representation of this move.

Overrides:
toString in class Object
Returns:
String representation of this move.