jaige.games.ataxx
Class AtaxxBoard

java.lang.Object
  extended by jaige.GameBoard
      extended by jaige.games.ataxx.AtaxxBoard
All Implemented Interfaces:
GameListener, MoveListener

public class AtaxxBoard
extends GameBoard


Field Summary
 
Fields inherited from class jaige.GameBoard
players, turn, winner
 
Constructor Summary
AtaxxBoard()
           
 
Method Summary
static boolean canMove(Cell[][] cells, Player p)
           
static boolean gameOver(Cell[][] cells)
           
 Cell getCell(int x, int y)
           
 Cell getCell(java.awt.Point p)
           
 Cell[][] getCells()
           
 Orientation[] getOrientations()
          getOrientations
static int getScore(Cell[][] cells, Player p)
           
static boolean isLegalMove(Cell[][] cells, Player turn, int fromX, int fromY, int toX, int toY)
           
 boolean isLegalMove(int fromX, int fromY, int toX, int toY)
           
static int makeMove(Cell[][] cells, Player turn, int fromX, int fromY, int toX, int toY)
           
static void printBoard(Cell[][] cells, Player[] players, java.io.PrintStream out)
           
 void processMoveEvent(MoveEvent event)
          processMoveEvent
 void reset()
          reset
 void setBoardSize(int... size)
          setBoardSize
 void setPlayers(Player... players)
           
 
Methods inherited from class jaige.GameBoard
abort, destroy, gameOver, getPlayers, getTurn, getWinner, isGameOver, start, startAndWaitForWinner, switchTurns
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AtaxxBoard

public AtaxxBoard()
Method Detail

getOrientations

public Orientation[] getOrientations()
getOrientations

Specified by:
getOrientations in class GameBoard
Returns:
Orientation[]

processMoveEvent

public void processMoveEvent(MoveEvent event)
processMoveEvent

Parameters:
event - MoveEvent

isLegalMove

public boolean isLegalMove(int fromX,
                           int fromY,
                           int toX,
                           int toY)

isLegalMove

public static boolean isLegalMove(Cell[][] cells,
                                  Player turn,
                                  int fromX,
                                  int fromY,
                                  int toX,
                                  int toY)

makeMove

public static int makeMove(Cell[][] cells,
                           Player turn,
                           int fromX,
                           int fromY,
                           int toX,
                           int toY)

getScore

public static int getScore(Cell[][] cells,
                           Player p)

canMove

public static boolean canMove(Cell[][] cells,
                              Player p)

reset

public void reset()
reset

Specified by:
reset in class GameBoard

setBoardSize

public void setBoardSize(int... size)
setBoardSize

Specified by:
setBoardSize in class GameBoard
Parameters:
size - int[]

printBoard

public static void printBoard(Cell[][] cells,
                              Player[] players,
                              java.io.PrintStream out)

setPlayers

public void setPlayers(Player... players)
Overrides:
setPlayers in class GameBoard

gameOver

public static boolean gameOver(Cell[][] cells)

getCells

public Cell[][] getCells()

getCell

public Cell getCell(int x,
                    int y)

getCell

public Cell getCell(java.awt.Point p)