Internet Chess ToolKit
v0.2.0

ictk.boardgame
Interface Game

All Known Subinterfaces:
SingleBoardGame
All Known Implementing Classes:
ChessGame

public interface Game

the abstract Game class is the parent of all types of games that will be supported. It needs to be generic enough to support all kinds of turn based games from Chess, to Go, to Scrabble, etc. Therefore, commonalities in these classes will increase the number of methods in this class. Note: this is only an interface because the implementation of these functions is so simple there's no need to make this a class . . .yet.


Method Summary
 Board[] getBoards()
          Board games with only one board return a single element Board[] array.
 Result getCurrentResult()
          returns the current status of this Game.
 GameInfo getGameInfo()
          this returns the GameInfo object for this game.
 History getHistory()
          returns the move history for the entire game.
 int getNumberOfPlayers()
          gets the number of players involved in this type of game, though there might not be two valid Player objects for this game.
 int[] getPlayersToMove()
          returns an array containing the index number of the Players who have the ability to make a move at this time.
 Result getResult()
          returns file final result of the game on the main line.
 void setGameInfo(GameInfo gi)
           
 void setHistory(History history)
           
 void setResult(Result result)
           
 

Method Detail

getNumberOfPlayers

public int getNumberOfPlayers()
gets the number of players involved in this type of game, though there might not be two valid Player objects for this game. For example: Chess would always return 2, even if only one player is known. But Scrabble might return 2-6 depending on how many people are playing that particular game.


getGameInfo

public GameInfo getGameInfo()
this returns the GameInfo object for this game. The GameInfo object includes player information as well as where the game was played.


setGameInfo

public void setGameInfo(GameInfo gi)

getHistory

public History getHistory()
returns the move history for the entire game. You need to use this object to add moves to the game and navigate through the game's move list.


setHistory

public void setHistory(History history)

getCurrentResult

public Result getCurrentResult()
returns the current status of this Game.


getResult

public Result getResult()
returns file final result of the game on the main line.


setResult

public void setResult(Result result)

getBoards

public Board[] getBoards()
Board games with only one board return a single element Board[] array.

Returns:
all the boards use in this game.

getPlayersToMove

public int[] getPlayersToMove()
returns an array containing the index number of the Players who have the ability to make a move at this time. The numbers can then be sent to GameInfo.getPlayer(int) to receive the Player object.


Submit a bug or feature
Visit the Website
Internet Chess ToolKit is licensed under the GPL v2 .