manager
Class CheckersGame
java.lang.Object
manager.Game
manager.CheckersGame
public class CheckersGame
- extends Game
This class extends the generic board game class Game
to support a checkers game.
- Version:
- 0.5 beta - 03/15/2006
- Author:
- Luciano Antonio Digiampietri
- See Also:
Game
Fields inherited from class manager.Game |
BOARD, CONT_ID, DRAWN_GAME, GAME_ENDED, GAME_STARTED, GAME_TYPE, LAST_MESSAGE, MAX_PLAYERS, MIN_PLAYERS, PLAYERS, WAITING_PLAYERS, WINNER |
Method Summary |
boolean |
add(int x,
int y,
java.lang.String Player)
|
boolean |
canAdd(int x,
int y,
Piece P)
|
boolean |
canEat(int x,
int y)
|
boolean |
canEatSomething(int x,
int y,
int Player)
|
boolean |
canMove(int x1,
int y1,
int x2,
int y2,
int Player)
|
boolean |
eat(int x,
int y)
|
boolean |
endTurn(int Player)
|
boolean |
gameEnded()
|
void |
initializeBoard()
|
void |
insertPieces()
|
boolean |
isAdversary(Piece P1,
int Player)
|
boolean |
isPossibleToKeepEating(int x,
int y,
int Player)
|
boolean |
move(int x1,
int y1,
int x2,
int y2,
int Player)
|
boolean |
player1Won()
|
boolean |
player2Won()
|
void |
startGame()
|
boolean |
won(int Player)
|
Methods inherited from class manager.Game |
add, canAdd, currentBoard, gameDraw, getActualPlayer, getColumns, getCurrentGameId, getGameName, getGameType, getLines, getMaxPlayers, getMessage, getMinPlayers, getPlayers, getStatus, joinGame, rotate, waitingPlayers |
Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
CheckersGame
public CheckersGame(java.lang.String name)
CheckersGame
public CheckersGame(java.lang.String name,
int player1)
startGame
public void startGame()
endTurn
public boolean endTurn(int Player)
- Overrides:
endTurn
in class Game
isPossibleToKeepEating
public boolean isPossibleToKeepEating(int x,
int y,
int Player)
canEatSomething
public boolean canEatSomething(int x,
int y,
int Player)
move
public boolean move(int x1,
int y1,
int x2,
int y2,
int Player)
- Overrides:
move
in class Game
canMove
public boolean canMove(int x1,
int y1,
int x2,
int y2,
int Player)
- Overrides:
canMove
in class Game
isAdversary
public boolean isAdversary(Piece P1,
int Player)
eat
public boolean eat(int x,
int y)
canEat
public boolean canEat(int x,
int y)
canAdd
public boolean canAdd(int x,
int y,
Piece P)
add
public boolean add(int x,
int y,
java.lang.String Player)
initializeBoard
public void initializeBoard()
- Overrides:
initializeBoard
in class Game
insertPieces
public void insertPieces()
gameEnded
public boolean gameEnded()
- Overrides:
gameEnded
in class Game
player1Won
public boolean player1Won()
player2Won
public boolean player2Won()
won
public boolean won(int Player)