Sound merge

This commit is contained in:
2026-09-14 22:27:38 +02:00
parent 571367ca8c
commit 78a22d9c0e
+23 -16
View File
@@ -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<Byte[]>
{
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;
}
}
}