Add a message for dealer's turn, also an event to add any message if needed in the future

remotes/origin/master
CrystalMoogle 2023-07-16 17:40:28 +01:00
parent 20f702b537
commit 2455812fb2
3 changed files with 43 additions and 37 deletions

View File

@ -1,45 +1,45 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<OutputType>WinExe</OutputType>
<TargetFramework>net6.0-windows</TargetFramework>
<StartupObject>Sub Main</StartupObject>
<UseWindowsForms>true</UseWindowsForms>
<MyType>WindowsForms</MyType>
</PropertyGroup>
<PropertyGroup>
<OutputType>WinExe</OutputType>
<TargetFramework>net6.0-windows</TargetFramework>
<StartupObject>Sub Main</StartupObject>
<UseWindowsForms>true</UseWindowsForms>
<MyType>WindowsForms</MyType>
</PropertyGroup>
<ItemGroup>
<Import Include="System.Data" />
<Import Include="System.Drawing" />
<Import Include="System.Windows.Forms" />
</ItemGroup>
<ItemGroup>
<Import Include="System.Data" />
<Import Include="System.Drawing" />
<Import Include="System.Windows.Forms" />
</ItemGroup>
<ItemGroup>
<Compile Update="My Project\Application.Designer.vb">
<DesignTime>True</DesignTime>
<AutoGen>True</AutoGen>
<DependentUpon>Application.myapp</DependentUpon>
</Compile>
<Compile Update="My Project\Resources.Designer.vb">
<DesignTime>True</DesignTime>
<AutoGen>True</AutoGen>
<DependentUpon>Resources.resx</DependentUpon>
</Compile>
</ItemGroup>
<ItemGroup>
<Compile Update="My Project\Application.Designer.vb">
<DesignTime>True</DesignTime>
<AutoGen>True</AutoGen>
<DependentUpon>Application.myapp</DependentUpon>
</Compile>
<Compile Update="My Project\Resources.Designer.vb">
<DesignTime>True</DesignTime>
<AutoGen>True</AutoGen>
<DependentUpon>Resources.resx</DependentUpon>
</Compile>
</ItemGroup>
<ItemGroup>
<EmbeddedResource Update="My Project\Resources.resx">
<CustomToolNamespace>My.Resources</CustomToolNamespace>
<Generator>VbMyResourcesResXFileCodeGenerator</Generator>
<LastGenOutput>Resources.Designer.vb</LastGenOutput>
</EmbeddedResource>
</ItemGroup>
<ItemGroup>
<EmbeddedResource Update="My Project\Resources.resx">
<CustomToolNamespace>My.Resources</CustomToolNamespace>
<Generator>VbMyResourcesResXFileCodeGenerator</Generator>
<LastGenOutput>Resources.Designer.vb</LastGenOutput>
</EmbeddedResource>
</ItemGroup>
<ItemGroup>
<None Update="My Project\Application.myapp">
<Generator>MyApplicationCodeGenerator</Generator>
<LastGenOutput>Application.Designer.vb</LastGenOutput>
</None>
</ItemGroup>
<ItemGroup>
<None Update="My Project\Application.myapp">
<Generator>MyApplicationCodeGenerator</Generator>
<LastGenOutput>Application.Designer.vb</LastGenOutput>
</None>
</ItemGroup>
</Project>

View File

@ -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

View File

@ -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)