public class LRUDPiece extends Piece
| Constructor and Description |
|---|
LRUDPiece(char[][] board,
char displayChar,
int size,
int topRow,
int leftCol)
Call the superclass (Piece) constructor with the same parameters.
|
| Modifier and Type | Method and Description |
|---|---|
int |
getBottomRow()
Return the row of the piece's bottom right corner.
|
int |
getRightCol()
Return the column of the piece's bottom right corner.
|
canMoveDir, getLeftCol, getTopRow, toString, tryMovepublic LRUDPiece(char[][] board,
char displayChar,
int size,
int topRow,
int leftCol)
board - a reference to the RandomRailroadRushHour char[][] board object common to all piecesdisplayChar - the character used to "paint" the piece on the board representationsize - the size of the piece. For up/down- or left/right-moving train pieces (with width 1), this is the piece length in grid squares.
For left/right/up/down-moving platform pieces, this is the size length in grid squares.topRow - the row of the piece's top left cornerleftCol - the column of the piece's top left cornerpublic int getBottomRow()
PiecegetBottomRow in class Piecepublic int getRightCol()
PiecegetRightCol in class Piece