diff --git a/Sources/ConsoleApp1/ConsoleApp1.csproj b/Sources/ConsoleApp1/ConsoleApp1.csproj
new file mode 100644
index 0000000..2150e37
--- /dev/null
+++ b/Sources/ConsoleApp1/ConsoleApp1.csproj
@@ -0,0 +1,10 @@
+
+
+
+ Exe
+ net8.0
+ enable
+ enable
+
+
+
diff --git a/Sources/ConsoleApp1/Program.cs b/Sources/ConsoleApp1/Program.cs
new file mode 100644
index 0000000..460e52d
--- /dev/null
+++ b/Sources/ConsoleApp1/Program.cs
@@ -0,0 +1,25 @@
+using System;
+using System.IO;
+
+class Program
+{
+ static void Main()
+ {
+ // Récupérer le chemin du dossier AppData de l'utilisateur
+ string appDataPath = Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData);
+
+ // Définir le chemin du dossier "mastermind" dans AppData
+ string mastermindPath = Path.Combine(appDataPath, "Mastermind");
+
+ // Vérifier si le dossier existe, et s'il n'existe pas, le créer
+ if (!Directory.Exists(mastermindPath))
+ {
+ Directory.CreateDirectory(mastermindPath);
+ Console.WriteLine("Le dossier 'mastermind' a été créé dans AppData.");
+ }
+ else
+ {
+ Console.WriteLine("Le dossier 'mastermind' existe déjà dans AppData.");
+ }
+ }
+}
diff --git a/Sources/CoreLibrary/Partie.cs b/Sources/CoreLibrary/Partie.cs
index 5e648b1..5cc4a2a 100644
--- a/Sources/CoreLibrary/Partie.cs
+++ b/Sources/CoreLibrary/Partie.cs
@@ -11,9 +11,10 @@ namespace CoreLibrary
/// Représente une partie de jeu.
///
[DataContract]
+ [KnownType(typeof(ReglesClassiques))]
public class Partie : IEstPersistant
{
-
+ [DataMember]
public IRegles Regles { get; private set; }
[DataMember]
diff --git a/Sources/CoreLibrary/Persistance/PersistanceJSON.cs b/Sources/CoreLibrary/Persistance/PersistanceJSON.cs
index 7d8ea93..f41a8c3 100644
--- a/Sources/CoreLibrary/Persistance/PersistanceJSON.cs
+++ b/Sources/CoreLibrary/Persistance/PersistanceJSON.cs
@@ -9,18 +9,14 @@ namespace CoreLibrary.Persistance
public T[] Charger() where T : IEstPersistant
{
- string dossierAvant = Directory.GetCurrentDirectory();
+ string fichier = $"{typeof(T).Name.ToLower()}s.json";
- string dossier = Path.Combine(dossierAvant, "../../../..");
- string fichier = $"{typeof(T).Name}.json";
+ Directory.SetCurrentDirectory(Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "../../../../../../.."));
-
- bool c = Directory.Exists(dossier);
-
- if (!c)
+ if (!Directory.Exists("Fichiers"))
return [];
- Directory.SetCurrentDirectory(dossier);
+ Directory.SetCurrentDirectory(Path.Combine(Directory.GetCurrentDirectory(), "Fichiers"));
if (!File.Exists(fichier))
return [];
@@ -38,13 +34,14 @@ namespace CoreLibrary.Persistance
public void Enregistrer(T[] elements) where T : IEstPersistant
{
- string dossier = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData), "Mastermind");
- string fichier = $"{typeof(T).Name}.json";
+ string fichier = $"{typeof(T).Name.ToLower()}s.json";
+
+ Directory.SetCurrentDirectory(Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "../../../../../../.."));
- if (!Directory.Exists(dossier))
- Directory.CreateDirectory(dossier);
+ if (!Directory.Exists("Fichiers"))
+ Directory.CreateDirectory("Fichiers");
- Directory.SetCurrentDirectory(dossier);
+ Directory.SetCurrentDirectory(Path.Combine(Directory.GetCurrentDirectory(), "Fichiers"));
DataContractJsonSerializer jsonSerializer = new DataContractJsonSerializer(typeof(T[]));
diff --git a/Sources/CoreLibrary/Regles/IRegles.cs b/Sources/CoreLibrary/Regles/IRegles.cs
index 54776bf..aea134c 100644
--- a/Sources/CoreLibrary/Regles/IRegles.cs
+++ b/Sources/CoreLibrary/Regles/IRegles.cs
@@ -1,4 +1,6 @@

