private void checkSpecialMoves(Tile startTile, Tile endTile) { Piece currentPiece = startTile.getCurrentPiece(); if (currentPiece.toText() == 'P' && startTile.x != endTile.x) { drawSquare(endTile.x, startTile.y); } }
// Tests potential destinations given the current tile and piece private void testPotentialDestinations(Tile currentTile) { Piece debatedPiece = currentTile.getCurrentPiece(); switch (debatedPiece.toText()) { case 'P': case 'K': case 'N': testSimplexCandidacy(currentTile, debatedPiece); break; default: testComplexCandidacy(currentTile, debatedPiece); break; } }
// Tests potential destinations for simple pieces (i.e. Pawn, King, Knight) private void testSimplexCandidacy(Tile currentTile, Piece debatedPiece) { foreach (Tuple <int, int> coordinate in debatedPiece.getListOfGeneralMoves()) { int newX = currentTile.x + coordinate.Item1, newY = currentTile.y + coordinate.Item2; if (debatedPiece.toText() == 'P') { if (gameManager.boardManager.testPotentialPawnDestination(currentTile, newX, newY)) { drawPotentialDestinations(newX, newY, currentTile); } } else if (gameManager.boardManager.testPotentialSimplexDestination(debatedPiece, newX, newY)) { drawPotentialDestinations(newX, newY, currentTile); } } }