diff --git a/Sources/MauiSpark/Convertisseurs/CouleurVersCouleurMAUI.cs b/Sources/MauiSpark/Convertisseurs/CouleurVersCouleurMAUI.cs
index 3409897..23aa8b3 100644
--- a/Sources/MauiSpark/Convertisseurs/CouleurVersCouleurMAUI.cs
+++ b/Sources/MauiSpark/Convertisseurs/CouleurVersCouleurMAUI.cs
@@ -5,13 +5,12 @@ namespace MauiSpark.Convertisseurs
{
public class CouleurVersCouleurMAUI : IValueConverter
{
- public static Color Rouge { get; private set; } = Color.FromRgb(255, 0, 0);
- public static Color Vert { get; private set; } = Color.FromRgb(0, 255, 0);
- public static Color Bleu { get; private set; } = Color.FromRgb(0, 0, 255);
- public static Color Jaune { get; private set; } = Color.FromRgb(255, 255, 0);
- public static Color Noir { get; private set; } = Color.FromRgb(0, 0, 0);
- public static Color Blanc { get; private set; } = Color.FromRgb(255, 255, 255);
-
+ public static Color Rouge { get; private set; } = Color.FromArgb("#F75353");
+ public static Color Vert { get; private set; } = Color.FromArgb("#53F769");
+ public static Color Bleu { get; private set; } = Color.FromArgb("#535AF3");
+ public static Color Jaune { get; private set; } = Color.FromArgb("#E9FE67");
+ public static Color Noir { get; private set; } = Color.FromArgb("#241E1E");
+ public static Color Blanc { get; private set; } = Color.FromArgb("#FFFFFF");
public object Convert(object? value, Type targetType, object? parameter, CultureInfo culture)
{
diff --git a/Sources/MauiSpark/Convertisseurs/TexteVersTexteMajuscule.cs b/Sources/MauiSpark/Convertisseurs/TexteVersTexteMajuscule.cs
new file mode 100644
index 0000000..142fa0e
--- /dev/null
+++ b/Sources/MauiSpark/Convertisseurs/TexteVersTexteMajuscule.cs
@@ -0,0 +1,20 @@
+using System.Globalization;
+
+namespace MauiSpark.Convertisseurs
+{
+ public class TexteVersTexteMajuscule : IValueConverter
+ {
+ public object Convert(object? value, Type targetType, object? parameter, CultureInfo culture)
+ {
+ if (value is not string)
+ return "";
+
+ return ((string)value).ToUpper();
+ }
+
+ public object ConvertBack(object? value, Type targetType, object? parameter, CultureInfo culture)
+ {
+ throw new NotImplementedException();
+ }
+ }
+}
diff --git a/Sources/MauiSpark/MauiSpark.csproj b/Sources/MauiSpark/MauiSpark.csproj
index 92d1677..debe7ab 100644
--- a/Sources/MauiSpark/MauiSpark.csproj
+++ b/Sources/MauiSpark/MauiSpark.csproj
@@ -76,6 +76,9 @@
PlateauPage.xaml
+
+ ReglesPage.xaml
+
@@ -94,7 +97,7 @@
MSBuild:Compile
-
+
MSBuild:Compile
@@ -109,9 +112,15 @@
MSBuild:Compile
+
+ MSBuild:Compile
+
MSBuild:Compile
+
+ MSBuild:Compile
+
MSBuild:Compile
diff --git a/Sources/MauiSpark/Pages/PlateauPage.xaml.cs b/Sources/MauiSpark/Pages/PlateauPage.xaml.cs
index e1db9c2..396a690 100644
--- a/Sources/MauiSpark/Pages/PlateauPage.xaml.cs
+++ b/Sources/MauiSpark/Pages/PlateauPage.xaml.cs
@@ -37,7 +37,6 @@ internal class Tour
}
}
-
public partial class PlateauPage : ContentPage
{
private Code? code;
@@ -102,6 +101,6 @@ public partial class PlateauPage : ContentPage
private async void QuandReglesClique(object sender, EventArgs e)
{
- await Navigation.PushAsync(new Regle());
+ await Navigation.PushAsync(new ReglesPage());
}
}
\ No newline at end of file
diff --git a/Sources/MauiSpark/Pages/Regle.xaml b/Sources/MauiSpark/Pages/Regle.xaml
deleted file mode 100644
index aa02f3c..0000000
--- a/Sources/MauiSpark/Pages/Regle.xaml
+++ /dev/null
@@ -1,22 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/Sources/MauiSpark/Pages/Regle.xaml.cs b/Sources/MauiSpark/Pages/Regle.xaml.cs
deleted file mode 100644
index 7a3890c..0000000
--- a/Sources/MauiSpark/Pages/Regle.xaml.cs
+++ /dev/null
@@ -1,11 +0,0 @@
-namespace MauiSpark.Pages;
-
-public partial class Regle : ContentPage
-{
- public Regle()
- {
- NavigationPage.SetHasNavigationBar(this, false);
-
- InitializeComponent();
- }
-}
\ No newline at end of file
diff --git a/Sources/MauiSpark/Pages/ReglesPage.xaml b/Sources/MauiSpark/Pages/ReglesPage.xaml
new file mode 100644
index 0000000..01e4c96
--- /dev/null
+++ b/Sources/MauiSpark/Pages/ReglesPage.xaml
@@ -0,0 +1,23 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/Sources/MauiSpark/Pages/ReglesPage.xaml.cs b/Sources/MauiSpark/Pages/ReglesPage.xaml.cs
new file mode 100644
index 0000000..d84a4bf
--- /dev/null
+++ b/Sources/MauiSpark/Pages/ReglesPage.xaml.cs
@@ -0,0 +1,29 @@
+namespace MauiSpark.Pages;
+
+internal class Regles
+{
+ public string Titre { get; init; } = "";
+ public string Description { get; init; } = "";
+}
+
+public partial class ReglesPage : ContentPage
+{
+ private static readonly Regles reglesClassiques = new Regles()
+ {
+ Titre = "Règles classiques",
+ Description = "Le but du jeu est de découvrir la combinaison. On génère aléatoirement deux combinaisons de 4 couleurs (six couleurs au total : jaune, bleu, rouge, vert, blanc et noir), une combinaison pour chaque joueur. Deux joueurs se battent pour trouver la combinaison en premier, il y a douze tours. Le premier joueur à trouver la combinaison à gagner, chaque joueur a le même nombre de coups à réaliser. Donc si le joueur un à trouvé la solution au bout de huit coups, le joueur deux doit finir son huitième coup. Si le joueur deux trouve la combinaison, les deux joueurs sont à égalité. Sinon, le joueur un gagne. Pour trouver la combinaison, les joueurs disposent de quatre indicateurs. Ces indicateurs sont quatre ronds qui représentent les quatre couleurs sélectionnées par le joueur. Un rond noir signifie qu’une couleur est à la bonne place, un rond blanc correspond à une mauvaise place et s'il n’y a pas d’indicateur aucune des couleurs n’est présentent dans la combinaison."
+ };
+
+ public ReglesPage()
+ {
+ NavigationPage.SetHasNavigationBar(this, false);
+
+ BindingContext = (Regles[])[
+ reglesClassiques,
+ reglesClassiques,
+ reglesClassiques
+ ];
+
+ InitializeComponent();
+ }
+}
\ No newline at end of file
diff --git a/Sources/MauiSpark/Pages/TableauScore.xaml b/Sources/MauiSpark/Pages/TableauScore.xaml
index 3b4fef5..0f52200 100644
--- a/Sources/MauiSpark/Pages/TableauScore.xaml
+++ b/Sources/MauiSpark/Pages/TableauScore.xaml
@@ -4,6 +4,7 @@
xmlns:pages="clr-namespace:MauiSpark.Pages"
x:Class="MauiSpark.Pages.TableauScore"
Title="TableauScore">
+
diff --git a/Sources/MauiSpark/Pages/Victoire.xaml b/Sources/MauiSpark/Pages/Victoire.xaml
index e327992..ec526a4 100644
--- a/Sources/MauiSpark/Pages/Victoire.xaml
+++ b/Sources/MauiSpark/Pages/Victoire.xaml
@@ -3,17 +3,33 @@
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
x:Class="MauiSpark.Pages.Victoire"
xmlns:pages="clr-namespace:MauiSpark.Pages"
+ xmlns:vues="clr-namespace:MauiSpark.Vues"
Title="Victoire">
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
-
+
+
+
\ No newline at end of file
diff --git a/Sources/MauiSpark/Pages/Victoire.xaml.cs b/Sources/MauiSpark/Pages/Victoire.xaml.cs
index aac8111..f97d6f5 100644
--- a/Sources/MauiSpark/Pages/Victoire.xaml.cs
+++ b/Sources/MauiSpark/Pages/Victoire.xaml.cs
@@ -34,11 +34,11 @@ public partial class Victoire : ContentPage
IReadOnlyList perdants = e.Perdants;
if (gagnants.Count == 1)
- BindingContext = ("Victoire", $"Le joueur {gagnants[0].Nom} a gagné");
+ BindingContext = ("Victoire", $"Le joueur {gagnants.First().Nom} a gagné", "trophy.jpg");
else if (gagnants.Count > 1)
- BindingContext = ("Egalité", $"Les joueurs {string.Join(' ', gagnants.Select(joueur => joueur.Nom))} ont gagné");
+ BindingContext = ("Egalité", $"Les joueurs {string.Join(' ', gagnants.Select(joueur => joueur.Nom))} ont gagné", "egaliter.jpg");
else
- BindingContext = ("Défaite", "Personne n'a trouvé le code...");
+ BindingContext = ("Défaite", "Personne n'a trouvé le code...", "defaite.png");
}
public async void QuandMenuPresse(object sender, EventArgs e)
diff --git a/Sources/MauiSpark/Vues/BoutonReglesVue.xaml.cs b/Sources/MauiSpark/Vues/BoutonReglesVue.xaml.cs
index b817153..a657680 100644
--- a/Sources/MauiSpark/Vues/BoutonReglesVue.xaml.cs
+++ b/Sources/MauiSpark/Vues/BoutonReglesVue.xaml.cs
@@ -11,6 +11,6 @@ public partial class BoutonReglesVue : ContentView
private void QuandReglesClique(Object? sender, EventArgs e)
{
- Navigation.PushAsync(new Regle());
+ Navigation.PushAsync(new ReglesPage());
}
}
\ No newline at end of file
diff --git a/Sources/MauiSpark/Vues/ImageResultatVue.xaml b/Sources/MauiSpark/Vues/ImageResultatVue.xaml
new file mode 100644
index 0000000..a800d48
--- /dev/null
+++ b/Sources/MauiSpark/Vues/ImageResultatVue.xaml
@@ -0,0 +1,10 @@
+
+
+
+
+
diff --git a/Sources/MauiSpark/Vues/ImageResultatVue.xaml.cs b/Sources/MauiSpark/Vues/ImageResultatVue.xaml.cs
new file mode 100644
index 0000000..02a1853
--- /dev/null
+++ b/Sources/MauiSpark/Vues/ImageResultatVue.xaml.cs
@@ -0,0 +1,18 @@
+namespace MauiSpark.Vues;
+
+public partial class ImageResultatVue : ContentView
+{
+ public static readonly BindableProperty ImageProperty = BindableProperty.Create(nameof(Image), typeof(string), typeof(ImageResultatVue), default(string));
+
+ public string Image
+ {
+ get => (string)GetValue(ImageProperty);
+ set => SetValue(ImageProperty, value);
+ }
+
+ public ImageResultatVue()
+ {
+ InitializeComponent();
+ BindingContext = this;
+ }
+}
\ No newline at end of file
diff --git a/Sources/MauiSpark/Vues/ReglesVue.xaml b/Sources/MauiSpark/Vues/ReglesVue.xaml
new file mode 100644
index 0000000..f4d64cb
--- /dev/null
+++ b/Sources/MauiSpark/Vues/ReglesVue.xaml
@@ -0,0 +1,17 @@
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/Sources/MauiSpark/Vues/ReglesVue.xaml.cs b/Sources/MauiSpark/Vues/ReglesVue.xaml.cs
new file mode 100644
index 0000000..4a903f1
--- /dev/null
+++ b/Sources/MauiSpark/Vues/ReglesVue.xaml.cs
@@ -0,0 +1,26 @@
+namespace MauiSpark.Vues;
+
+public partial class ReglesVue : ContentView
+{
+ public static readonly BindableProperty TitreProperty = BindableProperty.Create(nameof(Titre), typeof(string), typeof(ReglesVue), default(string));
+ public static readonly BindableProperty DescriptionProperty = BindableProperty.Create(nameof(Description), typeof(string), typeof(ReglesVue), default(string));
+
+ public string Titre
+ {
+ get => (string)GetValue(TitreProperty);
+ set => SetValue(TitreProperty, value);
+ }
+
+ public string Description
+ {
+ get => (string)GetValue(DescriptionProperty);
+ set => SetValue(DescriptionProperty, value);
+ }
+
+ public ReglesVue()
+ {
+ InitializeComponent();
+
+ BindingContext = this;
+ }
+}
\ No newline at end of file
diff --git a/Sources/MauiSpark/Vues/TitreVue.xaml b/Sources/MauiSpark/Vues/TitreVue.xaml
index ab15fae..f130a7a 100644
--- a/Sources/MauiSpark/Vues/TitreVue.xaml
+++ b/Sources/MauiSpark/Vues/TitreVue.xaml
@@ -2,12 +2,20 @@
-
+
+
+
+
+
+
+
+
diff --git a/Sources/MauiSpark/Vues/TitreVue.xaml.cs b/Sources/MauiSpark/Vues/TitreVue.xaml.cs
index 5d43d66..3185bb6 100644
--- a/Sources/MauiSpark/Vues/TitreVue.xaml.cs
+++ b/Sources/MauiSpark/Vues/TitreVue.xaml.cs
@@ -4,11 +4,10 @@ public partial class TitreVue : ContentView
{
public static readonly BindableProperty TexteProperty = BindableProperty.Create(nameof(Texte), typeof(string), typeof(TitreVue), default(string));
-
public string Texte
{
get => (string)GetValue(TexteProperty);
- set => SetValue(TexteProperty, value.ToUpper());
+ set => SetValue(TexteProperty, value);
}
public TitreVue()