manager
Class Board
java.lang.Object
manager.Board
public class Board
- extends java.lang.Object
This class is responsible to manage a Board for any kind of (Game
).
The public interface is responsible for all allowed actions in a Board. The game is responsable for check if an action is valid (in terms of game rules).
Each Board contains its pieces (Piece
) and no cell can be null; there is a special kind of piece used in "empty cell": NullPiece
.
- Version:
- 0.5 beta - 03/15/2006
- Author:
- Luciano Antonio Digiampietri
- See Also:
Game
,
Piece
,
NullPiece
Constructor Summary |
Board(int x,
int y)
|
Method Summary |
boolean |
addPiece(int x,
int y,
Piece element)
|
Board |
backup()
|
java.lang.String |
board2string()
|
int |
contPieces(java.lang.Class c1)
|
int |
contPieces(int Player)
|
boolean |
deletePiece(int x,
int y)
|
int |
getColumns()
|
int |
getLines()
|
Piece |
getPiece(int x,
int y)
|
boolean |
movePiece(int x1,
int y1,
int x2,
int y2)
|
void |
print()
|
void |
print(int total_space)
|
void |
print(int total_space,
java.lang.String internal_space,
java.lang.String external_space)
|
boolean |
removePiece(int x,
int y)
|
boolean |
replacePiece(int x,
int y,
int x2,
int y2)
|
boolean |
replacePiece(int x,
int y,
Piece element)
|
boolean |
validCell(int x,
int y)
|
Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Board
public Board(int x,
int y)
backup
public Board backup()
print
public void print()
print
public void print(int total_space)
print
public void print(int total_space,
java.lang.String internal_space,
java.lang.String external_space)
board2string
public java.lang.String board2string()
getPiece
public Piece getPiece(int x,
int y)
addPiece
public boolean addPiece(int x,
int y,
Piece element)
replacePiece
public boolean replacePiece(int x,
int y,
Piece element)
replacePiece
public boolean replacePiece(int x,
int y,
int x2,
int y2)
removePiece
public boolean removePiece(int x,
int y)
deletePiece
public boolean deletePiece(int x,
int y)
validCell
public boolean validCell(int x,
int y)
movePiece
public boolean movePiece(int x1,
int y1,
int x2,
int y2)
getLines
public int getLines()
getColumns
public int getColumns()
contPieces
public int contPieces(java.lang.Class c1)
contPieces
public int contPieces(int Player)