Skip to content

Commit

Permalink
build: Fix build errors
Browse files Browse the repository at this point in the history
Fix:
Severity	Code	Description	Project	File	Line	Suppression State
Error	BC30451	'TudL閜ni' is not declared. It may be inaccessible due to its protection level.	Malom3	malom\Malom3\Main.vb	1070	Active
  • Loading branch information
calcitem committed May 17, 2023
1 parent e22a540 commit 7d4e78a
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 26 deletions.
49 changes: 24 additions & 25 deletions Malom3/Main.vb
Original file line number Diff line number Diff line change
Expand Up @@ -191,8 +191,8 @@ Public Class FrmMain

' 'For i = 0 To 23
' ' Dim adj As Integer = 0
' ' For j = 1 To Rules.CSLTáblaGráf(i, 0)
' ' adj = adj Or (1 << CSLTáblaGráf(i, j))
' ' For j = 1 To Rules.CSLT�blaGr�f(i, 0)
' ' adj = adj Or (1 << CSLT�blaGr�f(i, j))
' ' Next
' ' r = r & adj & ","
' 'Next
Expand Down Expand Up @@ -670,8 +670,8 @@ Public Class Game
Return
End If

p.Quit() 'p-t kiléptetjük, hátha esetleg benne volt egy játékban (pl. NewGame-nél az ezelõttiben)
If _Ply(i) IsNot Nothing Then _Ply(i).Quit() 'kiléptetjük azt a játékost, akinek a helyére p jön
p.Quit() 'p-t kil�ptetj�k, h�tha esetleg benne volt egy j�t�kban (pl. NewGame-n�l az ezel�ttiben)
If _Ply(i) IsNot Nothing Then _Ply(i).Quit() 'kil�ptetj�k azt a j�t�kost, akinek a hely�re p j�n
_Ply(i) = p
If i = 0 Then 'set menus
frm.MnuPly1Human.Checked = p.GetType() = GetType(HumanPlayer)
Expand Down Expand Up @@ -701,7 +701,7 @@ Public Class Game
End Sub

<System.Runtime.ExceptionServices.HandleProcessCorruptedStateExceptionsAttribute>
Public Sub MakeMove(ByVal M As Move) 'a player objektumok hívják meg, amikor lépni szeretnének
Public Sub MakeMove(ByVal M As Move) 'a player objektumok h�vj�k meg, amikor l�pni szeretn�nek
Try
'Debug.Print(Microsoft.VisualBasic.Timer & " MakeMove, sidetomove: " & s.SideToMove) '

Expand Down Expand Up @@ -736,7 +736,7 @@ Public Class Game
Private Sub NotifyPlayer(ByVal i As Integer)
If Not s.over Then
If s.SideToMove = i Then
frm.BeginInvoke(New DToMove(AddressOf Ply(i).ToMove), s) 'itt azért kell BeginInvoke-ot használni, mert azt szeretnénk, hogy a hívó elvégezhesse a dolgát, mielõtt a játékos értesül róla, hogy lépnie kell
frm.BeginInvoke(New DToMove(AddressOf Ply(i).ToMove), s) 'Here we need to use BeginInvoke because we would like the caller to be able to finish their work before the player is informed that they need to move.
Else
frm.BeginInvoke(New DToMove(AddressOf Ply(i).OppToMove), s)
End If
Expand Down Expand Up @@ -807,11 +807,11 @@ Public Class Game
If TypeOf Ply(s.SideToMove) Is HumanPlayer Then
If s.KLE Then frm.LblKov.Text = "Take a stone."
If s.phase = 1 Then
'Dim pr = MaxKSZ - s.FölrakottKorongCount(s.SideToMove)
'Dim pr = MaxKSZ - s.F�lrakottKorongCount(s.SideToMove)
'If pr > 0 Then
' frm.LblFölrak.Text = pr & " stones to place."
' frm.LblF�lrak.Text = pr & " stones to place."
'Else
' frm.LblFölrak.Text = "No more stones to place."
' frm.LblF�lrak.Text = "No more stones to place."
'End If
frm.LblSetnum.Text = MaxKSZ - s.SetStoneCount(0) & ", " & MaxKSZ - s.SetStoneCount(1) & " stones to place."
Else
Expand Down Expand Up @@ -843,8 +843,8 @@ Public Class Game
Dim tmp = current
Do
current = current.Previous
Loop While (current.Previous IsNot Nothing AndAlso Not TypeOf Ply(current.Value.SideToMove) Is HumanPlayer) 'addig vonunk vissza, hogy ne gép következzen
If TypeOf Ply(current.Value.SideToMove) Is ComputerPlayer Then 'ha nem sikerült, akkor visszaállítjuk az eredeti állapotot
Loop While (current.Previous IsNot Nothing AndAlso Not TypeOf Ply(current.Value.SideToMove) Is HumanPlayer) 'addig vonunk vissza, hogy ne g�p k�vetkezzen
If TypeOf Ply(current.Value.SideToMove) Is ComputerPlayer Then 'ha nem siker�lt, akkor vissza�ll�tjuk az eredeti �llapotot
current = tmp
Return False
Else
Expand All @@ -867,8 +867,8 @@ Public Class Game
Dim tmp = current
Do
current = current.Next
Loop While (current.Next IsNot Nothing AndAlso Not TypeOf Ply(current.Value.SideToMove) Is HumanPlayer) 'addig megyünk elõre, hogy ne gép következzen
If TypeOf Ply(current.Value.SideToMove) Is ComputerPlayer Then 'ha nem sikerült, akkor visszaállítjuk az eredeti állapotot
Loop While (current.Next IsNot Nothing AndAlso Not TypeOf Ply(current.Value.SideToMove) Is HumanPlayer) 'addig megy�nk el�re, hogy ne g�p k�vetkezzen
If TypeOf Ply(current.Value.SideToMove) Is ComputerPlayer Then 'ha nem siker�lt, akkor vissza�ll�tjuk az eredeti �llapotot
current = tmp
Return False
Else
Expand Down Expand Up @@ -981,23 +981,23 @@ Public Class Game
End Class

Public Class GameState
Public T(23) As Integer 'a tábla (-1: üres, 0: fehér korong, 1: fekete korong)
Public T(23) As Integer 'a t�bla (-1: �res, 0: feh�r korong, 1: fekete korong)
Public phase As Integer = 1
Public SetStoneCount(1) As Integer 'how many stones the players have set
Public StoneCount(1) As Integer
Public KLE As Boolean 'koronglevétel jön-e
Public KLE As Boolean 'koronglev�tel j�n-e
Public SideToMove As Integer
Public MoveCount As Integer
Public over As Boolean
Public winner As Integer '(-1, ha döntetlen)
Public winner As Integer '(-1, ha d�ntetlen)
Public block As Boolean
Public LastIrrev As Integer

Public Function FutureStoneCount(p As Integer) As Integer
Return StoneCount(p) + MaxKSZ - SetStoneCount(p)
End Function

Public Sub New() 'játszma eleje
Public Sub New() 'j�tszma eleje
For i = 0 To 23
T(i) = -1
Next
Expand Down Expand Up @@ -1062,12 +1062,12 @@ Public Class GameState
End If
LastIrrev = 0
End If
If (TypeOf M Is SetKorong Or TypeOf M Is MoveKorong) AndAlso Malome(M.hov, Me) > -1 And StoneCount(1 - SideToMove) > 0 Then 'ha malmot csinált a lépés es van az ellenfelnek korongja
If (TypeOf M Is SetKorong Or TypeOf M Is MoveKorong) AndAlso Malome(M.hov, Me) > -1 And StoneCount(1 - SideToMove) > 0 Then 'ha malmot csin�lt a l�p�s es van az ellenfelnek korongja
KLE = True
Else
SideToMove = 1 - SideToMove
If SetStoneCount(0) = MaxKSZ And SetStoneCount(1) = MaxKSZ And phase = 1 Then phase = 2 'korongmozgatásra váltás
If Not TudLépni(Me) Then
If SetStoneCount(0) = MaxKSZ And SetStoneCount(1) = MaxKSZ And phase = 1 Then phase = 2 'korongmozgat�sra v�lt�s
If Not TudLepni(Me) Then
over = True
block = True
winner = 1 - SideToMove
Expand Down Expand Up @@ -1195,8 +1195,7 @@ Public Class GameState
End If
End If
End If

If Not KLE AndAlso Not TudLépni(Me) Then 'TudLépni doesn't handle the KLE case. However, we should always have a move in KLE, see the validity check above.
If Not KLE AndAlso Not TudLepni(Me) Then 'TudLepni doesn't handle the KLE case. However, we should always have a move in KLE, see the validity check above.
over = True
block = True
winner = 1 - SideToMove
Expand All @@ -1215,10 +1214,10 @@ Public Class GameState
End Function


Public Sub New(ByVal s As String) 'vágólapról beillesztéshez
Public Sub New(ByVal s As String) 'v�g�lapr�l beilleszt�shez
Dim ss() As String = s.Split(",")
Try
If ss(33) = "malom" OrElse ss(34) = "malom" OrElse ss(35) = "malom" OrElse ss(37) = "malom2" Then 'tudni kell értelmezni a régebbi formátumokat is
If ss(33) = "malom" OrElse ss(34) = "malom" OrElse ss(35) = "malom" OrElse ss(37) = "malom2" Then 'tudni kell �rtelmezni a r�gebbi form�tumokat is
For i = 0 To 23
T(i) = ss(i)
Next
Expand All @@ -1229,7 +1228,7 @@ Public Class GameState
StoneCount(0) = ss(30)
StoneCount(1) = ss(31)
KLE = ss(32)
If ss(33) <> "malom" Then MoveCount = ss(33) Else MoveCount = 10 'csak azért 10, hogy ne 0 legyen, mert akkor nem gondolkodna a következõ két lépésnél, mert azt hinné, hogy a játék eleje van
If ss(33) <> "malom" Then MoveCount = ss(33) Else MoveCount = 10 'It's 10 just so it wouldn't be 0, because then it wouldn't think about the next two steps, because it would think that the game is just beginning.
If ss(33) <> "malom" AndAlso ss(34) <> "malom" Then LastIrrev = ss(34) Else LastIrrev = 0
If StoneCount(0) <> T.Count(Function(x) x = 0) Or StoneCount(1) <> T.Count(Function(x) x = 1) Then Throw New InvalidGameStateException(" Number of stones is incorrect.")
Else
Expand Down
2 changes: 1 addition & 1 deletion Malom3/Rules.vb
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,7 @@ Module Rules
End If
Next
End Function
Public Function TudLépni(ByVal s As GameState) As Boolean 'megmondja, hogy a soron következő játékos tud-e lépni '(doesn't handle the KLE case)
Public Function TudLepni(ByVal s As GameState) As Boolean 'megmondja, hogy a soron következő játékos tud-e lépni '(doesn't handle the KLE case)
Debug.Assert(Not s.KLE)
If s.SetStoneCount(s.SideToMove) = MaxKSZ And s.StoneCount(s.SideToMove) > 3 Then
For i = 0 To 23
Expand Down

0 comments on commit 7d4e78a

Please sign in to comment.