From 8d0a6f58141bfd69344d42f9182f56b6ad726f62 Mon Sep 17 00:00:00 2001 From: "jeremy.mouyon" Date: Wed, 22 May 2024 19:31:36 +0200 Subject: [PATCH] JUST SWITTCH ADD PLAYER TO LIST OF STRING AND CHECK COUNT AND JUST VERIFY ! GOOD NIGHT --- Qwirkle/QwirkleViews/App.xaml.cs | 4 ++ Qwirkle/QwirkleViews/MainPage.xaml | 10 ++--- Qwirkle/QwirkleViews/MainPage.xaml.cs | 40 +------------------ Qwirkle/QwirkleViews/MauiProgram.cs | 2 + Qwirkle/QwirkleViews/Pages/SetPlayers.xaml | 14 +++---- Qwirkle/QwirkleViews/Pages/SetPlayers.xaml.cs | 33 +++++++++++---- .../QwirkleViews/Resources/Styles/Styles.xaml | 2 +- Qwirkle/QwirkleViews/Views/EntryPlayer.xaml | 4 +- .../QwirkleViews/Views/EntryPlayer.xaml.cs | 28 ++++++------- 9 files changed, 60 insertions(+), 77 deletions(-) diff --git a/Qwirkle/QwirkleViews/App.xaml.cs b/Qwirkle/QwirkleViews/App.xaml.cs index da15420..5d6fc10 100644 --- a/Qwirkle/QwirkleViews/App.xaml.cs +++ b/Qwirkle/QwirkleViews/App.xaml.cs @@ -1,6 +1,7 @@ using Qwirkle.Views; using Microsoft.Maui.Controls; using Qwirkle.Pages; +using QwirkleClassLibrary.Games; namespace Qwirkle { @@ -13,6 +14,9 @@ namespace Qwirkle MainPage = new AppShell(); Routing.RegisterRoute(nameof(SetPlayers), typeof(SetPlayers)); + } + + public Game Game { get; set; } = new(); } } diff --git a/Qwirkle/QwirkleViews/MainPage.xaml b/Qwirkle/QwirkleViews/MainPage.xaml index c2ca4fa..364a29c 100644 --- a/Qwirkle/QwirkleViews/MainPage.xaml +++ b/Qwirkle/QwirkleViews/MainPage.xaml @@ -22,19 +22,19 @@ - + - + - + - + diff --git a/Qwirkle/QwirkleViews/MainPage.xaml.cs b/Qwirkle/QwirkleViews/MainPage.xaml.cs index e73c4f4..ddbaa35 100644 --- a/Qwirkle/QwirkleViews/MainPage.xaml.cs +++ b/Qwirkle/QwirkleViews/MainPage.xaml.cs @@ -15,46 +15,8 @@ namespace Qwirkle BindingContext = this; } - - public ButtonShadow Button1 { get; set; } - = new ButtonShadow - { - Text = "Play" - }; - - public ButtonShadow Button2 { get; set; } - = new ButtonShadow - { - Text = "Continue" - }; - - public ButtonShadow Button3 { get; set; } - = new ButtonShadow - { - Text = "Leaderboard" - }; - - public ButtonShadow Button4 { get; set; } - = new ButtonShadow - { - Text = "Rules" - }; - - public ButtonShadow Button5 { get; set; } - = new ButtonShadow - { - Text = "Settings" - }; - - public ButtonShadow Button6 { get; set; } - = new ButtonShadow - { - Text = "Credits" - }; - - void OnInfoClicked(object sender, EventArgs e) + public void OnInfoClicked(object sender, EventArgs e) { - Game game = new Game(); DisplayAlert("Game notification", "Enter minimun 2 player and max 4 player !", "Ok ! Lets's go !"); Navigation.PushAsync(new SetPlayers()); diff --git a/Qwirkle/QwirkleViews/MauiProgram.cs b/Qwirkle/QwirkleViews/MauiProgram.cs index cdd1ba8..36d59df 100644 --- a/Qwirkle/QwirkleViews/MauiProgram.cs +++ b/Qwirkle/QwirkleViews/MauiProgram.cs @@ -6,6 +6,7 @@ namespace Qwirkle { public static MauiApp CreateMauiApp() { + var builder = MauiApp.CreateBuilder(); builder .UseMauiApp() @@ -19,6 +20,7 @@ namespace Qwirkle builder.Logging.AddDebug(); #endif + return builder.Build(); } } diff --git a/Qwirkle/QwirkleViews/Pages/SetPlayers.xaml b/Qwirkle/QwirkleViews/Pages/SetPlayers.xaml index 3c0714e..a3f4ae9 100644 --- a/Qwirkle/QwirkleViews/Pages/SetPlayers.xaml +++ b/Qwirkle/QwirkleViews/Pages/SetPlayers.xaml @@ -11,17 +11,13 @@ Text="SetPlayers" Style="{StaticResource Title}"/> - - - + - + - + + +