示例#1
0
 // TODO: Refactor
 private void BeginPieceRecapturingIfPawnReachedTheEnd(Box destinationBox)
 {
     if (destinationBox.Position.Row == 8 && destinationBox.Piece is Pawn && destinationBox.Piece.Color == PieceColor.White)
     {
         if (CapturedPieceCollection.GetCountTotalCapturedPieces(PieceColor.White, typesToExclude: typeof(Pawn)) > 0)
         {
             RetakingIsActive = true;
             RetakingPosition = destinationBox.Position;
         }
     }
     else if (destinationBox.Position.Row == 1 && destinationBox.Piece is Pawn && destinationBox.Piece.Color == PieceColor.Black)
     {
         if (CapturedPieceCollection.GetCountTotalCapturedPieces(PieceColor.Black, typesToExclude: typeof(Pawn)) > 0)
         {
             RetakingIsActive = true;
             RetakingPosition = destinationBox.Position;
         }
     }
 }