Advertisement
Just_Tom

Untitled

Mar 24th, 2024
53
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
VisualBasic 1.55 KB | Source Code | 0 0
  1. Public MustInherit Class Piece
  2.     'VARIABLES USEFUL FOR A PIECE
  3.    Protected LegalMoves As ULong
  4.     Protected SquareLocation As Integer
  5.     Protected Dead As Boolean = False
  6.     Protected NomMoved As Integer
  7.     Protected PromotedPiece As Boolean = False
  8.     'CONSTRUCTOR FOR GENERATING A PIECE
  9.    Sub New(StartSquare As Integer, PP As Boolean)
  10.         SquareLocation = StartSquare
  11.         PromotedPiece = PP
  12.     End Sub
  13.     'FUNCTIONS A PIECE MUST HAVE BUT IS SPECIFIC TO THE PIECE
  14.    MustOverride Sub CalculateMove(VBitboard As Bitboard, GenTurn As Turn)
  15.     MustOverride Function GetPieceType() As Integer
  16.  
  17.     'GETTER AND SETTER METHODS FOR ACCESSING VARIABLES
  18.    Public Property GetSetSquareLocation As Integer
  19.         Get
  20.             Return SquareLocation
  21.         End Get
  22.         Set(value As Integer)
  23.             SquareLocation = value
  24.         End Set
  25.     End Property
  26.     Public Property GetSetDead As Boolean
  27.         Get
  28.             Return Dead
  29.         End Get
  30.         Set(value As Boolean)
  31.             Dead = value
  32.         End Set
  33.     End Property
  34.     Public Property GetSetNomPieceMoved As Integer
  35.         Get
  36.             Return NomMoved
  37.         End Get
  38.         Set(value As Integer)
  39.             NomMoved = value
  40.         End Set
  41.     End Property
  42.     Public Function GetLegalMoves() As ULong
  43.         If Dead = False Then
  44.             Return LegalMoves
  45.         Else
  46.             Return Nothing
  47.         End If
  48.     End Function
  49.     Public Function GetPromotedPiece()
  50.         Return PromotedPiece
  51.     End Function
  52. End Class
  53.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement