Advertisement
Just_Tom

Untitled

Mar 24th, 2024
47
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
VisualBasic 1.07 KB | Source Code | 0 0
  1. Private Function GenerateMoves(SentBoard As Board, SourceSquare As Point) As List(Of Point)
  2.     Dim moveable_squares As New List(Of Point)
  3.     Select Case SentBoard.PieceBoard(SourceSquare.X, SourceSquare.Y)
  4.         Case 6, -6
  5.             Dim pawn As New Board.Pawn
  6.             moveable_squares = pawn.CalculateMove(SentBoard, SourceSquare)
  7.         Case 5, -5
  8.             Dim knight As New Board.Knight
  9.             moveable_squares = knight.CalculateMove(SentBoard, SourceSquare)
  10.         Case 4, -4
  11.             Dim bishop As New Board.Bishop
  12.             moveable_squares = bishop.CalculateMove(SentBoard, SourceSquare)
  13.         Case 3, -3
  14.             Dim rook As New Board.Rook
  15.             moveable_squares = rook.CalculateMove(SentBoard, SourceSquare)
  16.         Case 2, -2
  17.             Dim queen As New Board.Queen
  18.             moveable_squares = queen.CalculateMove(SentBoard, SourceSquare)
  19.         Case 1, -1
  20.             Dim king As New Board.King
  21.             moveable_squares = king.CalculateMove(SentBoard, SourceSquare)
  22.     End Select
  23.     Return moveable_squares
  24. End Function
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement