Internet Chess ToolKit
v0.2.0

ictk.boardgame.chess
Class AmbiguousChessMoveException

java.lang.Object
  extended byjava.lang.Throwable
      extended byjava.lang.Exception
          extended byictk.boardgame.BoardGameException
              extended byictk.boardgame.MoveException
                  extended byictk.boardgame.AmbiguousMoveException
                      extended byictk.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 ictk.boardgame.MoveException
getMove
 
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
 

Constructor Detail

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 ambiguity
p - index of the piece type supposed to move
of - origin file index
or - origin rank index
df - destination file index
dr - 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 ambiguity
p - index of the piece type supposed to move
of - origin file index
or - origin rank index
df - destination file index
dr - destination rank index
dupes - 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 ambiguity
p - index of the piece type supposed to move
of - origin file index
or - origin rank index
df - destination file index
dr - destination rank index
dupes - list of pieces on the board which this move might refer to
Method Detail

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()

Submit a bug or feature
Visit the Website
Internet Chess ToolKit is licensed under the GPL v2 .