This commit is contained in:
2026-09-13 15:59:13 +02:00
parent cf90775bad
commit 51f22f4155
2 changed files with 50 additions and 25 deletions
+28 -15
View File
@@ -157,25 +157,38 @@ namespace Casino
private void StartRound()
{
if (currentBet <= 0 || currentBet > CurrentUser.Geld)
try
{
ShowWaitingState();
return;
if (currentBet <= 0 || currentBet > CurrentUser.Geld)
{
ShowWaitingState();
return;
}
// Einsatz vom Konto abziehen
CurrentUser.Geld -= Convert.ToInt32(currentBet);
SaveAccount();
currentProfit = 0;
currentPhase = 0;
roundRunning = true;
TxtBet.IsEnabled = false;
LoadCards();
UpdateHandUI();
UpdateWinDisplay();
SetPhaseUI();
}
catch (NullReferenceException)
{
MessageBox.Show(
"Bitte ein Betrag eingeben",
"Fehlermeldung 101",
MessageBoxButton.OK,
MessageBoxImage.Information);
}
// Einsatz vom Konto abziehen
CurrentUser.Geld -= Convert.ToInt32(currentBet);
SaveAccount();
currentProfit = 0;
currentPhase = 0;
roundRunning = true;
TxtBet.IsEnabled = false;
LoadCards();
UpdateHandUI();
UpdateWinDisplay();
SetPhaseUI();
}
private void LoadCards()
+21 -9
View File
@@ -131,15 +131,27 @@ namespace Casino
private async void Spin(object sender, RoutedEventArgs e)
{
int einsatz = Convert.ToInt32(einsatzFeld.Text);
users[MainWindow.currentUser].Geld-=einsatz;
Konto.Text = users[MainWindow.currentUser].Geld.ToString();
await Spin();
users[MainWindow.currentUser].Geld += CheckWin(currentSlot,einsatz);
Konto.Text = users[MainWindow.currentUser].Geld.ToString();
db.UpdateGeld(
users[MainWindow.currentUser].ID,
users[MainWindow.currentUser].Geld);
int einsatz = Convert.ToInt32(einsatzFeld.Text);
users[MainWindow.currentUser].Geld -= einsatz;
Konto.Text = users[MainWindow.currentUser].Geld.ToString();
await Spin();
users[MainWindow.currentUser].Geld += CheckWin(currentSlot, einsatz);
Konto.Text = users[MainWindow.currentUser].Geld.ToString();
db.UpdateGeld(
users[MainWindow.currentUser].ID,
users[MainWindow.currentUser].Geld);
/* catch (NullReferenceException)
{
MessageBox.Show(
"Bitte ein Betrag eingeben",
"Fehlermeldung 101",
MessageBoxButton.OK,
MessageBoxImage.Information);
}*/
}
private void Hauptmenue(object sender, RoutedEventArgs e)