merge10
This commit is contained in:
@@ -1,42 +0,0 @@
|
||||
<Window x:Class="Casino.Blackjack"
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||
xmlns:local="clr-namespace:Casino"
|
||||
mc:Ignorable="d"
|
||||
Title="Blackjack" Height="1080" Width="1800"
|
||||
WindowState="Maximized"
|
||||
>
|
||||
<Grid>
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="100"></ColumnDefinition>
|
||||
<ColumnDefinition Width="280"></ColumnDefinition>
|
||||
<ColumnDefinition Width="20"></ColumnDefinition>
|
||||
<ColumnDefinition Width="280"></ColumnDefinition>
|
||||
<ColumnDefinition Width="20"></ColumnDefinition>
|
||||
<ColumnDefinition Width="280"></ColumnDefinition>
|
||||
<ColumnDefinition Width="20"></ColumnDefinition>
|
||||
<ColumnDefinition Width="280"></ColumnDefinition>
|
||||
<ColumnDefinition Width="20"></ColumnDefinition>
|
||||
<ColumnDefinition Width="280"></ColumnDefinition>
|
||||
<ColumnDefinition Width="20"></ColumnDefinition>
|
||||
<ColumnDefinition Width="280"></ColumnDefinition>
|
||||
<ColumnDefinition Width="100"></ColumnDefinition>
|
||||
</Grid.ColumnDefinitions>
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="70"></RowDefinition>
|
||||
<RowDefinition Height="270"></RowDefinition>
|
||||
<RowDefinition Height="270"></RowDefinition>
|
||||
<RowDefinition Height="270"></RowDefinition>
|
||||
<RowDefinition Height="200"></RowDefinition>
|
||||
</Grid.RowDefinitions>
|
||||
|
||||
|
||||
<Image Grid.Column="5" Grid.Row="1" x:Name="Dealer_Bild_1"/>
|
||||
<Image Grid.Column="7" Grid.Row="1" x:Name="Dealer_Bild_2"/>
|
||||
|
||||
<Button Grid.Row="0" Content="Hauptmenü" HorizontalAlignment="Center" Click="Hauptmenue" Width="100"/>
|
||||
<TextBox HorizontalAlignment="Right" Height="100" Grid.Row="4" TextWrapping="Wrap" Text="Einsatz" VerticalAlignment="Center" Width="192" PreviewTextInput="TextBox_OnPreviewTextInput" PreviewKeyDown="TextBox_OnPreviewKeyDown" DataObject.Pasting="TextBox_Pasting" Grid.Column="5" Grid.ColumnSpan="3" Margin="0,0,194,0"/>
|
||||
</Grid>
|
||||
</Window>
|
||||
@@ -1,96 +0,0 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Text.RegularExpressions;
|
||||
using System.Threading.Tasks;
|
||||
using System.Windows;
|
||||
using System.Windows.Controls;
|
||||
using System.Windows.Data;
|
||||
using System.Windows.Documents;
|
||||
using System.Windows.Input;
|
||||
using System.Windows.Media;
|
||||
using System.Windows.Media.Imaging;
|
||||
using System.Windows.Shapes;
|
||||
|
||||
namespace Casino
|
||||
{
|
||||
/// <summary>
|
||||
/// Interaktionslogik für Blackjack.xaml
|
||||
/// </summary>
|
||||
public partial class Blackjack : Window
|
||||
{
|
||||
public Blackjack()
|
||||
{
|
||||
InitializeComponent();
|
||||
rand();
|
||||
LoadCard(55);
|
||||
}
|
||||
|
||||
private void LoadCard(int Bild)
|
||||
{
|
||||
Database db = new Database();
|
||||
byte[] img = db.GetCardImage(Bild);//2-10
|
||||
|
||||
Dealer_Bild_1.Source = ByteArrayToImage(img);
|
||||
}
|
||||
|
||||
private BitmapImage ByteArrayToImage(byte[] bytes)
|
||||
{
|
||||
BitmapImage image = new BitmapImage();
|
||||
using (MemoryStream ms = new MemoryStream(bytes))
|
||||
{
|
||||
image.BeginInit();
|
||||
image.CacheOption = BitmapCacheOption.OnLoad;
|
||||
image.StreamSource = ms;
|
||||
image.EndInit();
|
||||
}
|
||||
return image;
|
||||
}
|
||||
|
||||
private int rand()
|
||||
{
|
||||
Random ran = new Random();
|
||||
int temp = ran.Next(13, 66);
|
||||
Console.WriteLine(temp);
|
||||
|
||||
return 0;
|
||||
}
|
||||
private void Hauptmenue(object sender, RoutedEventArgs e)
|
||||
{
|
||||
Close();
|
||||
}
|
||||
|
||||
//Numberfeld
|
||||
private static readonly Regex _regex = new Regex("[^0-9]"); // Regex to match non-numeric input
|
||||
|
||||
//nur nummern
|
||||
private void TextBox_OnPreviewTextInput(object sender, TextCompositionEventArgs e)
|
||||
{
|
||||
e.Handled = !_regex.IsMatch(e.Text);
|
||||
}
|
||||
|
||||
// Keine Spaces
|
||||
private void TextBox_OnPreviewKeyDown(object sender, KeyEventArgs e)
|
||||
{
|
||||
if (e.Key == Key.Space)
|
||||
{
|
||||
e.Handled = true;
|
||||
}
|
||||
}
|
||||
|
||||
//das man nichts reinkopieren kann außer Zahlen
|
||||
private void TextBox_Pasting(object sender, DataObjectPastingEventArgs e)
|
||||
{
|
||||
if (e.DataObject.GetDataPresent(typeof(String)))
|
||||
{
|
||||
var text = (String)e.DataObject.GetData((typeof(String)));
|
||||
if (!_regex.IsMatch((string)text))
|
||||
{
|
||||
e.CancelCommand();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -10,7 +10,7 @@
|
||||
Width="1800"
|
||||
WindowState="Maximized"
|
||||
WindowStyle="None"
|
||||
Background="#2C3E50">
|
||||
Background="#195925">
|
||||
|
||||
<Grid>
|
||||
<Grid.ColumnDefinitions>
|
||||
|
||||
@@ -303,7 +303,7 @@ namespace Casino
|
||||
UpdateWinDisplay();
|
||||
SetPhaseUI();
|
||||
|
||||
await Task.Delay(1000);
|
||||
await Task.Delay(100);
|
||||
|
||||
// Nächste Runde mit demselben Einsatz
|
||||
if (currentBet <= CurrentUser.Geld)
|
||||
|
||||
File diff suppressed because one or more lines are too long
@@ -32,8 +32,7 @@
|
||||
<RowDefinition Height="1*"/>
|
||||
|
||||
</Grid.RowDefinitions>
|
||||
<Button Content="Slots" HorizontalAlignment="Center" Grid.Column="2" Grid.Row="2" VerticalAlignment="Center" Width="79" Height="40" Click="Slots_Click" Background="Silver"/>
|
||||
<Button Content="Blackjack" HorizontalAlignment="Center" Grid.Column="3" Grid.Row="2" VerticalAlignment="Center" Height="40" Width="79" Click="Blackjack_Click" Background="Silver"/>
|
||||
<Button Content="Slots" HorizontalAlignment="Center" Grid.Column="3" Grid.Row="2" VerticalAlignment="Center" Width="79" Height="40" Click="Slots_Click" Background="Silver"/>
|
||||
<Button Content="Busfahrer" HorizontalAlignment="Center" Grid.Column="1" Grid.Row="2" VerticalAlignment="Center" Height="40" Width="79" Click="Busfahrer_Click" Background="Silver"/>
|
||||
<TextBlock Name="TxtName" VerticalAlignment="Top" Grid.Column="2" Height="30" Margin="0,10,0,0" Foreground="Gold"/>
|
||||
<TextBlock Name="TxtKonto" VerticalAlignment="Top" Grid.Column="3" Height="30" Margin="0,10,0,0" Foreground="Gold"/>
|
||||
|
||||
@@ -35,12 +35,6 @@ namespace Casino
|
||||
}
|
||||
|
||||
|
||||
private void Blackjack_Click(object sender, RoutedEventArgs e)
|
||||
{
|
||||
Blackjack slotsWindow = new Blackjack();
|
||||
slotsWindow.Show();
|
||||
}
|
||||
|
||||
private void Busfahrer_Click(object sender, RoutedEventArgs e)
|
||||
{
|
||||
Busfahrer slotsWindow = new Busfahrer();
|
||||
|
||||
Reference in New Issue
Block a user