|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Object | +--Position
A Position has several fields. piece is a char that indicates whether the player or opponent has a normal piece('p' or 'o') or a king ('P' or 'O') on the board at the position, or whether the position is empty ('e'). Integer name is the number of the square on the board where the position is located. neighbours is an ArrayList holding the names of all positions that can be moved into from the current position. jmp is an ArrayList holding the names of all positions that can be reached by jumping from the current position. Both neighbours and jmp are defined based on name.
| Field Summary | |
char |
piece
|
| Constructor Summary | |
Position()
The piece is set to empty ('e'), the name is -1 (not valid) and both neighbours and jmp are null. |
|
Position(int i,
char c)
name is set to Integer(i) and piece is set to c. |
|
| Method Summary | |
java.util.ArrayList |
GetJmps()
Returns the ArrayList jmp |
java.util.ArrayList |
GetNeighbours()
Returns the ArrayList neighours |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
public char piece
| Constructor Detail |
public Position()
public Position(int i,
char c)
| Method Detail |
public java.util.ArrayList GetNeighbours()
public java.util.ArrayList GetJmps()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||