kommentare busfahrer

This commit is contained in:
2026-09-14 21:54:25 +02:00
parent 205126d724
commit e336e6369d
+14 -14
View File
@@ -41,6 +41,7 @@ namespace Casino
} }
} }
//Colin Langer //Colin Langer
//verwandelt den textwert in punktwert um
private static int ParseValue(string wert) private static int ParseValue(string wert)
{ {
return wert.Trim() switch return wert.Trim() switch
@@ -53,6 +54,7 @@ namespace Casino
}; };
} }
//Colin Langer //Colin Langer
//konvertiert das Bild von der Datenbank um
private static BitmapImage ByteArrayToImage(byte[] bytes) private static BitmapImage ByteArrayToImage(byte[] bytes)
{ {
BitmapImage image = new BitmapImage(); BitmapImage image = new BitmapImage();
@@ -119,7 +121,7 @@ namespace Casino
{ {
return; return;
} }
//Prüfen die eingabe
if (!int.TryParse(TxtBet.Text, out int bet) || bet <= 0) if (!int.TryParse(TxtBet.Text, out int bet) || bet <= 0)
{ {
MessageBox.Show( MessageBox.Show(
@@ -156,7 +158,6 @@ namespace Casino
return; return;
} }
// Einsatz vom Konto abziehen
CurrentUser.Geld -= Convert.ToInt32(currentBet); CurrentUser.Geld -= Convert.ToInt32(currentBet);
SaveAccount(); SaveAccount();
@@ -182,6 +183,7 @@ namespace Casino
} }
//Colin Langer //Colin Langer
// lädt und mischt die karten aus der datenbank
private void LoadCards() private void LoadCards()
{ {
deck = db.GetAllCards() deck = db.GetAllCards()
@@ -203,6 +205,7 @@ namespace Casino
} }
} }
//Colin Langer //Colin Langer
// nimmt die oberste karte
private Card DrawCard() private Card DrawCard()
{ {
Card card = deck[0]; Card card = deck[0];
@@ -210,10 +213,8 @@ namespace Casino
return card; return card;
} }
// =========================
// KARTEN ANZEIGEN
// =========================
//Colin Langer //Colin Langer
private void UpdateHandUI() private void UpdateHandUI()
{ {
Bild_1.Source = cardBackImage; Bild_1.Source = cardBackImage;
@@ -246,7 +247,8 @@ namespace Casino
Bild_4.Source = handCards[3].Image; Bild_4.Source = handCards[3].Image;
} }
} }
//Colin Langer
// dreht die karten je nach runde um
private void RevealCurrentCard() private void RevealCurrentCard()
{ {
if (handCards.Count < 4) if (handCards.Count < 4)
@@ -274,9 +276,6 @@ namespace Casino
} }
} }
// =========================
// SPIELLOGIK
// =========================
// Lenard Gerdes // Lenard Gerdes
private async Task ProcessGuessAsync(bool success) private async Task ProcessGuessAsync(bool success)
{ {
@@ -349,6 +348,7 @@ namespace Casino
}; };
} }
//Colin Langer //Colin Langer
// passt die buttons an je nach runde
private async void ColorButton_Click(object sender, RoutedEventArgs e) private async void ColorButton_Click(object sender, RoutedEventArgs e)
{ {
if (sender is not Button button) if (sender is not Button button)
@@ -482,10 +482,8 @@ namespace Casino
SaveAccount(); SaveAccount();
} }
// =========================
// UI
// =========================
//Colin Langer //Colin Langer
// blendet die buttons der jewaligen runde ein
private void SetPhaseUI() private void SetPhaseUI()
{ {
PanelRedBlack.Visibility = Visibility.Collapsed; PanelRedBlack.Visibility = Visibility.Collapsed;
@@ -524,6 +522,7 @@ namespace Casino
} }
} }
//Colin Langer //Colin Langer
// wartet kurz falls ein neuer einsatz eingegeben wird
private void ShowWaitingState() private void ShowWaitingState()
{ {
roundRunning = false; roundRunning = false;
@@ -548,6 +547,7 @@ namespace Casino
Close(); Close();
} }
//Colin Langer //Colin Langer
// verwandelt das bild aus der datenbank um in eine bild für die oberfläche
private static BitmapImage ByteArrayToImage(byte[] bytes) private static BitmapImage ByteArrayToImage(byte[] bytes)
{ {
BitmapImage image = new BitmapImage(); BitmapImage image = new BitmapImage();
@@ -565,9 +565,9 @@ namespace Casino
} }
// ========================= // =========================
// EINSATZfeld Colin Langer // EINSATZFELD Colin Langer
// ========================= // =========================
// In Slots ist die erklärung drin
private static readonly Regex NumberRegex = new Regex("^[0-9]+$"); private static readonly Regex NumberRegex = new Regex("^[0-9]+$");