merge_1
This commit is contained in:
+28
-15
@@ -157,25 +157,38 @@ namespace Casino
|
|||||||
|
|
||||||
private void StartRound()
|
private void StartRound()
|
||||||
{
|
{
|
||||||
if (currentBet <= 0 || currentBet > CurrentUser.Geld)
|
try
|
||||||
{
|
{
|
||||||
ShowWaitingState();
|
if (currentBet <= 0 || currentBet > CurrentUser.Geld)
|
||||||
return;
|
{
|
||||||
|
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()
|
private void LoadCards()
|
||||||
|
|||||||
+21
-9
@@ -131,15 +131,27 @@ namespace Casino
|
|||||||
|
|
||||||
private async void Spin(object sender, RoutedEventArgs e)
|
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();
|
int einsatz = Convert.ToInt32(einsatzFeld.Text);
|
||||||
await Spin();
|
users[MainWindow.currentUser].Geld -= einsatz;
|
||||||
users[MainWindow.currentUser].Geld += CheckWin(currentSlot,einsatz);
|
Konto.Text = users[MainWindow.currentUser].Geld.ToString();
|
||||||
Konto.Text = users[MainWindow.currentUser].Geld.ToString();
|
await Spin();
|
||||||
db.UpdateGeld(
|
users[MainWindow.currentUser].Geld += CheckWin(currentSlot, einsatz);
|
||||||
users[MainWindow.currentUser].ID,
|
Konto.Text = users[MainWindow.currentUser].Geld.ToString();
|
||||||
users[MainWindow.currentUser].Geld);
|
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)
|
private void Hauptmenue(object sender, RoutedEventArgs e)
|
||||||
|
|||||||
Reference in New Issue
Block a user