From 78a22d9c0e1a2252275dc5d66d783c902dc05ace Mon Sep 17 00:00:00 2001 From: "NBTEMP\\bib" Date: Mon, 14 Sep 2026 22:27:38 +0200 Subject: [PATCH] Sound merge --- Casino/Slots.xaml.cs | 39 +++++++++++++++++++++++---------------- 1 file changed, 23 insertions(+), 16 deletions(-) diff --git a/Casino/Slots.xaml.cs b/Casino/Slots.xaml.cs index ecc69c5..a3ab55a 100644 --- a/Casino/Slots.xaml.cs +++ b/Casino/Slots.xaml.cs @@ -45,6 +45,7 @@ namespace Casino private int highestWin = 5; + private int bestSoundId; // Lenard Gerdes public Slots() @@ -62,9 +63,9 @@ namespace Casino AlleBilder = new List { db.GetCardImage(2),db.GetCardImage(3), - db.GetCardImage(4),db.GetCardImage(5), + /*db.GetCardImage(4),db.GetCardImage(5), db.GetCardImage(6),db.GetCardImage(7), - db.GetCardImage(8),db.GetCardImage(9), db.GetCardImage(10) + db.GetCardImage(8),db.GetCardImage(9), db.GetCardImage(10)*/ }; Konto.Text = users[MainWindow.currentUser].Geld.ToString(); @@ -166,6 +167,14 @@ namespace Casino Close(); } + void UpdateSound(int soundId) + { + // Speichert nur den EINEN soundId-Wert, der am höchsten ist + if (soundId > bestSoundId) + { + bestSoundId = soundId; + } + } // Lenard Gerdes public decimal CheckWin(int[,] board, decimal einsatz) @@ -264,7 +273,7 @@ namespace Casino if (fullBoard) { multiplikator += FULLBOARD; - highestWin++; + highestWin = 12; } if (multiplikator != 0) PlayWinSound(); @@ -292,33 +301,40 @@ namespace Casino } if (gleiche >= 3) + { gewinn += DREI; + if (5 > bestSoundId) bestSoundId = 5; + } if (gleiche >= 4) { gewinn += VIER; highestWin++; + if (6 > bestSoundId) bestSoundId = 6; } if (gleiche >= 5) { gewinn += FUENF; highestWin++; + if (7 > bestSoundId) bestSoundId = 7; } if (gleiche >= 6) { gewinn += SECHS; highestWin++; + if (8 > bestSoundId) bestSoundId = 8; } } - - - return gewinn; } - + void PlayWinSound() + { + audio.PlaySound(db.GetSound(bestSoundId)); + highestWin = 5; + } //Numberfield Colin Langer private static readonly Regex _regex = new Regex("^[0-9]"); // Regex to match non-numeric input @@ -350,14 +366,5 @@ namespace Casino } } } - - // Lenard Gerdes - void PlayWinSound() - { - audio.PlaySound(db.GetSound(highestWin)); - highestWin = 5; - } } - - }