diff --git a/Qwirkle/QwirkleConsoleApp/Program.cs b/Qwirkle/QwirkleConsoleApp/Program.cs
index 494b9eb..e98a73b 100644
--- a/Qwirkle/QwirkleConsoleApp/Program.cs
+++ b/Qwirkle/QwirkleConsoleApp/Program.cs
@@ -227,7 +227,7 @@ static void ShowBoard(Game game)
for (int y = 0; y < board.Columns; y++)
{
Cell? cell = board.GetCell(y, i);
- if (cell != null && cell.IsFree == false)
+ if (cell != null && !cell.IsFree)
{
Tile? tile = cell.GetTile;
if (tile != null)
diff --git a/Qwirkle/QwirkleViews/App.xaml.cs b/Qwirkle/QwirkleViews/App.xaml.cs
index c9acbda..da15420 100644
--- a/Qwirkle/QwirkleViews/App.xaml.cs
+++ b/Qwirkle/QwirkleViews/App.xaml.cs
@@ -1,4 +1,8 @@
-namespace Qwirkle
+using Qwirkle.Views;
+using Microsoft.Maui.Controls;
+using Qwirkle.Pages;
+
+namespace Qwirkle
{
public partial class App : Application
{
@@ -7,6 +11,8 @@
InitializeComponent();
MainPage = new AppShell();
+
+ Routing.RegisterRoute(nameof(SetPlayers), typeof(SetPlayers));
}
}
}
diff --git a/Qwirkle/QwirkleViews/MainPage.xaml b/Qwirkle/QwirkleViews/MainPage.xaml
index 75e9e6c..c2ca4fa 100644
--- a/Qwirkle/QwirkleViews/MainPage.xaml
+++ b/Qwirkle/QwirkleViews/MainPage.xaml
@@ -20,23 +20,25 @@
Aspect="AspectFit"
/>
-
-
+
+
+
-
+
-
+
-
-
-
-
-
+
+
+
-
+
diff --git a/Qwirkle/QwirkleViews/MainPage.xaml.cs b/Qwirkle/QwirkleViews/MainPage.xaml.cs
index 81e1b9a..e73c4f4 100644
--- a/Qwirkle/QwirkleViews/MainPage.xaml.cs
+++ b/Qwirkle/QwirkleViews/MainPage.xaml.cs
@@ -1,25 +1,68 @@
-namespace Qwirkle
+using Qwirkle.Views;
+using QwirkleClassLibrary;
+using QwirkleClassLibrary.Games;
+using Microsoft.Maui.Controls;
+using Qwirkle.Pages;
+
+namespace Qwirkle
{
public partial class MainPage : ContentPage
{
- int count = 0;
public MainPage()
{
InitializeComponent();
+ BindingContext = this;
}
- /*private void OnCounterClicked(object sender, EventArgs e)
+
+ 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)
{
- count++;
+ Game game = new Game();
+ DisplayAlert("Game notification", "Enter minimun 2 player and max 4 player !", "Ok ! Lets's go !");
+
+ Navigation.PushAsync(new SetPlayers());
+ }
+
+
- if (count == 1)
- CounterBtn.Text = $"Clicked {count} time";
- else
- CounterBtn.Text = $"Clicked {count} times";
- SemanticScreenReader.Announce(CounterBtn.Text);
- }*/
}
}
diff --git a/Qwirkle/QwirkleViews/MauiProgram.cs b/Qwirkle/QwirkleViews/MauiProgram.cs
index 1c04a59..cdd1ba8 100644
--- a/Qwirkle/QwirkleViews/MauiProgram.cs
+++ b/Qwirkle/QwirkleViews/MauiProgram.cs
@@ -11,8 +11,6 @@ namespace Qwirkle
.UseMauiApp()
.ConfigureFonts(fonts =>
{
- //fonts.AddFont("OpenSans-Regular.ttf", "OpenSansRegular");
- //fonts.AddFont("OpenSans-Semibold.ttf", "OpenSansSemibold");
fonts.AddFont("DiloWorld.ttf", "DiloWorld");
fonts.AddFont("Lexend-Medium.ttf", "Lexend-Meduim");
});
diff --git a/Qwirkle/QwirkleViews/Pages/SetPlayers.xaml b/Qwirkle/QwirkleViews/Pages/SetPlayers.xaml
index 3476daf..3c0714e 100644
--- a/Qwirkle/QwirkleViews/Pages/SetPlayers.xaml
+++ b/Qwirkle/QwirkleViews/Pages/SetPlayers.xaml
@@ -11,17 +11,22 @@
Text="SetPlayers"
Style="{StaticResource Title}"/>
-
+
+
+
-
+
-
-
-
+
+ Style="{StaticResource ConfirmButton}"
+ Clicked="OnButtonContinueClick"/>
diff --git a/Qwirkle/QwirkleViews/Pages/SetPlayers.xaml.cs b/Qwirkle/QwirkleViews/Pages/SetPlayers.xaml.cs
index 34b1173..ebee93b 100644
--- a/Qwirkle/QwirkleViews/Pages/SetPlayers.xaml.cs
+++ b/Qwirkle/QwirkleViews/Pages/SetPlayers.xaml.cs
@@ -1,3 +1,6 @@
+using Qwirkle.Views;
+using QwirkleClassLibrary.Games;
+
namespace Qwirkle.Pages;
public partial class SetPlayers : ContentPage
@@ -5,5 +8,39 @@ public partial class SetPlayers : ContentPage
public SetPlayers()
{
InitializeComponent();
- }
+ BindingContext = this;
+ }
+
+ public EntryPlayer Entry1 { get; set; }
+ = new EntryPlayer
+ {
+ TextOn = "Player 1",
+ TextIn = "Entry tag of player 1"
+ };
+ public EntryPlayer Entry2 { get; set; }
+ = new EntryPlayer
+ {
+ TextOn = "Player 2",
+ TextIn = "Entry tag of player 2"
+ };
+
+ public EntryPlayer Entry3 { get; set; }
+ = new EntryPlayer
+ {
+ TextOn = "Player 3",
+ TextIn = "Entry tag of player 3"
+ };
+
+ public EntryPlayer Entry4 { get; set; }
+ = new EntryPlayer
+ {
+ TextOn = "Player 4",
+ TextIn = "Entry tag of player 4"
+ };
+
+ void OnButtonContinueClick(object sender, EventArgs e)
+ {
+ string entry1 = Entry1.TextIn;
+ DisplayAlert("Game notification", entry1, "Ok ! Lets's go !");
+ }
}
\ No newline at end of file
diff --git a/Qwirkle/QwirkleViews/QwirkleViews.csproj b/Qwirkle/QwirkleViews/QwirkleViews.csproj
index 713a5bf..d77e2e5 100644
--- a/Qwirkle/QwirkleViews/QwirkleViews.csproj
+++ b/Qwirkle/QwirkleViews/QwirkleViews.csproj
@@ -69,6 +69,10 @@
+
+
+
+
Leaderboard.xaml
diff --git a/Qwirkle/QwirkleViews/Views/ButtonShadow.xaml b/Qwirkle/QwirkleViews/Views/ButtonShadow.xaml
index 4b8b6a6..613d959 100644
--- a/Qwirkle/QwirkleViews/Views/ButtonShadow.xaml
+++ b/Qwirkle/QwirkleViews/Views/ButtonShadow.xaml
@@ -1,13 +1,17 @@
+ x:Class="Qwirkle.Views.ButtonShadow"
+ x:Name="root">
+
-
-
-
-
+
+
+
+
+
diff --git a/Qwirkle/QwirkleViews/Views/ButtonShadow.xaml.cs b/Qwirkle/QwirkleViews/Views/ButtonShadow.xaml.cs
index 8ade52d..095ae3f 100644
--- a/Qwirkle/QwirkleViews/Views/ButtonShadow.xaml.cs
+++ b/Qwirkle/QwirkleViews/Views/ButtonShadow.xaml.cs
@@ -1,3 +1,5 @@
+using Microsoft.Maui;
+
namespace Qwirkle.Views;
public partial class ButtonShadow : ContentView
@@ -6,4 +8,20 @@ public partial class ButtonShadow : ContentView
{
InitializeComponent();
}
+
+ public static readonly BindableProperty TextProperty =
+ BindableProperty.Create("Text", typeof(string), typeof(Button), "none");
+
+ public string Text
+ {
+ get => (string)GetValue(TextProperty);
+ set => SetValue(TextProperty, value);
+ }
+
+ public event EventHandler InfoClicked;
+
+ void OnInfoClicked(object sender, EventArgs args)
+ {
+ InfoClicked?.Invoke(this, args);
+ }
}
\ No newline at end of file
diff --git a/Qwirkle/QwirkleViews/Views/EntryPlayer.xaml b/Qwirkle/QwirkleViews/Views/EntryPlayer.xaml
index 8b10102..4795bc7 100644
--- a/Qwirkle/QwirkleViews/Views/EntryPlayer.xaml
+++ b/Qwirkle/QwirkleViews/Views/EntryPlayer.xaml
@@ -1,12 +1,13 @@
+ x:Class="Qwirkle.Views.EntryPlayer"
+ x:Name="root">
-
+
diff --git a/Qwirkle/QwirkleViews/Views/EntryPlayer.xaml.cs b/Qwirkle/QwirkleViews/Views/EntryPlayer.xaml.cs
index d8f241a..1926f84 100644
--- a/Qwirkle/QwirkleViews/Views/EntryPlayer.xaml.cs
+++ b/Qwirkle/QwirkleViews/Views/EntryPlayer.xaml.cs
@@ -1,9 +1,27 @@
namespace Qwirkle.Views;
-
+using Microsoft.Maui.Controls;
public partial class EntryPlayer : ContentView
{
- public EntryPlayer()
- {
- InitializeComponent();
- }
+ public EntryPlayer()
+ {
+ InitializeComponent();
+ }
+
+ public static readonly BindableProperty TextInProperty =
+ BindableProperty.Create("TextIn", typeof(string), typeof(Button), "none");
+
+ public string TextIn
+ {
+ get => (string)GetValue(TextInProperty);
+ set => SetValue(TextInProperty, value);
+ }
+
+ public static readonly BindableProperty TextOnProperty =
+ BindableProperty.Create("TextOn", typeof(string), typeof(Button), "none");
+
+ public string TextOn
+ {
+ get => (string)GetValue(TextOnProperty);
+ set => SetValue(TextOnProperty, value);
+ }
}
\ No newline at end of file