manager
Class Game

java.lang.Object
  extended by manager.Game
Direct Known Subclasses:
CheckersGame, ChessGame, DeflexionGame, Tictactoe3DGame, TictactoeGame

public abstract class Game
extends java.lang.Object

Esta classe define um jogo de tabuleiro genérico. Todo tipo de interação com qualquer jogo de tabuleiro deve ser feita utilizando algum dos métodos da interface pública desta classe. Cada sub-classe desta classe deverá implementar os métodos correspondentes às ações possíveis de cada tipo de jogo. Cada jogo contém um tabuleiro Board e cada tabuleiro contém peças (@link piece}.

Version:
1.0 beta - 03/11/2008
Author:
Luciano Antonio Digiampietri
See Also:
Board, Piece

Field Summary
 Board BOARD
           
 int CONT_ID
           
 boolean DRAWN_GAME
           
 boolean GAME_ENDED
           
 boolean GAME_STARTED
           
 java.lang.String GAME_TYPE
           
 java.lang.String LAST_MESSAGE
           
 int MAX_PLAYERS
           
 int MIN_PLAYERS
           
 java.util.List PLAYERS
           
 boolean WAITING_PLAYERS
           
 int WINNER
           
 
Constructor Summary
Game()
           
Game(java.lang.String name)
           
Game(java.lang.String name, int Player)
           
 
Method Summary
 boolean add(int x, int y, int Player)
           
 boolean canAdd(int x, int y, int Player)
           
 boolean canMove(int x1, int y1, int x2, int y2, int Player)
           
 java.lang.String currentBoard()
           
 boolean endTurn(int Player)
           
 boolean gameDraw()
           
 boolean gameEnded()
           
 int getActualPlayer()
           
 int getColumns()
           
 int getCurrentGameId()
           
 java.lang.String getGameName()
           
 java.lang.String getGameType()
           
 int getLines()
           
 int getMaxPlayers()
           
 java.lang.String getMessage()
           
 int getMinPlayers()
           
 java.util.List getPlayers()
           
 void initializeBoard()
           
 int isPlayerInThisGame(int playerID)
           
 boolean joinGame(int playerID)
           
 boolean move(int x1, int y1, int x2, int y2, int Player)
           
 boolean rotate(int x, int y, java.lang.String direction, int Player)
           
 boolean waitingPlayers()
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

BOARD

public Board BOARD

WINNER

public int WINNER

GAME_ENDED

public boolean GAME_ENDED

DRAWN_GAME

public boolean DRAWN_GAME

PLAYERS

public java.util.List PLAYERS

CONT_ID

public int CONT_ID

GAME_TYPE

public java.lang.String GAME_TYPE

MAX_PLAYERS

public int MAX_PLAYERS

WAITING_PLAYERS

public boolean WAITING_PLAYERS

MIN_PLAYERS

public int MIN_PLAYERS

GAME_STARTED

public boolean GAME_STARTED

LAST_MESSAGE

public java.lang.String LAST_MESSAGE
Constructor Detail

Game

public Game(java.lang.String name)

Game

public Game()

Game

public Game(java.lang.String name,
            int Player)
Method Detail

getActualPlayer

public int getActualPlayer()

initializeBoard

public void initializeBoard()

canAdd

public boolean canAdd(int x,
                      int y,
                      int Player)

getCurrentGameId

public int getCurrentGameId()

currentBoard

public java.lang.String currentBoard()

move

public boolean move(int x1,
                    int y1,
                    int x2,
                    int y2,
                    int Player)

endTurn

public boolean endTurn(int Player)

canMove

public boolean canMove(int x1,
                       int y1,
                       int x2,
                       int y2,
                       int Player)

add

public boolean add(int x,
                   int y,
                   int Player)

getGameName

public java.lang.String getGameName()

getLines

public int getLines()

getColumns

public int getColumns()

gameEnded

public boolean gameEnded()

getMaxPlayers

public int getMaxPlayers()

getMinPlayers

public int getMinPlayers()

getGameType

public java.lang.String getGameType()

rotate

public boolean rotate(int x,
                      int y,
                      java.lang.String direction,
                      int Player)

getPlayers

public java.util.List getPlayers()

isPlayerInThisGame

public int isPlayerInThisGame(int playerID)

joinGame

public boolean joinGame(int playerID)

waitingPlayers

public boolean waitingPlayers()

getMessage

public java.lang.String getMessage()

gameDraw

public boolean gameDraw()