Aufteilung
This commit is contained in:
@@ -9,7 +9,7 @@ using System.Windows.Shapes;
|
|||||||
|
|
||||||
namespace Casino
|
namespace Casino
|
||||||
{
|
{
|
||||||
class Audioplayer
|
class Audioplayer //ki
|
||||||
{
|
{
|
||||||
private readonly MediaPlayer player = new MediaPlayer();
|
private readonly MediaPlayer player = new MediaPlayer();
|
||||||
private readonly MediaPlayer shortplayer = new MediaPlayer();
|
private readonly MediaPlayer shortplayer = new MediaPlayer();
|
||||||
|
|||||||
@@ -11,6 +11,7 @@
|
|||||||
WindowState="Maximized"
|
WindowState="Maximized"
|
||||||
WindowStyle="None"
|
WindowStyle="None"
|
||||||
Background="#195925">
|
Background="#195925">
|
||||||
|
<!-- Lenard Gerdes -->
|
||||||
|
|
||||||
<Grid>
|
<Grid>
|
||||||
<Grid.ColumnDefinitions>
|
<Grid.ColumnDefinitions>
|
||||||
@@ -37,7 +38,6 @@
|
|||||||
<RowDefinition Height="1*"></RowDefinition>
|
<RowDefinition Height="1*"></RowDefinition>
|
||||||
</Grid.RowDefinitions>
|
</Grid.RowDefinitions>
|
||||||
|
|
||||||
<!-- Main Menu -->
|
|
||||||
<Button Grid.Column="0"
|
<Button Grid.Column="0"
|
||||||
Grid.Row="0"
|
Grid.Row="0"
|
||||||
Content="Main Menu"
|
Content="Main Menu"
|
||||||
@@ -53,7 +53,7 @@
|
|||||||
<Image Grid.Column="7" Grid.Row="2" x:Name="Bild_3" Margin="5" Stretch="Uniform"/>
|
<Image Grid.Column="7" Grid.Row="2" x:Name="Bild_3" Margin="5" Stretch="Uniform"/>
|
||||||
<Image Grid.Column="9" Grid.Row="2" x:Name="Bild_4" Margin="5" Stretch="Uniform"/>
|
<Image Grid.Column="9" Grid.Row="2" x:Name="Bild_4" Margin="5" Stretch="Uniform"/>
|
||||||
|
|
||||||
<!-- Frage 1: Rot / Schwarz -->
|
<!-- Rot / Schwarz -->
|
||||||
<StackPanel x:Name="PanelRedBlack"
|
<StackPanel x:Name="PanelRedBlack"
|
||||||
Grid.Row="3"
|
Grid.Row="3"
|
||||||
Grid.Column="3"
|
Grid.Column="3"
|
||||||
@@ -86,7 +86,7 @@
|
|||||||
Tag="Black"/>
|
Tag="Black"/>
|
||||||
</StackPanel>
|
</StackPanel>
|
||||||
|
|
||||||
<!-- Frage 2: Höher / Niedriger -->
|
<!-- Höher / Niedriger -->
|
||||||
<StackPanel x:Name="PanelHigherLower"
|
<StackPanel x:Name="PanelHigherLower"
|
||||||
Grid.Row="3"
|
Grid.Row="3"
|
||||||
Grid.Column="3"
|
Grid.Column="3"
|
||||||
@@ -120,7 +120,7 @@
|
|||||||
Tag="Lower"/>
|
Tag="Lower"/>
|
||||||
</StackPanel>
|
</StackPanel>
|
||||||
|
|
||||||
<!-- Frage 3: Innen / Außen -->
|
<!-- Innen / Außen -->
|
||||||
<StackPanel x:Name="PanelInsideOutside"
|
<StackPanel x:Name="PanelInsideOutside"
|
||||||
Grid.Row="3"
|
Grid.Row="3"
|
||||||
Grid.Column="3"
|
Grid.Column="3"
|
||||||
@@ -154,7 +154,7 @@
|
|||||||
Tag="Outside"/>
|
Tag="Outside"/>
|
||||||
</StackPanel>
|
</StackPanel>
|
||||||
|
|
||||||
<!-- Frage 4: Symbol -->
|
<!-- Symbol -->
|
||||||
<StackPanel x:Name="PanelSuit"
|
<StackPanel x:Name="PanelSuit"
|
||||||
Grid.Row="3"
|
Grid.Row="3"
|
||||||
Grid.Column="3"
|
Grid.Column="3"
|
||||||
|
|||||||
+37
-63
@@ -15,7 +15,7 @@ namespace Casino
|
|||||||
{
|
{
|
||||||
public partial class Busfahrer : Window
|
public partial class Busfahrer : Window
|
||||||
{
|
{
|
||||||
public class Card
|
public class Card //Colin Langer
|
||||||
{
|
{
|
||||||
public int Id { get; set; }
|
public int Id { get; set; }
|
||||||
public string WertRaw { get; set; } = string.Empty;
|
public string WertRaw { get; set; } = string.Empty;
|
||||||
@@ -25,11 +25,9 @@ namespace Casino
|
|||||||
|
|
||||||
public bool IsRed =>
|
public bool IsRed =>
|
||||||
FarbeRaw.Equals("Hearts", StringComparison.OrdinalIgnoreCase) ||
|
FarbeRaw.Equals("Hearts", StringComparison.OrdinalIgnoreCase) ||
|
||||||
FarbeRaw.Equals("Diamonds", StringComparison.OrdinalIgnoreCase) ||
|
FarbeRaw.Equals("Diamond", StringComparison.OrdinalIgnoreCase);
|
||||||
FarbeRaw.Equals("Diamond", StringComparison.OrdinalIgnoreCase) ||
|
|
||||||
FarbeRaw.Equals("Herz", StringComparison.OrdinalIgnoreCase) ||
|
|
||||||
FarbeRaw.Equals("Karo", StringComparison.OrdinalIgnoreCase);
|
|
||||||
|
|
||||||
|
//Colin Langer
|
||||||
public Card(int id, string wert, string farbe, byte[] imgBytes)
|
public Card(int id, string wert, string farbe, byte[] imgBytes)
|
||||||
{
|
{
|
||||||
Id = id;
|
Id = id;
|
||||||
@@ -42,19 +40,19 @@ namespace Casino
|
|||||||
Image = ByteArrayToImage(imgBytes);
|
Image = ByteArrayToImage(imgBytes);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
//Colin Langer
|
||||||
private static int ParseValue(string wert)
|
private static int ParseValue(string wert)
|
||||||
{
|
{
|
||||||
return wert.Trim() switch
|
return wert.Trim() switch
|
||||||
{
|
{
|
||||||
"Jack" or "Bube" => 11,
|
"Jack" => 11,
|
||||||
"Queen" or "Dame" => 12,
|
"Queen" => 12,
|
||||||
"King" or "König" => 13,
|
"King" => 13,
|
||||||
"Ace" or "Ass" => 14,
|
"Ace" => 14,
|
||||||
_ => int.TryParse(wert, out int value) ? value : 0
|
_ => int.TryParse(wert, out int value) ? value : 0
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
//Colin Langer
|
||||||
private static BitmapImage ByteArrayToImage(byte[] bytes)
|
private static BitmapImage ByteArrayToImage(byte[] bytes)
|
||||||
{
|
{
|
||||||
BitmapImage image = new BitmapImage();
|
BitmapImage image = new BitmapImage();
|
||||||
@@ -98,30 +96,23 @@ namespace Casino
|
|||||||
|
|
||||||
private User CurrentUser => users[MainWindow.currentUser];
|
private User CurrentUser => users[MainWindow.currentUser];
|
||||||
|
|
||||||
// =========================
|
// Lenard Gerdes
|
||||||
// KONTO
|
|
||||||
// =========================
|
|
||||||
|
|
||||||
private void UpdateAccountDisplay()
|
private void UpdateAccountDisplay()
|
||||||
{
|
{
|
||||||
Konto.Text = CurrentUser.Geld.ToString();
|
Konto.Text = CurrentUser.Geld.ToString();
|
||||||
}
|
}
|
||||||
|
// Lenard Gerdes
|
||||||
private void SaveAccount()
|
private void SaveAccount()
|
||||||
{
|
{
|
||||||
db.UpdateGeld(CurrentUser.ID, CurrentUser.Geld);
|
db.UpdateGeld(CurrentUser.ID, CurrentUser.Geld);
|
||||||
UpdateAccountDisplay();
|
UpdateAccountDisplay();
|
||||||
}
|
}
|
||||||
|
//Colin Langer
|
||||||
// =========================
|
|
||||||
// SPIEL STARTEN
|
|
||||||
// =========================
|
|
||||||
|
|
||||||
private void BtnStart_Click(object sender, RoutedEventArgs e)
|
private void BtnStart_Click(object sender, RoutedEventArgs e)
|
||||||
{
|
{
|
||||||
StartGameFromInput();
|
StartGameFromInput();
|
||||||
}
|
}
|
||||||
|
//Colin Langer
|
||||||
private void StartGameFromInput()
|
private void StartGameFromInput()
|
||||||
{
|
{
|
||||||
if (roundRunning)
|
if (roundRunning)
|
||||||
@@ -154,7 +145,7 @@ namespace Casino
|
|||||||
currentBet = bet;
|
currentBet = bet;
|
||||||
StartRound();
|
StartRound();
|
||||||
}
|
}
|
||||||
|
//Colin Langer
|
||||||
private void StartRound()
|
private void StartRound()
|
||||||
{
|
{
|
||||||
try
|
try
|
||||||
@@ -190,7 +181,7 @@ namespace Casino
|
|||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
//Colin Langer
|
||||||
private void LoadCards()
|
private void LoadCards()
|
||||||
{
|
{
|
||||||
deck = db.GetAllCards()
|
deck = db.GetAllCards()
|
||||||
@@ -211,7 +202,7 @@ namespace Casino
|
|||||||
handCards.Add(DrawCard());
|
handCards.Add(DrawCard());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
//Colin Langer
|
||||||
private Card DrawCard()
|
private Card DrawCard()
|
||||||
{
|
{
|
||||||
Card card = deck[0];
|
Card card = deck[0];
|
||||||
@@ -222,7 +213,7 @@ namespace Casino
|
|||||||
// =========================
|
// =========================
|
||||||
// KARTEN ANZEIGEN
|
// KARTEN ANZEIGEN
|
||||||
// =========================
|
// =========================
|
||||||
|
//Colin Langer
|
||||||
private void UpdateHandUI()
|
private void UpdateHandUI()
|
||||||
{
|
{
|
||||||
Bild_1.Source = cardBackImage;
|
Bild_1.Source = cardBackImage;
|
||||||
@@ -286,7 +277,7 @@ namespace Casino
|
|||||||
// =========================
|
// =========================
|
||||||
// SPIELLOGIK
|
// SPIELLOGIK
|
||||||
// =========================
|
// =========================
|
||||||
|
// Lenard Gerdes
|
||||||
private async Task ProcessGuessAsync(bool success)
|
private async Task ProcessGuessAsync(bool success)
|
||||||
{
|
{
|
||||||
if (!roundRunning)
|
if (!roundRunning)
|
||||||
@@ -345,7 +336,7 @@ namespace Casino
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
//Colin Langer
|
||||||
private decimal CalculateCurrentProfit()
|
private decimal CalculateCurrentProfit()
|
||||||
{
|
{
|
||||||
return currentPhase switch
|
return currentPhase switch
|
||||||
@@ -357,11 +348,7 @@ namespace Casino
|
|||||||
_ => 0
|
_ => 0
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
//Colin Langer
|
||||||
// =========================
|
|
||||||
// FRAGEN
|
|
||||||
// =========================
|
|
||||||
|
|
||||||
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)
|
||||||
@@ -383,7 +370,7 @@ namespace Casino
|
|||||||
|
|
||||||
await ProcessGuessAsync(success);
|
await ProcessGuessAsync(success);
|
||||||
}
|
}
|
||||||
|
//Colin Langer
|
||||||
private async void HigherLowerButton_Click(object sender, RoutedEventArgs e)
|
private async void HigherLowerButton_Click(object sender, RoutedEventArgs e)
|
||||||
{
|
{
|
||||||
if (sender is not Button button)
|
if (sender is not Button button)
|
||||||
@@ -402,7 +389,7 @@ namespace Casino
|
|||||||
|
|
||||||
await ProcessGuessAsync(success);
|
await ProcessGuessAsync(success);
|
||||||
}
|
}
|
||||||
|
//Colin Langer
|
||||||
private async void InsideOutsideButton_Click(object sender, RoutedEventArgs e)
|
private async void InsideOutsideButton_Click(object sender, RoutedEventArgs e)
|
||||||
{
|
{
|
||||||
if (sender is not Button button)
|
if (sender is not Button button)
|
||||||
@@ -424,7 +411,7 @@ namespace Casino
|
|||||||
|
|
||||||
await ProcessGuessAsync(success);
|
await ProcessGuessAsync(success);
|
||||||
}
|
}
|
||||||
|
//Colin Langer
|
||||||
private async void BtnSuit_Click(object sender, RoutedEventArgs e)
|
private async void BtnSuit_Click(object sender, RoutedEventArgs e)
|
||||||
{
|
{
|
||||||
if (sender is not Button button || button.Tag == null)
|
if (sender is not Button button || button.Tag == null)
|
||||||
@@ -439,7 +426,7 @@ namespace Casino
|
|||||||
|
|
||||||
await ProcessGuessAsync(success);
|
await ProcessGuessAsync(success);
|
||||||
}
|
}
|
||||||
|
//Colin Langer
|
||||||
private static bool IsSameSuit(string cardSuit, string chosenSuit)
|
private static bool IsSameSuit(string cardSuit, string chosenSuit)
|
||||||
{
|
{
|
||||||
if (cardSuit.Equals(chosenSuit, StringComparison.OrdinalIgnoreCase))
|
if (cardSuit.Equals(chosenSuit, StringComparison.OrdinalIgnoreCase))
|
||||||
@@ -449,25 +436,20 @@ namespace Casino
|
|||||||
|
|
||||||
return chosenSuit switch
|
return chosenSuit switch
|
||||||
{
|
{
|
||||||
"Hearts" => cardSuit.Equals("Herz", StringComparison.OrdinalIgnoreCase),
|
"Hearts" => cardSuit.Equals("Hearts", StringComparison.OrdinalIgnoreCase),
|
||||||
"Diamonds" => cardSuit.Equals("Karo", StringComparison.OrdinalIgnoreCase) ||
|
"Diamonds" => cardSuit.Equals("Diamond", StringComparison.OrdinalIgnoreCase),
|
||||||
cardSuit.Equals("Diamond", StringComparison.OrdinalIgnoreCase),
|
"Spades" => cardSuit.Equals("Spades", StringComparison.OrdinalIgnoreCase),
|
||||||
"Spades" => cardSuit.Equals("Pik", StringComparison.OrdinalIgnoreCase),
|
"Clubs" => cardSuit.Equals("Clubs", StringComparison.OrdinalIgnoreCase),
|
||||||
"Clubs" => cardSuit.Equals("Kreuz", StringComparison.OrdinalIgnoreCase),
|
|
||||||
_ => false
|
_ => false
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
//Colin Langer
|
||||||
private enum CardColor
|
private enum CardColor
|
||||||
{
|
{
|
||||||
Red,
|
Red,
|
||||||
Black
|
Black
|
||||||
}
|
}
|
||||||
|
//Colin Langer
|
||||||
// =========================
|
|
||||||
// CASH OUT
|
|
||||||
// =========================
|
|
||||||
|
|
||||||
private void BtnCashOut_Click(object sender, RoutedEventArgs e)
|
private void BtnCashOut_Click(object sender, RoutedEventArgs e)
|
||||||
{
|
{
|
||||||
if (!roundRunning || currentProfit <= 0)
|
if (!roundRunning || currentProfit <= 0)
|
||||||
@@ -488,7 +470,7 @@ namespace Casino
|
|||||||
|
|
||||||
ShowWaitingState();
|
ShowWaitingState();
|
||||||
}
|
}
|
||||||
|
//Colin Langer
|
||||||
private void PayoutCurrentProfit()
|
private void PayoutCurrentProfit()
|
||||||
{
|
{
|
||||||
if (currentProfit <= 0)
|
if (currentProfit <= 0)
|
||||||
@@ -503,7 +485,7 @@ namespace Casino
|
|||||||
// =========================
|
// =========================
|
||||||
// UI
|
// UI
|
||||||
// =========================
|
// =========================
|
||||||
|
//Colin Langer
|
||||||
private void SetPhaseUI()
|
private void SetPhaseUI()
|
||||||
{
|
{
|
||||||
PanelRedBlack.Visibility = Visibility.Collapsed;
|
PanelRedBlack.Visibility = Visibility.Collapsed;
|
||||||
@@ -541,7 +523,7 @@ namespace Casino
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
//Colin Langer
|
||||||
private void ShowWaitingState()
|
private void ShowWaitingState()
|
||||||
{
|
{
|
||||||
roundRunning = false;
|
roundRunning = false;
|
||||||
@@ -554,26 +536,18 @@ namespace Casino
|
|||||||
BtnStart.Visibility = Visibility.Visible;
|
BtnStart.Visibility = Visibility.Visible;
|
||||||
TxtBet.IsEnabled = true;
|
TxtBet.IsEnabled = true;
|
||||||
}
|
}
|
||||||
|
//Colin Langer
|
||||||
private void UpdateWinDisplay()
|
private void UpdateWinDisplay()
|
||||||
{
|
{
|
||||||
BtnCashOut.Content = $"Cash Out (${currentProfit:F2})";
|
BtnCashOut.Content = $"Cash Out (${currentProfit:F2})";
|
||||||
}
|
}
|
||||||
|
//Colin Langer
|
||||||
// =========================
|
|
||||||
// HAUPTMENÜ
|
|
||||||
// =========================
|
|
||||||
|
|
||||||
private void Hauptmenue(object sender, RoutedEventArgs e)
|
private void Hauptmenue(object sender, RoutedEventArgs e)
|
||||||
{
|
{
|
||||||
music.Stop();
|
music.Stop();
|
||||||
Close();
|
Close();
|
||||||
}
|
}
|
||||||
|
//Colin Langer
|
||||||
// =========================
|
|
||||||
// BILD AUS BYTE[]
|
|
||||||
// =========================
|
|
||||||
|
|
||||||
private static BitmapImage ByteArrayToImage(byte[] bytes)
|
private static BitmapImage ByteArrayToImage(byte[] bytes)
|
||||||
{
|
{
|
||||||
BitmapImage image = new BitmapImage();
|
BitmapImage image = new BitmapImage();
|
||||||
@@ -591,7 +565,7 @@ namespace Casino
|
|||||||
}
|
}
|
||||||
|
|
||||||
// =========================
|
// =========================
|
||||||
// EINSATZ VALIDIERUNG
|
// EINSATZfeld Colin Langer
|
||||||
// =========================
|
// =========================
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
+14
-13
@@ -17,6 +17,7 @@ namespace Casino
|
|||||||
{
|
{
|
||||||
ObservableCollection<User> user = new ObservableCollection<User>();
|
ObservableCollection<User> user = new ObservableCollection<User>();
|
||||||
|
|
||||||
|
//Lenard Gerdes
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
MySql.Data.MySqlClient.MySqlConnection myConnection;
|
MySql.Data.MySqlClient.MySqlConnection myConnection;
|
||||||
@@ -84,7 +85,7 @@ namespace Casino
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//Colin Langer
|
||||||
public byte[] GetCardImage(int id)
|
public byte[] GetCardImage(int id)
|
||||||
{
|
{
|
||||||
byte[] imageBytes = null;
|
byte[] imageBytes = null;
|
||||||
@@ -108,7 +109,7 @@ namespace Casino
|
|||||||
|
|
||||||
return imageBytes;
|
return imageBytes;
|
||||||
}
|
}
|
||||||
|
//Cloin Langer
|
||||||
public List<Busfahrer.Card> GetAllCards()
|
public List<Busfahrer.Card> GetAllCards()
|
||||||
{
|
{
|
||||||
var cards = new List<Busfahrer.Card>();
|
var cards = new List<Busfahrer.Card>();
|
||||||
@@ -137,8 +138,8 @@ namespace Casino
|
|||||||
|
|
||||||
return cards;
|
return cards;
|
||||||
}
|
}
|
||||||
|
|
||||||
// NEU: Holt das Bild der Kartenrückseite
|
// Holt das Bild der Kartenrückseite Colin Langer
|
||||||
public byte[] GetCardBackImage()
|
public byte[] GetCardBackImage()
|
||||||
{
|
{
|
||||||
byte[] imageBytes = null;
|
byte[] imageBytes = null;
|
||||||
@@ -211,10 +212,10 @@ namespace Casino
|
|||||||
connection.Open();
|
connection.Open();
|
||||||
|
|
||||||
string sql = @"
|
string sql = @"
|
||||||
SELECT COUNT(*)
|
SELECT COUNT(*)
|
||||||
FROM Nutzer
|
FROM Nutzer
|
||||||
WHERE id = @id
|
WHERE id = @id
|
||||||
AND Rolle = 'Admin'";
|
AND Rolle = 'Admin'";
|
||||||
|
|
||||||
using MySqlCommand command = new MySqlCommand(sql, connection);
|
using MySqlCommand command = new MySqlCommand(sql, connection);
|
||||||
|
|
||||||
@@ -245,8 +246,8 @@ namespace Casino
|
|||||||
connection.Open();
|
connection.Open();
|
||||||
|
|
||||||
string sql = @"
|
string sql = @"
|
||||||
DELETE FROM Nutzer
|
DELETE FROM Nutzer
|
||||||
WHERE id = @id";
|
WHERE id = @id";
|
||||||
|
|
||||||
using MySqlCommand command = new MySqlCommand(sql, connection);
|
using MySqlCommand command = new MySqlCommand(sql, connection);
|
||||||
|
|
||||||
@@ -283,13 +284,13 @@ namespace Casino
|
|||||||
connection.Open();
|
connection.Open();
|
||||||
|
|
||||||
string sql = @"
|
string sql = @"
|
||||||
UPDATE Nutzer
|
UPDATE Nutzer
|
||||||
SET name = @name,
|
SET name = @name,
|
||||||
age = @age,
|
age = @age,
|
||||||
passwort = @passwort,
|
passwort = @passwort,
|
||||||
geld = @geld,
|
geld = @geld,
|
||||||
Rolle = @rolle
|
Rolle = @rolle
|
||||||
WHERE id = @id";
|
WHERE id = @id";
|
||||||
|
|
||||||
using MySqlCommand command = new MySqlCommand(sql, connection);
|
using MySqlCommand command = new MySqlCommand(sql, connection);
|
||||||
|
|
||||||
|
|||||||
@@ -1,22 +0,0 @@
|
|||||||
using System;
|
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.Linq;
|
|
||||||
using System.Text;
|
|
||||||
using System.Threading.Tasks;
|
|
||||||
|
|
||||||
namespace Casino
|
|
||||||
{
|
|
||||||
internal class Decks
|
|
||||||
{
|
|
||||||
int Deckid { get; set; }
|
|
||||||
int Kartenid { get; set; }
|
|
||||||
string name { get; set; }
|
|
||||||
|
|
||||||
public Decks(int d, int k, string n)
|
|
||||||
{
|
|
||||||
Deckid = d;
|
|
||||||
Kartenid = k;
|
|
||||||
name = n;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -5,6 +5,7 @@
|
|||||||
Height="550"
|
Height="550"
|
||||||
Width="500"
|
Width="500"
|
||||||
WindowStartupLocation="CenterScreen">
|
WindowStartupLocation="CenterScreen">
|
||||||
|
<!-- Lenard Gerdes -->
|
||||||
|
|
||||||
<Grid Margin="25">
|
<Grid Margin="25">
|
||||||
|
|
||||||
|
|||||||
+2
-1
@@ -12,7 +12,8 @@
|
|||||||
Background="Transparent"
|
Background="Transparent"
|
||||||
AllowsTransparency="True"
|
AllowsTransparency="True"
|
||||||
MouseDown="Window_MouseDown">
|
MouseDown="Window_MouseDown">
|
||||||
|
<!-- Lenard Gerdes -->
|
||||||
|
|
||||||
<Border CornerRadius="20"
|
<Border CornerRadius="20"
|
||||||
Background="#590D00"
|
Background="#590D00"
|
||||||
BorderBrush="Gold"
|
BorderBrush="Gold"
|
||||||
|
|||||||
@@ -26,6 +26,7 @@ namespace Casino
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
public partial class Login : Window
|
public partial class Login : Window
|
||||||
{
|
{
|
||||||
|
//Alles von Lenard Gerdes
|
||||||
Database db = new Database();
|
Database db = new Database();
|
||||||
ObservableCollection<User> users = new ObservableCollection<User>();
|
ObservableCollection<User> users = new ObservableCollection<User>();
|
||||||
|
|
||||||
|
|||||||
@@ -8,8 +8,8 @@
|
|||||||
Title="MainWindow" Height="450" Width="800"
|
Title="MainWindow" Height="450" Width="800"
|
||||||
WindowStartupLocation="CenterScreen"
|
WindowStartupLocation="CenterScreen"
|
||||||
>
|
>
|
||||||
|
<!-- Lenard Gerdes -->
|
||||||
|
|
||||||
<Border
|
<Border
|
||||||
|
|
||||||
Background="#590D00"
|
Background="#590D00"
|
||||||
|
|||||||
@@ -17,6 +17,7 @@ namespace Casino
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
public partial class MainWindow : Window
|
public partial class MainWindow : Window
|
||||||
{
|
{
|
||||||
|
// Alles von Lenard Gerdes
|
||||||
public static int currentUser;
|
public static int currentUser;
|
||||||
ObservableCollection<User> users = new ObservableCollection<User>();
|
ObservableCollection<User> users = new ObservableCollection<User>();
|
||||||
Database db = new Database();
|
Database db = new Database();
|
||||||
@@ -27,6 +28,7 @@ namespace Casino
|
|||||||
setup();
|
setup();
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private void Slots_Click(object sender, RoutedEventArgs e)
|
private void Slots_Click(object sender, RoutedEventArgs e)
|
||||||
{
|
{
|
||||||
|
|
||||||
|
|||||||
+4
-3
@@ -9,12 +9,13 @@
|
|||||||
WindowState="Maximized"
|
WindowState="Maximized"
|
||||||
WindowStyle="None"
|
WindowStyle="None"
|
||||||
Background="Transparent">
|
Background="Transparent">
|
||||||
|
<!-- Lenard Gerdes -->
|
||||||
|
|
||||||
<Border
|
<Border
|
||||||
|
|
||||||
Background="#590D00"
|
Background="#590D00"
|
||||||
BorderBrush="Gold"
|
BorderBrush="Gold"
|
||||||
BorderThickness="5">
|
BorderThickness="5">
|
||||||
|
|
||||||
<Grid>
|
<Grid>
|
||||||
<Grid.ColumnDefinitions>
|
<Grid.ColumnDefinitions>
|
||||||
|
|||||||
+13
-27
@@ -22,7 +22,7 @@ namespace Casino
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
public partial class Slots : Window
|
public partial class Slots : Window
|
||||||
{
|
{
|
||||||
|
// Lenard Gerdes
|
||||||
private List<Image> _bilder;
|
private List<Image> _bilder;
|
||||||
private Random _random = new Random();
|
private Random _random = new Random();
|
||||||
Database db = new Database();
|
Database db = new Database();
|
||||||
@@ -46,7 +46,7 @@ namespace Casino
|
|||||||
|
|
||||||
private int highestWin = 5;
|
private int highestWin = 5;
|
||||||
|
|
||||||
|
// Lenard Gerdes
|
||||||
public Slots()
|
public Slots()
|
||||||
{
|
{
|
||||||
InitializeComponent();
|
InitializeComponent();
|
||||||
@@ -90,6 +90,7 @@ namespace Casino
|
|||||||
}
|
}
|
||||||
return image;
|
return image;
|
||||||
}
|
}
|
||||||
|
// Lenard Gerdes
|
||||||
private async Task Spin()
|
private async Task Spin()
|
||||||
{
|
{
|
||||||
for (int i = 0; i < 15; i++)
|
for (int i = 0; i < 15; i++)
|
||||||
@@ -120,20 +121,14 @@ namespace Casino
|
|||||||
currentSlot[0, j] = randomBild;
|
currentSlot[0, j] = randomBild;
|
||||||
LoadCard(_bilder[j], randomBild);
|
LoadCard(_bilder[j], randomBild);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
await Task.Delay(150);
|
await Task.Delay(150);
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Lenard Gerdes
|
||||||
private async void Spin(object sender, RoutedEventArgs e)
|
private async void Spin(object sender, RoutedEventArgs e)
|
||||||
{
|
{
|
||||||
|
|
||||||
|
|
||||||
int einsatz = Convert.ToInt32(einsatzFeld.Text);
|
int einsatz = Convert.ToInt32(einsatzFeld.Text);
|
||||||
users[MainWindow.currentUser].Geld -= einsatz;
|
users[MainWindow.currentUser].Geld -= einsatz;
|
||||||
Konto.Text = users[MainWindow.currentUser].Geld.ToString();
|
Konto.Text = users[MainWindow.currentUser].Geld.ToString();
|
||||||
@@ -141,20 +136,10 @@ namespace Casino
|
|||||||
users[MainWindow.currentUser].Geld += CheckWin(currentSlot, einsatz);
|
users[MainWindow.currentUser].Geld += CheckWin(currentSlot, einsatz);
|
||||||
Konto.Text = users[MainWindow.currentUser].Geld.ToString();
|
Konto.Text = users[MainWindow.currentUser].Geld.ToString();
|
||||||
db.UpdateGeld(
|
db.UpdateGeld(
|
||||||
users[MainWindow.currentUser].ID,
|
users[MainWindow.currentUser].ID,
|
||||||
users[MainWindow.currentUser].Geld);
|
users[MainWindow.currentUser].Geld);
|
||||||
|
|
||||||
/* catch (NullReferenceException)
|
|
||||||
{
|
|
||||||
MessageBox.Show(
|
|
||||||
"Bitte ein Betrag eingeben",
|
|
||||||
"Fehlermeldung 101",
|
|
||||||
MessageBoxButton.OK,
|
|
||||||
MessageBoxImage.Information);
|
|
||||||
}*/
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
// Lenard Gerdes
|
||||||
private void Hauptmenue(object sender, RoutedEventArgs e)
|
private void Hauptmenue(object sender, RoutedEventArgs e)
|
||||||
{
|
{
|
||||||
music.Stop();
|
music.Stop();
|
||||||
@@ -162,7 +147,7 @@ namespace Casino
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// Lenard Gerdes
|
||||||
public decimal CheckWin(int[,] board, decimal einsatz)
|
public decimal CheckWin(int[,] board, decimal einsatz)
|
||||||
{
|
{
|
||||||
decimal multiplikator = 0m;
|
decimal multiplikator = 0m;
|
||||||
@@ -267,7 +252,7 @@ namespace Casino
|
|||||||
return einsatz * multiplikator;
|
return einsatz * multiplikator;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Lenard Gerdes
|
||||||
private decimal CheckLine(params int[] werte)
|
private decimal CheckLine(params int[] werte)
|
||||||
{
|
{
|
||||||
decimal gewinn = 0;
|
decimal gewinn = 0;
|
||||||
@@ -315,16 +300,16 @@ namespace Casino
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
//Numberfield
|
//Numberfield Colin Langer
|
||||||
private static readonly Regex _regex = new Regex("^[0-9]"); // Regex to match non-numeric input
|
private static readonly Regex _regex = new Regex("^[0-9]"); // Regex to match non-numeric input
|
||||||
|
|
||||||
//nur nummern
|
//nur nummern Colin Langer
|
||||||
private void TextBox_PreviewTextInput(object sender, TextCompositionEventArgs e)
|
private void TextBox_PreviewTextInput(object sender, TextCompositionEventArgs e)
|
||||||
{
|
{
|
||||||
e.Handled = !_regex.IsMatch(e.Text);
|
e.Handled = !_regex.IsMatch(e.Text);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Keine Spaces
|
// Keine Spaces Colin Langer
|
||||||
private void TextBox_PreviewKeyDown(object sender, KeyEventArgs e)
|
private void TextBox_PreviewKeyDown(object sender, KeyEventArgs e)
|
||||||
{
|
{
|
||||||
if (e.Key == Key.Space)
|
if (e.Key == Key.Space)
|
||||||
@@ -333,7 +318,7 @@ namespace Casino
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
//das man nichts reinkopieren kann außer Zahlen
|
//das man nichts reinkopieren kann außer Zahlen Colin Langer
|
||||||
private void TextBox_Pasting(object sender, DataObjectPastingEventArgs e)
|
private void TextBox_Pasting(object sender, DataObjectPastingEventArgs e)
|
||||||
{
|
{
|
||||||
if (e.DataObject.GetDataPresent(typeof(String)))
|
if (e.DataObject.GetDataPresent(typeof(String)))
|
||||||
@@ -346,6 +331,7 @@ namespace Casino
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Lenard Gerdes
|
||||||
void PlayWinSound()
|
void PlayWinSound()
|
||||||
{
|
{
|
||||||
audio.PlaySound(db.GetSound(highestWin));
|
audio.PlaySound(db.GetSound(highestWin));
|
||||||
|
|||||||
@@ -1,20 +0,0 @@
|
|||||||
using System;
|
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.Linq;
|
|
||||||
using System.Text;
|
|
||||||
using System.Threading.Tasks;
|
|
||||||
|
|
||||||
namespace Casino
|
|
||||||
{
|
|
||||||
public class Spiele
|
|
||||||
{
|
|
||||||
public string Name { get; set; }
|
|
||||||
public int MinBetrag { get; set; }
|
|
||||||
|
|
||||||
public Spiele(string n, int m)
|
|
||||||
{
|
|
||||||
Name = n;
|
|
||||||
MinBetrag = m;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
+1
-1
@@ -7,7 +7,7 @@ using System.Threading.Tasks;
|
|||||||
|
|
||||||
namespace Casino
|
namespace Casino
|
||||||
{
|
{
|
||||||
public class User
|
public class User // Lenard Gerdes
|
||||||
{
|
{
|
||||||
public string ID { get; set; }
|
public string ID { get; set; }
|
||||||
public string Name { get; set; }
|
public string Name { get; set; }
|
||||||
|
|||||||
Reference in New Issue
Block a user