|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.jscience.computing.game.GameBoardPosition
org.jscience.computing.game.muehle.MuehlePosition
public class MuehlePosition
The class MuehlePosition represents a Muehle game position. The
representation is an integer based on the following little ASCII
graphic:
00----------01----------02 | | | | 08------09------10 | | | | | | | | 16--17--18 | | | | | | | | 07--15--23 19--11--03 | | | | | | | | 22--21--20 | | | | | | | | 14------13------12 | | | | 06----------05----------04
| Field Summary | |
|---|---|
static int |
NUMBER_OF_FIELDS
DOCUMENT ME! |
| Constructor Summary | |
|---|---|
MuehlePosition(int pos)
Creates a new MuehlePosition object. |
|
| Method Summary | |
|---|---|
boolean |
connectsTo(int pos)
DOCUMENT ME! |
boolean |
connectsTo(MuehlePosition pos)
DOCUMENT ME! |
int[] |
getConnections()
returns getMuehlePairs(asInteger()) |
static int[] |
getConnections(int pos)
DOCUMENT ME! |
int[] |
getMuehlePairs()
returns getMuehlePairs(asInteger()) |
static int[] |
getMuehlePairs(int pos)
As every potential muehle is closed by two pairs of 2 other positions having a piece of the same color, getMuehlePairs() returns an array of integers that represent the two pairs of Positions that fullfill this condition. |
static boolean |
isValidPosition(int p)
DOCUMENT ME! |
java.lang.String |
toString()
DOCUMENT ME! |
| Methods inherited from class org.jscience.computing.game.GameBoardPosition |
|---|
asInteger, equals |
| Methods inherited from class java.lang.Object |
|---|
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
public static int NUMBER_OF_FIELDS
| Constructor Detail |
|---|
public MuehlePosition(int pos)
throws java.lang.IllegalArgumentException
pos - DOCUMENT ME!
java.lang.IllegalArgumentException - DOCUMENT ME!| Method Detail |
|---|
public static boolean isValidPosition(int p)
p - DOCUMENT ME!
public int[] getMuehlePairs()
public static int[] getMuehlePairs(int pos)
pos - DOCUMENT ME!
public boolean connectsTo(MuehlePosition pos)
pos - DOCUMENT ME!
public boolean connectsTo(int pos)
pos - DOCUMENT ME!
public int[] getConnections()
public static int[] getConnections(int pos)
pos - DOCUMENT ME!
public java.lang.String toString()
toString in class GameBoardPosition
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||