Example #1
0
        internal void DoPromotion(byte position, ZNPieceType newType)
        {
            ZNPiece piece = piecesInternal[position];

            if (piece.Type != ZNPieceType.EPawn)
            {
                throw new ArgumentException("This is not a pawn!");
            }
            piecesInternal[position] = new ZNPiece(piece.Color, newType, position);
        }
Example #2
0
        internal bool DoMove(short move)
        {
            byte    oldPosition = (byte)(move & 0xff00 >> 2);
            byte    newPosition = (byte)(move & 0x00ff);
            ZNPiece piece       = piecesInternal[oldPosition];

            piecesInternal[oldPosition] = EMPTY;
            piecesInternal[newPosition] = piece;

            return(true);
        }
 internal void DoPromotion(byte position, ZNPieceType newType)
 {
     ZNPiece piece = piecesInternal[position];
     if (piece.Type != ZNPieceType.EPawn)
     {
         throw new ArgumentException("This is not a pawn!");
     }
     piecesInternal[position] = new ZNPiece(piece.Color, newType, position);
 }