public void Should_GenerateOneMoveSouthEast() { // execute ChessPosition position = _mover.SouthEast(ChessPosition.B2); // verify Assert.AreEqual(ChessPosition.C1, position); }
private ChessPosition GenerateCaptureEast(IBoardState enemyPieces, IChessPieceMover cpm) { ChessPosition potentialCapture = Color == ChessColor.White ? cpm.NorthEast(Location) : cpm.SouthEast(Location); bool isPieceAtCaptureLocation = enemyPieces.Contains(potentialCapture); return(isPieceAtCaptureLocation ? potentialCapture : ChessPosition.None); }
private void GenerateSouthEastMoves(IBoardState boardState, IChessPieceMover cpm) { ChessPosition nextMove = cpm.SouthEast(Location); if (!boardState.Contains(nextMove)) { MoveSet.Add(nextMove); } }
private void GenerateEastSouthEastMove(IBoardState boardState, IChessPieceMover cpm) { ChessPosition move = cpm.East(cpm.SouthEast(Location)); if (!boardState.Contains(move)) { MoveSet.Add(move); } }
private void GenerateSouthEastCaptures(IBoardState enemyBoardState, IChessPieceMover cpm) { ChessPosition capture = cpm.SouthEast(Location); AddCaptureToCaptureSet(capture, enemyBoardState); }
private ChessPosition GenerateThreatenedEast(IChessPieceMover cpm) { return(Color == ChessColor.White ? cpm.NorthEast(Location) : cpm.SouthEast(Location)); }