public override IEnumerable <Square> GetAvailableMoves(Board board) { var moves = new List <Square>(); var currentSquare = board.FindPiece(this); var directions = CardinalDirections.Concat(DiagonalDirections).ToList(); Helpers.AddMoves(board, directions, currentSquare, 1, moves, this.Player); return(moves); }
public override IEnumerable <Square> GetAvailableMoves(Board board) { var moves = new List <Square>(); var currentSquare = board.FindPiece(this); var directions = CardinalDirections.Concat(DiagonalDirections).ToList(); for (var i = 1; i < GameSettings.BoardSize; i++) { Helpers.AddMoves(board, directions, currentSquare, i, moves, this.Player); directions = Helpers.UpdateValidDirections(board, directions, currentSquare, i); } return(moves); }