Merge branch 'main' of https://git.bib.de/PBG2H25AGE/GAMBLING-WIR-MACHEN-ALLE-ARM
This commit is contained in:
@@ -1,7 +1,7 @@
|
|||||||
<Project Sdk="Microsoft.NET.Sdk">
|
<Project Sdk="Microsoft.NET.Sdk">
|
||||||
|
|
||||||
<PropertyGroup>
|
<PropertyGroup>
|
||||||
<OutputType>WinExe</OutputType>
|
<OutputType>Exe</OutputType>
|
||||||
<TargetFramework>net8.0-windows</TargetFramework>
|
<TargetFramework>net8.0-windows</TargetFramework>
|
||||||
<Nullable>enable</Nullable>
|
<Nullable>enable</Nullable>
|
||||||
<ImplicitUsings>enable</ImplicitUsings>
|
<ImplicitUsings>enable</ImplicitUsings>
|
||||||
|
|||||||
+2
-1
@@ -12,7 +12,7 @@ namespace Casino
|
|||||||
internal class Database
|
internal class Database
|
||||||
{
|
{
|
||||||
private string myConnectionString = "server=mysql.pb.bib.de;uid=pbg2h25ala;pwd=a7TP2aRv7Xdu;database=pbg2h25ala_Casino";
|
private string myConnectionString = "server=mysql.pb.bib.de;uid=pbg2h25ala;pwd=a7TP2aRv7Xdu;database=pbg2h25ala_Casino";
|
||||||
public ObservableCollection<User> SelectTask()
|
public ObservableCollection<User> GetUser()
|
||||||
{
|
{
|
||||||
ObservableCollection<User> user = new ObservableCollection<User>();
|
ObservableCollection<User> user = new ObservableCollection<User>();
|
||||||
|
|
||||||
@@ -104,5 +104,6 @@ namespace Casino
|
|||||||
|
|
||||||
return soundBytes;
|
return soundBytes;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -50,12 +50,13 @@ namespace Casino
|
|||||||
{
|
{
|
||||||
Database db = new Database();
|
Database db = new Database();
|
||||||
ObservableCollection<User> users = new ObservableCollection<User>();
|
ObservableCollection<User> users = new ObservableCollection<User>();
|
||||||
users = db.SelectTask();
|
users = db.GetUser();
|
||||||
for (int i = 0; i < users.Count(); i++)
|
for (int i = 0; i < users.Count(); i++)
|
||||||
{
|
{
|
||||||
if (name.Equals(users[i].Name))
|
if (name.Equals(users[i].Name))
|
||||||
{
|
{
|
||||||
if(passwort.Equals(users[i].Passwort)) {
|
if(passwort.Equals(users[i].Passwort)) {
|
||||||
|
MainWindow.currentUser = i;
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
|
|||||||
@@ -16,6 +16,7 @@ namespace Casino
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
public partial class MainWindow : Window
|
public partial class MainWindow : Window
|
||||||
{
|
{
|
||||||
|
public static int currentUser;
|
||||||
public MainWindow()
|
public MainWindow()
|
||||||
{
|
{
|
||||||
InitializeComponent();
|
InitializeComponent();
|
||||||
|
|||||||
+4
-2
@@ -5,7 +5,7 @@
|
|||||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||||
xmlns:local="clr-namespace:Casino"
|
xmlns:local="clr-namespace:Casino"
|
||||||
mc:Ignorable="d"
|
mc:Ignorable="d"
|
||||||
Title="Slots" Height="1080" Width="1920"
|
Title="Slots" Height="1080" Width="1800"
|
||||||
WindowState="Maximized"
|
WindowState="Maximized"
|
||||||
WindowStyle="None"
|
WindowStyle="None"
|
||||||
Background="Transparent">
|
Background="Transparent">
|
||||||
@@ -60,7 +60,9 @@
|
|||||||
<Image Grid.Column="9" Grid.Row="3" x:Name="Bild_35"/>
|
<Image Grid.Column="9" Grid.Row="3" x:Name="Bild_35"/>
|
||||||
<Image Grid.Column="11" Grid.Row="3" x:Name="Bild_36"/>
|
<Image Grid.Column="11" Grid.Row="3" x:Name="Bild_36"/>
|
||||||
|
|
||||||
<Button Content="Spin" HorizontalAlignment="Center" Grid.Row="4" Grid.Column="1" Height="40" Width="79" Click="Spin"/>
|
<Button Content="Spin" HorizontalAlignment="Center" Grid.Row="4" Grid.Column="0" Height="50" Width="100" Click="Spin" Margin="0,100,0,0" Background="DarkRed" Foreground="Silver"/>
|
||||||
|
<Button Grid.Row="0" Content="Hauptmenü" HorizontalAlignment="Center" Click="Hauptmenue" Width="100" Height="50"/>
|
||||||
|
<TextBlock x:Name="Konto" Grid.Column="12" Grid.Row="4" Height="30" Width="100" Margin="0,100,0,0" Background="DarkRed" Foreground="Silver" TextAlignment="Right" FontSize="25"/>
|
||||||
|
|
||||||
|
|
||||||
</Grid>
|
</Grid>
|
||||||
|
|||||||
+12
-1
@@ -1,5 +1,6 @@
|
|||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
|
using System.Collections.ObjectModel;
|
||||||
using System.IO;
|
using System.IO;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using System.Text;
|
using System.Text;
|
||||||
@@ -25,12 +26,13 @@ namespace Casino
|
|||||||
private Random _random = new Random();
|
private Random _random = new Random();
|
||||||
Database db = new Database();
|
Database db = new Database();
|
||||||
private List<Byte[]> AlleBilder;
|
private List<Byte[]> AlleBilder;
|
||||||
|
ObservableCollection<User> users = new ObservableCollection<User>();
|
||||||
|
|
||||||
public Slots()
|
public Slots()
|
||||||
{
|
{
|
||||||
InitializeComponent();
|
InitializeComponent();
|
||||||
|
|
||||||
|
users = db.GetUser();
|
||||||
|
|
||||||
_bilder = new List<Image>
|
_bilder = new List<Image>
|
||||||
{
|
{
|
||||||
@@ -45,6 +47,8 @@ namespace Casino
|
|||||||
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();
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -68,6 +72,7 @@ namespace Casino
|
|||||||
}
|
}
|
||||||
private async Task Spin()
|
private async Task Spin()
|
||||||
{
|
{
|
||||||
|
users[MainWindow.currentUser].Geld += 100;
|
||||||
for (int i = 0; i < 50; i++)
|
for (int i = 0; i < 50; i++)
|
||||||
{
|
{
|
||||||
foreach (var image in _bilder)
|
foreach (var image in _bilder)
|
||||||
@@ -85,5 +90,11 @@ namespace Casino
|
|||||||
{
|
{
|
||||||
await Spin();
|
await Spin();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void Hauptmenue(object sender, RoutedEventArgs e)
|
||||||
|
{
|
||||||
|
Close();
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user