|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--chesspresso.position.AbstractPosition
Field Summary | |
protected static long |
HASH_ALL_MASK
|
protected static long |
HASH_TOPLAY_MASK
|
protected static long |
HASH_TOPLAY_MULT
|
protected static long[] |
s_hashCastleMod
|
protected static long[] |
s_hashEPMod
|
protected static long[][] |
s_hashMod
|
Fields inherited from interface chesspresso.position.ImmutablePosition |
ALL_CASTLES, BLACK_CASTLE, BLACK_LONG_CASTLE, BLACK_SHORT_CASTLE, NO_CASTLES, WHITE_CASTLE, WHITE_LONG_CASTLE, WHITE_SHORT_CASTLE |
Constructor Summary | |
AbstractPosition()
|
Method Summary | |
boolean |
equals(java.lang.Object obj)
|
java.lang.String |
getFEN()
Return the FEN representation of the current position FEN |
long |
getHashCode()
Returns a 64bit hash code of the current position. 64bit should be enough to disnstinguish positions with almost no collisions. |
protected static long |
getStartPositionHashCode()
|
int |
hashCode()
Returns a 32bit hash code of the current position. 32 bit is not enough to distinguish positions reliably, use only if collisions are handled. |
boolean |
isCastlePossible(int castle)
|
boolean |
isLegal()
Return whether the current position is legal. |
boolean |
isSquarePossibleEPSquare(int sqi)
|
boolean |
isStartPosition()
Returns whether the represented position is the startposition |
static boolean |
isWhiteToPlay(long hashCode)
|
java.lang.String |
toString()
|
void |
validate()
Validates the internal state. |
Methods inherited from class java.lang.Object |
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Methods inherited from interface chesspresso.position.ImmutablePosition |
getCastles, getHalfMoveClock, getPlyNumber, getSqiEP, getStone, getToPlay |
Field Detail |
protected static long HASH_ALL_MASK
protected static long HASH_TOPLAY_MASK
protected static long HASH_TOPLAY_MULT
protected static long[][] s_hashMod
protected static long[] s_hashCastleMod
protected static long[] s_hashEPMod
Constructor Detail |
public AbstractPosition()
Method Detail |
protected static long getStartPositionHashCode()
public static boolean isWhiteToPlay(long hashCode)
public long getHashCode()
ImmutablePosition
getHashCode
in interface ImmutablePosition
public final int hashCode()
ImmutablePosition
hashCode
in interface ImmutablePosition
hashCode
in class java.lang.Object
public final boolean isStartPosition()
ImmutablePosition
isStartPosition
in interface ImmutablePosition
public boolean equals(java.lang.Object obj)
equals
in class java.lang.Object
public java.lang.String getFEN()
ImmutablePosition
FEN
getFEN
in interface ImmutablePosition
public boolean isCastlePossible(int castle)
public boolean isSquarePossibleEPSquare(int sqi)
public boolean isLegal()
ImmutablePosition
isLegal
in interface ImmutablePosition
public void validate() throws IllegalPositionException
ImmutablePosition
validate
in interface ImmutablePosition
IllegalPositionException
- if the internal state is illegalpublic java.lang.String toString()
toString
in class java.lang.Object
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |