From 7d4e78af0baf34ea9094448cbc3e959f043d570b Mon Sep 17 00:00:00 2001 From: Calcitem Date: Wed, 17 May 2023 23:16:09 +0800 Subject: [PATCH] build: Fix build errors MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 --- Malom3/Main.vb | 49 ++++++++++++++++++++++++------------------------- Malom3/Rules.vb | 2 +- 2 files changed, 25 insertions(+), 26 deletions(-) diff --git a/Malom3/Main.vb b/Malom3/Main.vb index 2ec76ea..6783d9f 100644 --- a/Malom3/Main.vb +++ b/Malom3/Main.vb @@ -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 @@ -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) @@ -701,7 +701,7 @@ Public Class Game End Sub - 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) ' @@ -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 @@ -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 @@ -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 @@ -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 @@ -981,15 +981,15 @@ 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 @@ -997,7 +997,7 @@ Public Class GameState 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 @@ -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 @@ -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 @@ -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 @@ -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 diff --git a/Malom3/Rules.vb b/Malom3/Rules.vb index 84aa402..8174e12 100644 --- a/Malom3/Rules.vb +++ b/Malom3/Rules.vb @@ -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