From 2455812fb266b2a00ba5f9b967888d4ce216b3a5 Mon Sep 17 00:00:00 2001 From: CrystalMoogle Date: Sun, 16 Jul 2023 17:40:28 +0100 Subject: [PATCH] Add a message for dealer's turn, also an event to add any message if needed in the future --- BlackjackGUI/BlackjackGUI.vbproj | 74 ++++++++++++++++---------------- BlackjackGUI/GameWindow.vb | 4 ++ BlackjackGUI/game.vb | 2 + 3 files changed, 43 insertions(+), 37 deletions(-) diff --git a/BlackjackGUI/BlackjackGUI.vbproj b/BlackjackGUI/BlackjackGUI.vbproj index 5ea8328..4cdb678 100644 --- a/BlackjackGUI/BlackjackGUI.vbproj +++ b/BlackjackGUI/BlackjackGUI.vbproj @@ -1,45 +1,45 @@  - - WinExe - net6.0-windows - Sub Main - true - WindowsForms - + + WinExe + net6.0-windows + Sub Main + true + WindowsForms + - - - - - + + + + + - - - True - True - Application.myapp - - - True - True - Resources.resx - - + + + True + True + Application.myapp + + + True + True + Resources.resx + + - - - My.Resources - VbMyResourcesResXFileCodeGenerator - Resources.Designer.vb - - + + + My.Resources + VbMyResourcesResXFileCodeGenerator + Resources.Designer.vb + + - - - MyApplicationCodeGenerator - Application.Designer.vb - - + + + MyApplicationCodeGenerator + Application.Designer.vb + + \ No newline at end of file diff --git a/BlackjackGUI/GameWindow.vb b/BlackjackGUI/GameWindow.vb index 84ccc66..2a7c19b 100644 --- a/BlackjackGUI/GameWindow.vb +++ b/BlackjackGUI/GameWindow.vb @@ -59,6 +59,10 @@ StandButton.Enabled = False End Sub + Private Sub MessageLabel(message) Handles game.MessageLabel + WinMessage.Text = message + End Sub + Private Sub EndGame(message) Handles game.EndGame WinMessage.Text = message HitButton.Enabled = False diff --git a/BlackjackGUI/game.vb b/BlackjackGUI/game.vb index 4f6f4e3..e16cdb9 100644 --- a/BlackjackGUI/game.vb +++ b/BlackjackGUI/game.vb @@ -5,6 +5,7 @@ Public Event ShowDealerCard(card) Public Event EndPlayerTurn() Public Event EndGame(winMessage) + Public Event MessageLabel(message) Private player As Player Private dealer As Dealer @@ -108,6 +109,7 @@ Sub DealerTurn() GetTotal(dealer) + RaiseEvent MessageLabel("Dealer's turn...") RaiseEvent EndPlayerTurn() RaiseEvent SetTotalLabels(player.total, dealer.total) RaiseEvent ShowDealerCard(dealer.hidden)