ictk.boardgame.chess
Class AmbiguousChessMoveException
java.lang.Object
java.lang.Throwable
java.lang.Exception
ictk.boardgame.BoardGameException
ictk.boardgame.MoveException
ictk.boardgame.AmbiguousMoveException
ictk.boardgame.chess.AmbiguousChessMoveException
- All Implemented Interfaces:
- java.io.Serializable
- public class AmbiguousChessMoveException
- extends AmbiguousMoveException
some notations use shorthand for moves that relies on a particular
position on the board. If the position is incorrect the move is
often not intelligible since Ne5 might refer to a Knight on f3 or
a Knight on d3. This exception is thrown when the move does not
specify a unique piece to move. This exception tries to give as
much information as possible to help determine what went wrong.
- See Also:
- Serialized Form
Constructor Summary |
AmbiguousChessMoveException()
|
AmbiguousChessMoveException(java.lang.String mesg)
|
AmbiguousChessMoveException(java.lang.String mesg,
int p,
int of,
int or,
int df,
int dr)
|
AmbiguousChessMoveException(java.lang.String mesg,
int p,
int of,
int or,
int df,
int dr,
ChessPiece[] dupes)
|
AmbiguousChessMoveException(java.lang.String mesg,
int p,
int of,
int or,
int df,
int dr,
java.util.List dupes)
|
Method Summary |
ChessPiece[] |
getPieces()
returns an array of pieces that are candidates which could possibly
move to this destination. |
java.lang.String |
toString()
|
Methods inherited from class java.lang.Throwable |
fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace |
Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
AmbiguousChessMoveException
public AmbiguousChessMoveException()
AmbiguousChessMoveException
public AmbiguousChessMoveException(java.lang.String mesg)
AmbiguousChessMoveException
public AmbiguousChessMoveException(java.lang.String mesg,
int p,
int of,
int or,
int df,
int dr)
- Parameters:
mesg
- a message about the ambiguityp
- index of the piece type supposed to moveof
- origin file indexor
- origin rank indexdf
- destination file indexdr
- destination rank index
AmbiguousChessMoveException
public AmbiguousChessMoveException(java.lang.String mesg,
int p,
int of,
int or,
int df,
int dr,
java.util.List dupes)
- Parameters:
mesg
- a message about the ambiguityp
- index of the piece type supposed to moveof
- origin file indexor
- origin rank indexdf
- destination file indexdr
- destination rank indexdupes
- list of pieces on the board which this move might refer to
AmbiguousChessMoveException
public AmbiguousChessMoveException(java.lang.String mesg,
int p,
int of,
int or,
int df,
int dr,
ChessPiece[] dupes)
- Parameters:
mesg
- a message about the ambiguityp
- index of the piece type supposed to moveof
- origin file indexor
- origin rank indexdf
- destination file indexdr
- destination rank indexdupes
- list of pieces on the board which this move might refer to
getPieces
public ChessPiece[] getPieces()
- returns an array of pieces that are candidates which could possibly
move to this destination.
toString
public java.lang.String toString()