edu.ou.mancala.board
Class GameBoard

java.lang.Object
  extended by edu.ou.mancala.board.GameBoard

public final class GameBoard
extends java.lang.Object

Class used to handle the operations of the mancala game board.

Author:
Derek Rushing

Field Summary
static boolean PLAYER_ONE
           
static boolean PLAYER_TWO
           
 
Constructor Summary
GameBoard(boolean hasView)
           
 
Method Summary
 int[] boardContents()
          Return the contents of the current board in a non modifiable way.
 boolean canMove(boolean player, int boardIndex)
          Return whether the specified player can make the move wanted.
 void checkGameOver()
          Check the state to see if game over has been accomplished.
 void cleanupGame()
          Remove resources from the game.
 MancalaPlayer[] getPlayers()
          Get the players involved in this game.
 boolean isRunning()
           
 void move(int boardIndex)
          Method to perform a movement for the board.
 boolean player()
           
 void runGame()
           
 void setupGame()
          Setup the board to be played.
 void step()
          Perform the movement operations for the board.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

PLAYER_ONE

public static final boolean PLAYER_ONE
See Also:
Constant Field Values

PLAYER_TWO

public static final boolean PLAYER_TWO
See Also:
Constant Field Values
Constructor Detail

GameBoard

public GameBoard(boolean hasView)
Method Detail

getPlayers

public MancalaPlayer[] getPlayers()
Get the players involved in this game.


boardContents

public int[] boardContents()
Return the contents of the current board in a non modifiable way.


checkGameOver

public void checkGameOver()
Check the state to see if game over has been accomplished.


canMove

public boolean canMove(boolean player,
                       int boardIndex)
Return whether the specified player can make the move wanted.

Parameters:
player - - The player to make the move for
boardIndex - - The move to make
Returns:
Whether the move is applicable for the given player.

move

public void move(int boardIndex)
Method to perform a movement for the board.

Parameters:
boardIndex - - The slot to move from.

player

public boolean player()

isRunning

public boolean isRunning()

setupGame

public void setupGame()
Setup the board to be played.


cleanupGame

public void cleanupGame()
Remove resources from the game.


step

public void step()
Perform the movement operations for the board.


runGame

public void runGame()