+using System.Runtime.Serialization;
+
namespace CoreLibrary.Regles
{
///
diff --git a/Sources/CoreLibrary/Regles/ReglesClassiques.cs b/Sources/CoreLibrary/Regles/ReglesClassiques.cs
index 8da48f6..ca65851 100644
--- a/Sources/CoreLibrary/Regles/ReglesClassiques.cs
+++ b/Sources/CoreLibrary/Regles/ReglesClassiques.cs
@@ -18,7 +18,7 @@ namespace CoreLibrary.Regles
/// Le nombre maximum de tour.
///
[DataMember]
- public int TourMaximum { get => 2; }
+ public int TourMaximum { get => 12; }
///
/// La taille maximale d'un code.
diff --git a/Sources/MauiSpark/App.xaml.cs b/Sources/MauiSpark/App.xaml.cs
index f0e41c0..d4ef4dc 100644
--- a/Sources/MauiSpark/App.xaml.cs
+++ b/Sources/MauiSpark/App.xaml.cs
@@ -1,6 +1,4 @@
-using CoreLibrary.Manager;
-using CoreLibrary.Persistance;
-using MauiSpark.Pages;
+using MauiSpark.Pages;
namespace MauiSpark
{
@@ -10,7 +8,7 @@ namespace MauiSpark
{
InitializeComponent();
- MainPage = new NavigationPage(new Accueil());
+ MainPage = new NavigationPage(new AccueilPage());
MainPage.Title = "Mastermind";
}
}
diff --git a/Sources/MauiSpark/MauiSpark.csproj b/Sources/MauiSpark/MauiSpark.csproj
index 62af975..2047be7 100644
--- a/Sources/MauiSpark/MauiSpark.csproj
+++ b/Sources/MauiSpark/MauiSpark.csproj
@@ -67,7 +67,19 @@
-
+
+ AccueilPage.xaml
+
+
+ ModePage.xaml
+
+
+ PlateauPage.xaml
+
+
+
+
+
MSBuild:Compile
@@ -76,10 +88,10 @@
MSBuild:Compile
-
+
MSBuild:Compile
-
+
MSBuild:Compile
@@ -94,6 +106,18 @@
MSBuild:Compile
+
+ MSBuild:Compile
+
+
+ MSBuild:Compile
+
+
+ MSBuild:Compile
+
+
+ MSBuild:Compile
+
diff --git a/Sources/MauiSpark/Pages/Accueil.xaml b/Sources/MauiSpark/Pages/Accueil.xaml
deleted file mode 100644
index e8b196a..0000000
--- a/Sources/MauiSpark/Pages/Accueil.xaml
+++ /dev/null
@@ -1,45 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/Sources/MauiSpark/Pages/Accueil.xaml.cs b/Sources/MauiSpark/Pages/Accueil.xaml.cs
deleted file mode 100644
index 720717a..0000000
--- a/Sources/MauiSpark/Pages/Accueil.xaml.cs
+++ /dev/null
@@ -1,27 +0,0 @@
-namespace MauiSpark.Pages;
-
-public partial class Accueil : ContentPage
-{
- public Accueil()
- {
- NavigationPage.SetHasBackButton(this, false);
- NavigationPage.SetHasNavigationBar(this, false);
-
- InitializeComponent();
- }
-
- private void QuandJouerClique(Object? sender, EventArgs e)
- {
- Navigation.PushAsync(new Mode());
- }
-
- private void QuandReglesClique (Object? sender, EventArgs e)
- {
- Navigation.PushAsync(new Regle());
- }
-
- private void QuandTableauClique(Object? sender, EventArgs e)
- {
- Navigation.PushAsync(new TableauScore());
- }
-}
\ No newline at end of file
diff --git a/Sources/MauiSpark/Pages/AccueilPage.xaml b/Sources/MauiSpark/Pages/AccueilPage.xaml
new file mode 100644
index 0000000..186c3cd
--- /dev/null
+++ b/Sources/MauiSpark/Pages/AccueilPage.xaml
@@ -0,0 +1,30 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/Sources/MauiSpark/Pages/AccueilPage.xaml.cs b/Sources/MauiSpark/Pages/AccueilPage.xaml.cs
new file mode 100644
index 0000000..499f4ef
--- /dev/null
+++ b/Sources/MauiSpark/Pages/AccueilPage.xaml.cs
@@ -0,0 +1,17 @@
+namespace MauiSpark.Pages;
+
+public partial class AccueilPage : ContentPage
+{
+ public AccueilPage()
+ {
+ NavigationPage.SetHasBackButton(this, false);
+ NavigationPage.SetHasNavigationBar(this, false);
+
+ InitializeComponent();
+ }
+
+ private void QuandJouerClique(Object? sender, EventArgs e)
+ {
+ Navigation.PushAsync(new ModePage());
+ }
+}
\ No newline at end of file
diff --git a/Sources/MauiSpark/Pages/ConnexionPage.xaml b/Sources/MauiSpark/Pages/ConnexionPage.xaml
index c19cbb7..bdcb7b2 100644
--- a/Sources/MauiSpark/Pages/ConnexionPage.xaml
+++ b/Sources/MauiSpark/Pages/ConnexionPage.xaml
@@ -3,17 +3,15 @@
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
xmlns:Views="clr-namespace:MauiSpark.Views"
x:Class="MauiSpark.Pages.ConnexionPage"
+ xmlns:vues="clr-namespace:MauiSpark.Vues"
Title="Connexion">
+
+ ColumnDefinitions="*"
+ RowDefinitions="auto, *, *">
-
+
+
-
-
-
-
-
-
\ No newline at end of file
diff --git a/Sources/MauiSpark/Pages/ModePage.xaml b/Sources/MauiSpark/Pages/ModePage.xaml
new file mode 100644
index 0000000..7b0f44f
--- /dev/null
+++ b/Sources/MauiSpark/Pages/ModePage.xaml
@@ -0,0 +1,20 @@
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/Sources/MauiSpark/Pages/Mode.xaml.cs b/Sources/MauiSpark/Pages/ModePage.xaml.cs
similarity index 53%
rename from Sources/MauiSpark/Pages/Mode.xaml.cs
rename to Sources/MauiSpark/Pages/ModePage.xaml.cs
index f54dfea..8d86eb7 100644
--- a/Sources/MauiSpark/Pages/Mode.xaml.cs
+++ b/Sources/MauiSpark/Pages/ModePage.xaml.cs
@@ -1,28 +1,32 @@
-using CoreLibrary;
-using CoreLibrary.Events;
-using CoreLibrary.Regles;
-
-namespace MauiSpark.Pages;
-
-public partial class Mode : ContentPage
-{
- public Mode()
- {
- NavigationPage.SetHasNavigationBar(this, false);
-
- InitializeComponent();
- }
-
- private void QuandReglesClassiques(Object? sender, EventArgs e)
- {
- Partie partie = new Partie(new ReglesClassiques());
-
- partie.DemanderNom += new ConnexionPage().QuandDemanderNom;
- partie.NouveauTour += new Plateau().QuandNouveauTour;
- partie.PartieTerminee += new Victoire().QuandPartieTerminee;
-
- MauiProgram.Manageur.NouvellePartie(partie);
-
- partie.Jouer();
- }
+using CoreLibrary;
+using CoreLibrary.Regles;
+
+namespace MauiSpark.Pages;
+
+public partial class ModePage : ContentPage
+{
+ public ModePage()
+ {
+ NavigationPage.SetHasNavigationBar(this, false);
+
+ InitializeComponent();
+ }
+
+ private void QuandReglesPresse(Object sender, EventArgs e)
+ {
+ Partie partie;
+
+ if (sender.Equals(ReglesClassiques))
+ partie = new Partie(new ReglesClassiques());
+ else
+ return;
+
+ partie.DemanderNom += new ConnexionPage().QuandDemanderNom;
+ partie.NouveauTour += new PlateauPage().QuandNouveauTour;
+ partie.PartieTerminee += new Victoire().QuandPartieTerminee;
+
+ MauiProgram.Manageur.NouvellePartie(partie);
+
+ partie.Jouer();
+ }
}
\ No newline at end of file
diff --git a/Sources/MauiSpark/Pages/Plateau.xaml b/Sources/MauiSpark/Pages/PlateauPage.xaml
similarity index 54%
rename from Sources/MauiSpark/Pages/Plateau.xaml
rename to Sources/MauiSpark/Pages/PlateauPage.xaml
index af956e9..4b5e23d 100644
--- a/Sources/MauiSpark/Pages/Plateau.xaml
+++ b/Sources/MauiSpark/Pages/PlateauPage.xaml
@@ -2,25 +2,19 @@
+ x:Class="MauiSpark.Pages.PlateauPage"
+ xmlns:vues="clr-namespace:MauiSpark.Vues"
+ Title="PlateauPage">
-
-
+
+
@@ -47,7 +41,7 @@
@@ -65,15 +59,12 @@
BindableLayout.ItemsSource="{Binding [0]}">
-
+
-
+
@@ -87,8 +78,7 @@
@@ -110,17 +100,10 @@
Wrap="Wrap"
JustifyContent="SpaceAround"
AlignItems="Center"
- BindableLayout.ItemsSource="{Binding Code.Jetons}">
+ BindableLayout.ItemsSource="{Binding Code.Jetons}">
-
+
@@ -131,45 +114,21 @@
+
-
-
-
-
-
+
+
+
-
-
-
+
+
+
-
+
+
\ No newline at end of file
diff --git a/Sources/MauiSpark/Pages/Plateau.xaml.cs b/Sources/MauiSpark/Pages/PlateauPage.xaml.cs
similarity index 93%
rename from Sources/MauiSpark/Pages/Plateau.xaml.cs
rename to Sources/MauiSpark/Pages/PlateauPage.xaml.cs
index 4dbbf06..e6fd132 100644
--- a/Sources/MauiSpark/Pages/Plateau.xaml.cs
+++ b/Sources/MauiSpark/Pages/PlateauPage.xaml.cs
@@ -1,117 +1,117 @@
-using CoreLibrary;
-using CoreLibrary.Core;
-using CoreLibrary.Events;
-using CoreLibrary.Exceptions;
-using CoreLibrary.Joueurs;
-using MauiSpark.Convertisseurs;
-using System.Globalization;
-
-namespace MauiSpark.Pages;
-
-internal class Tour
-{
- public IEnumerable<(IEnumerable, IEnumerable)> Plateau { get; private init; }
- public Joueur Joueur { get; private init; }
- public string Numero { get; private init; }
- public Code Code { get; private init; }
-
- public Tour(NouveauTourEventArgs e)
- {
- Numero = $"Tour {e.Tour}";
- Joueur = e.Joueur;
- Code = e.Code;
-
- (IEnumerable, IEnumerable)[] plateau = new (IEnumerable, IEnumerable)[e.Grille.Count()];
- for (int i = 0; i < e.Grille.Count(); ++i)
- {
- plateau[i] = (e.Grille.ElementAt(i).Where(x => x.HasValue).Select(x => x!.Value), e.Indicateurs.ElementAt(i));
- }
- Plateau = plateau;
- }
-}
-
-
-
-public partial class Plateau : ContentPage
-{
- private Code? code;
- private Joueur? joueur;
-
- public Plateau()
- {
- NavigationPage.SetHasNavigationBar(this, false);
-
- InitializeComponent();
- }
-
- public async void QuandNouveauTour(object? sender, NouveauTourEventArgs e)
- {
- if (Application.Current == null || Application.Current.MainPage == null)
- return;
-
- if (((NavigationPage)Application.Current!.MainPage).CurrentPage != this)
- await Application.Current.MainPage.Navigation.PushAsync(this);
-
- IEnumerable pages = Application.Current.MainPage.Navigation.NavigationStack.Reverse().Skip(1);
-
- foreach (Page page in pages)
- {
- if (page is Accueil)
- break;
-
- Application.Current.MainPage.Navigation.RemovePage(page);
- }
-
- code = e.Code;
- joueur = e.Joueur;
-
- BindingContext = new Tour(e);
- }
-
- private void CouleurPresee(Object sender, EventArgs e)
- {
- Label label = (Label)sender;
- Couleur couleur = (Couleur)new CouleurVersCouleurMAUI().ConvertBack(label.TextColor, typeof(Couleur), null, CultureInfo.InvariantCulture);
-
- try
- {
- if(code != null)
- code.AjouterJeton(new Jeton(couleur));
- }
- catch (CodeCompletException)
- {
- DisplayAlert("Attention", "La code est plein", "OK");
- }
- }
-
- private void SupprimerDernierJeton(Object sender, EventArgs e)
- {
- try
- {
- if(code != null)
- code.SupprimerDernierJeton();
- }
- catch(CodeVideException)
- {
- DisplayAlert("Attention", "La code est vide", "OK");
- }
- }
-
- private void ValiderCode(Object sender, EventArgs e)
- {
- try
- {
- if(joueur != null && code != null)
- joueur.Code(code);
- }
- catch (CodeIncompletException)
- {
- DisplayAlert("Attention", "La code n'est pas complet", "OK");
- }
- }
-
- private async void QuandReglesClique(object sender, EventArgs e)
- {
- await Navigation.PushAsync(new Regle());
- }
+using CoreLibrary;
+using CoreLibrary.Core;
+using CoreLibrary.Events;
+using CoreLibrary.Exceptions;
+using CoreLibrary.Joueurs;
+using MauiSpark.Convertisseurs;
+using System.Globalization;
+
+namespace MauiSpark.Pages;
+
+internal class Tour
+{
+ public IEnumerable<(IEnumerable, IEnumerable)> Plateau { get; private init; }
+ public Joueur Joueur { get; private init; }
+ public string Numero { get; private init; }
+ public Code Code { get; private init; }
+
+ public Tour(NouveauTourEventArgs e)
+ {
+ Numero = $"Tour {e.Tour}";
+ Joueur = e.Joueur;
+ Code = e.Code;
+
+ (IEnumerable, IEnumerable)[] plateau = new (IEnumerable, IEnumerable)[e.Grille.Count()];
+ for (int i = 0; i < e.Grille.Count(); ++i)
+ {
+ plateau[i] = (e.Grille.ElementAt(i).Where(x => x.HasValue).Select(x => x!.Value), e.Indicateurs.ElementAt(i));
+ }
+ Plateau = plateau;
+ }
+}
+
+
+
+public partial class PlateauPage : ContentPage
+{
+ private Code? code;
+ private Joueur? joueur;
+
+ public PlateauPage()
+ {
+ NavigationPage.SetHasNavigationBar(this, false);
+
+ InitializeComponent();
+ }
+
+ public async void QuandNouveauTour(object? sender, NouveauTourEventArgs e)
+ {
+ if (Application.Current == null || Application.Current.MainPage == null)
+ return;
+
+ if (((NavigationPage)Application.Current!.MainPage).CurrentPage != this)
+ await Application.Current.MainPage.Navigation.PushAsync(this);
+
+ IEnumerable pages = Application.Current.MainPage.Navigation.NavigationStack.Reverse().Skip(1);
+
+ foreach (Page page in pages)
+ {
+ if (page is AccueilPage)
+ break;
+
+ Application.Current.MainPage.Navigation.RemovePage(page);
+ }
+
+ code = e.Code;
+ joueur = e.Joueur;
+
+ BindingContext = new Tour(e);
+ }
+
+ private void CouleurPresee(Object sender, EventArgs e)
+ {
+ Label label = (Label)sender;
+ Couleur couleur = (Couleur)new CouleurVersCouleurMAUI().ConvertBack(label.TextColor, typeof(Couleur), null, CultureInfo.InvariantCulture);
+
+ try
+ {
+ if(code != null)
+ code.AjouterJeton(new Jeton(couleur));
+ }
+ catch (CodeCompletException)
+ {
+ DisplayAlert("Attention", "La code est plein", "OK");
+ }
+ }
+
+ private void SupprimerDernierJeton(Object sender, EventArgs e)
+ {
+ try
+ {
+ if(code != null)
+ code.SupprimerDernierJeton();
+ }
+ catch(CodeVideException)
+ {
+ DisplayAlert("Attention", "La code est vide", "OK");
+ }
+ }
+
+ private void ValiderCode(Object sender, EventArgs e)
+ {
+ try
+ {
+ if(joueur != null && code != null)
+ joueur.Code(code);
+ }
+ catch (CodeIncompletException)
+ {
+ DisplayAlert("Attention", "La code n'est pas complet", "OK");
+ }
+ }
+
+ private async void QuandReglesClique(object sender, EventArgs e)
+ {
+ await Navigation.PushAsync(new Regle());
+ }
}
\ No newline at end of file
diff --git a/Sources/MauiSpark/Pages/Victoire.xaml.cs b/Sources/MauiSpark/Pages/Victoire.xaml.cs
index e57a7a9..44bc475 100644
--- a/Sources/MauiSpark/Pages/Victoire.xaml.cs
+++ b/Sources/MauiSpark/Pages/Victoire.xaml.cs
@@ -24,7 +24,7 @@ public partial class Victoire : ContentPage
foreach (Page page in pages)
{
- if (page is Accueil)
+ if (page is AccueilPage)
break;
Application.Current.MainPage.Navigation.RemovePage(page);
diff --git a/Sources/MauiSpark/Resources/Styles/Colors.xaml b/Sources/MauiSpark/Resources/Styles/Colors.xaml
index 1ce724f..a6d858d 100644
--- a/Sources/MauiSpark/Resources/Styles/Colors.xaml
+++ b/Sources/MauiSpark/Resources/Styles/Colors.xaml
@@ -6,19 +6,17 @@
- #512BD4
- #ac99ea
- #242424
- #DFD8F7
- #9880e5
- #2B0B98
-
- White
- Black
- #D600AA
- #190649
- #1f1f1f
-
+ #FFFFFF
+ #EFF2EF
+ #CCCCCC
+ #000000
+
+ #212121
+ #2F2F2F
+ #101010
+ #FFFFFF
+
+
#FAEEA1
#2F0E36
#DA0081
@@ -33,6 +31,8 @@
#A908DC
#C875A4
#F0C67B
+ #000000
+ #FFFFFF
#E1E1E1
#C8C8C8
@@ -43,9 +43,6 @@
#212121
#141414
-
-
-
diff --git a/Sources/MauiSpark/Resources/Styles/Styles.xaml b/Sources/MauiSpark/Resources/Styles/Styles.xaml
index 785dc1c..e08fe8d 100644
--- a/Sources/MauiSpark/Resources/Styles/Styles.xaml
+++ b/Sources/MauiSpark/Resources/Styles/Styles.xaml
@@ -5,80 +5,42 @@
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml">
-
-
-
-
-
-
-
-
-
-
-
diff --git a/Sources/MauiSpark/Vues/BoutonClassementVue.xaml b/Sources/MauiSpark/Vues/BoutonClassementVue.xaml
new file mode 100644
index 0000000..da1515f
--- /dev/null
+++ b/Sources/MauiSpark/Vues/BoutonClassementVue.xaml
@@ -0,0 +1,10 @@
+
+
+
+
+
diff --git a/Sources/MauiSpark/Vues/BoutonClassementVue.xaml.cs b/Sources/MauiSpark/Vues/BoutonClassementVue.xaml.cs
new file mode 100644
index 0000000..506e4d3
--- /dev/null
+++ b/Sources/MauiSpark/Vues/BoutonClassementVue.xaml.cs
@@ -0,0 +1,16 @@
+using MauiSpark.Pages;
+
+namespace MauiSpark.Vues;
+
+public partial class BoutonClassementVue : ContentView
+{
+ public BoutonClassementVue()
+ {
+ InitializeComponent();
+ }
+
+ private void QuandClassementClique(Object? sender, EventArgs e)
+ {
+ Navigation.PushAsync(new TableauScore());
+ }
+}
\ No newline at end of file
diff --git a/Sources/MauiSpark/Vues/BoutonReglesVue.xaml b/Sources/MauiSpark/Vues/BoutonReglesVue.xaml
new file mode 100644
index 0000000..cbd81f3
--- /dev/null
+++ b/Sources/MauiSpark/Vues/BoutonReglesVue.xaml
@@ -0,0 +1,10 @@
+
+
+
+
+
diff --git a/Sources/MauiSpark/Vues/BoutonReglesVue.xaml.cs b/Sources/MauiSpark/Vues/BoutonReglesVue.xaml.cs
new file mode 100644
index 0000000..b817153
--- /dev/null
+++ b/Sources/MauiSpark/Vues/BoutonReglesVue.xaml.cs
@@ -0,0 +1,16 @@
+using MauiSpark.Pages;
+
+namespace MauiSpark.Vues;
+
+public partial class BoutonReglesVue : ContentView
+{
+ public BoutonReglesVue()
+ {
+ InitializeComponent();
+ }
+
+ private void QuandReglesClique(Object? sender, EventArgs e)
+ {
+ Navigation.PushAsync(new Regle());
+ }
+}
\ No newline at end of file
diff --git a/Sources/MauiSpark/Vues/JetonVue.xaml b/Sources/MauiSpark/Vues/JetonVue.xaml
new file mode 100644
index 0000000..84e8cc1
--- /dev/null
+++ b/Sources/MauiSpark/Vues/JetonVue.xaml
@@ -0,0 +1,16 @@
+
+
+
+
+
+
+
+
+
diff --git a/Sources/MauiSpark/Vues/JetonVue.xaml.cs b/Sources/MauiSpark/Vues/JetonVue.xaml.cs
new file mode 100644
index 0000000..1634905
--- /dev/null
+++ b/Sources/MauiSpark/Vues/JetonVue.xaml.cs
@@ -0,0 +1,47 @@
+namespace MauiSpark.Vues;
+
+public partial class JetonVue : ContentView
+{
+ public static readonly BindableProperty CouleurPropriete = BindableProperty.Create(nameof(Couleur), typeof(Color), typeof(JetonVue), default(Color), propertyChanged: QuandCouleurChange);
+
+ public Color? Couleur
+ {
+ get => (Color?)GetValue(CouleurPropriete);
+ set => SetValue(CouleurPropriete, value);
+ }
+
+ public JetonVue()
+ {
+ InitializeComponent();
+ BindingContext = this;
+ }
+
+ private void QuandTailleChangee(object sender, EventArgs e)
+ {
+ double taille = Math.Min(Grid.Width, Grid.Height) / 2;
+ Cercle.WidthRequest = Cercle.HeightRequest = taille;
+ }
+
+ private static void QuandCouleurChange(BindableObject bindable, object oldValue, object newValue)
+ {
+ var view = bindable as JetonVue;
+ if (view != null)
+ {
+ view.UpdateCouleur();
+ }
+ }
+
+ private void UpdateCouleur()
+ {
+ // Gérer la couleur null
+ if (Couleur == null)
+ {
+ // Définir une couleur par défaut si null
+ BackgroundColor = Colors.Transparent; // Ou toute autre couleur par défaut
+ }
+ else
+ {
+ BackgroundColor = Couleur;
+ }
+ }
+}
\ No newline at end of file
diff --git a/Sources/MauiSpark/Vues/TitreVue.xaml b/Sources/MauiSpark/Vues/TitreVue.xaml
new file mode 100644
index 0000000..ab15fae
--- /dev/null
+++ b/Sources/MauiSpark/Vues/TitreVue.xaml
@@ -0,0 +1,13 @@
+
+
+
+
+
diff --git a/Sources/MauiSpark/Vues/TitreVue.xaml.cs b/Sources/MauiSpark/Vues/TitreVue.xaml.cs
new file mode 100644
index 0000000..f973e6b
--- /dev/null
+++ b/Sources/MauiSpark/Vues/TitreVue.xaml.cs
@@ -0,0 +1,18 @@
+namespace MauiSpark.Vues;
+
+public partial class TitreVue : ContentView
+{
+ public static readonly BindableProperty TextePropriete = BindableProperty.Create(nameof(Texte), typeof(string), typeof(TitreVue), default(string));
+
+ public string Texte
+ {
+ get => (string)GetValue(TextePropriete);
+ set => SetValue(TextePropriete, value.ToUpper());
+ }
+
+ public TitreVue()
+ {
+ InitializeComponent();
+ BindingContext = this;
+ }
+}
\ No newline at end of file
diff --git a/Sources/mastermind.sln b/Sources/mastermind.sln
index af9bf58..4816ed0 100644
--- a/Sources/mastermind.sln
+++ b/Sources/mastermind.sln
@@ -14,6 +14,8 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "UnitTesting", "UnitTesting\
{341FB405-085D-4C34-B395-64EF0F9B93E0} = {341FB405-085D-4C34-B395-64EF0F9B93E0}
EndProjectSection
EndProject
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ConsoleApp1", "ConsoleApp1\ConsoleApp1.csproj", "{69A6F940-1A25-4FC0-83E3-ABEFA4003DD6}"
+EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
@@ -38,6 +40,10 @@ Global
{A2182054-C0D1-46D6-BD39-F3F7926CE2DD}.Debug|Any CPU.Build.0 = Debug|Any CPU
{A2182054-C0D1-46D6-BD39-F3F7926CE2DD}.Release|Any CPU.ActiveCfg = Release|Any CPU
{A2182054-C0D1-46D6-BD39-F3F7926CE2DD}.Release|Any CPU.Build.0 = Release|Any CPU
+ {69A6F940-1A25-4FC0-83E3-ABEFA4003DD6}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {69A6F940-1A25-4FC0-83E3-ABEFA4003DD6}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {69A6F940-1A25-4FC0-83E3-ABEFA4003DD6}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {69A6F940-1A25-4FC0-83E3-ABEFA4003DD6}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE