|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--chesspresso.position.AbstractPosition | +--chesspresso.position.AbstractMutablePosition | +--chesspresso.position.LightWeightPosition
A light-weight implementation of the position interface. This class is optimized for simplicity of the underlying data structure, not for speed of accessors nor for memory footprint. Use this class if you do not care about performance.
Field Summary |
Fields inherited from class chesspresso.position.AbstractMutablePosition |
m_changeListeners, m_listeners, m_notifyListeners, m_notifyPositionChanged |
Fields inherited from class chesspresso.position.AbstractPosition |
HASH_ALL_MASK, HASH_TOPLAY_MASK, HASH_TOPLAY_MULT, s_hashCastleMod, s_hashEPMod, 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 | |
LightWeightPosition()
|
|
LightWeightPosition(ImmutablePosition position)
|
Method Summary | |
boolean |
canRedoMove()
|
boolean |
canUndoMove()
|
void |
doMove(short move)
|
int |
getCastles()
Return the still allowed castles as mask. |
int |
getHalfMoveClock()
Return the number of moves since the last capture and the last pawn move. |
Move |
getLastMove()
|
short |
getLastShortMove()
|
int |
getPlyNumber()
Return the current ply number. |
int |
getSqiEP()
Return the current en passant square. |
int |
getStone(int sqi)
Return the stone currently on the given square. |
int |
getToPlay()
Return the player whose turn it is. |
boolean |
redoMove()
|
void |
setCastles(int castles)
|
void |
setHalfMoveClock(int halfMoveClock)
|
void |
setPlyNumber(int plyNumber)
|
void |
setSqiEP(int sqiEP)
|
void |
setStone(int sqi,
int stone)
|
void |
setToPlay(int toPlay)
|
boolean |
undoMove()
|
Methods inherited from class chesspresso.position.AbstractPosition |
equals, getFEN, getHashCode, getStartPositionHashCode, hashCode, isCastlePossible, isLegal, isSquarePossibleEPSquare, isStartPosition, isWhiteToPlay, toString, validate |
Methods inherited from class java.lang.Object |
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Methods inherited from interface chesspresso.position.ImmutablePosition |
getFEN, getHashCode, hashCode, isLegal, isStartPosition, validate |
Constructor Detail |
public LightWeightPosition()
public LightWeightPosition(ImmutablePosition position)
Method Detail |
public int getStone(int sqi)
ImmutablePosition
sqi
- the square
public int getToPlay()
ImmutablePosition
public int getSqiEP()
ImmutablePosition
public int getCastles()
ImmutablePosition
public int getPlyNumber()
ImmutablePosition
public int getHalfMoveClock()
ImmutablePosition
public void setStone(int sqi, int stone)
public void setCastles(int castles)
public void setSqiEP(int sqiEP)
public void setToPlay(int toPlay)
public void setPlyNumber(int plyNumber)
public void setHalfMoveClock(int halfMoveClock)
public void doMove(short move) throws IllegalMoveException
IllegalMoveException
public boolean canUndoMove()
public boolean undoMove()
public short getLastShortMove() throws IllegalMoveException
IllegalMoveException
public Move getLastMove() throws IllegalMoveException
IllegalMoveException
public boolean canRedoMove()
public boolean redoMove()
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |