Ne fonctionne pas j'arrete pour ce soir - Amélioration design
continuous-integration/drone/push Build is failing Details

master
Céleste BARBOSA 11 months ago
parent 0f15fb0e16
commit f05a0f997d

@ -0,0 +1,10 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net8.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
</PropertyGroup>
</Project>

@ -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.");
}
}
}

@ -11,9 +11,10 @@ namespace CoreLibrary
/// Représente une partie de jeu. /// Représente une partie de jeu.
/// </summary> /// </summary>
[DataContract] [DataContract]
[KnownType(typeof(ReglesClassiques))]
public class Partie : IEstPersistant public class Partie : IEstPersistant
{ {
[DataMember]
public IRegles Regles { get; private set; } public IRegles Regles { get; private set; }
[DataMember] [DataMember]

@ -9,18 +9,14 @@ namespace CoreLibrary.Persistance
public T[] Charger<T>() where T : IEstPersistant public T[] Charger<T>() where T : IEstPersistant
{ {
string dossierAvant = Directory.GetCurrentDirectory(); string fichier = $"{typeof(T).Name.ToLower()}s.json";
string dossier = Path.Combine(dossierAvant, "../../../.."); Directory.SetCurrentDirectory(Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "../../../../../../.."));
string fichier = $"{typeof(T).Name}.json";
if (!Directory.Exists("Fichiers"))
bool c = Directory.Exists(dossier);
if (!c)
return []; return [];
Directory.SetCurrentDirectory(dossier); Directory.SetCurrentDirectory(Path.Combine(Directory.GetCurrentDirectory(), "Fichiers"));
if (!File.Exists(fichier)) if (!File.Exists(fichier))
return []; return [];
@ -38,13 +34,14 @@ namespace CoreLibrary.Persistance
public void Enregistrer<T>(T[] elements) where T : IEstPersistant public void Enregistrer<T>(T[] elements) where T : IEstPersistant
{ {
string dossier = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData), "Mastermind"); string fichier = $"{typeof(T).Name.ToLower()}s.json";
string fichier = $"{typeof(T).Name}.json";
Directory.SetCurrentDirectory(Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "../../../../../../.."));
if (!Directory.Exists(dossier)) if (!Directory.Exists("Fichiers"))
Directory.CreateDirectory(dossier); Directory.CreateDirectory("Fichiers");
Directory.SetCurrentDirectory(dossier); Directory.SetCurrentDirectory(Path.Combine(Directory.GetCurrentDirectory(), "Fichiers"));
DataContractJsonSerializer jsonSerializer = new DataContractJsonSerializer(typeof(T[])); DataContractJsonSerializer jsonSerializer = new DataContractJsonSerializer(typeof(T[]));

@ -1,4 +1,6 @@
 
using System.Runtime.Serialization;
namespace CoreLibrary.Regles namespace CoreLibrary.Regles
{ {
/// <summary> /// <summary>

@ -18,7 +18,7 @@ namespace CoreLibrary.Regles
/// Le nombre maximum de tour. /// Le nombre maximum de tour.
/// </summary> /// </summary>
[DataMember] [DataMember]
public int TourMaximum { get => 2; } public int TourMaximum { get => 12; }
/// <summary> /// <summary>
/// La taille maximale d'un code. /// La taille maximale d'un code.

@ -1,6 +1,4 @@
using CoreLibrary.Manager; using MauiSpark.Pages;
using CoreLibrary.Persistance;
using MauiSpark.Pages;
namespace MauiSpark namespace MauiSpark
{ {
@ -10,7 +8,7 @@ namespace MauiSpark
{ {
InitializeComponent(); InitializeComponent();
MainPage = new NavigationPage(new Accueil()); MainPage = new NavigationPage(new AccueilPage());
MainPage.Title = "Mastermind"; MainPage.Title = "Mastermind";
} }
} }

@ -67,7 +67,19 @@
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<MauiXaml Update="Pages\Accueil.xaml"> <Compile Update="Pages\AccueilPage.xaml.cs">
<DependentUpon>AccueilPage.xaml</DependentUpon>
</Compile>
<Compile Update="Pages\ModePage.xaml.cs">
<DependentUpon>ModePage.xaml</DependentUpon>
</Compile>
<Compile Update="Pages\PlateauPage.xaml.cs">
<DependentUpon>PlateauPage.xaml</DependentUpon>
</Compile>
</ItemGroup>
<ItemGroup>
<MauiXaml Update="Pages\AccueilPage.xaml">
<Generator>MSBuild:Compile</Generator> <Generator>MSBuild:Compile</Generator>
</MauiXaml> </MauiXaml>
<MauiXaml Update="Pages\ConnexionPage.xaml"> <MauiXaml Update="Pages\ConnexionPage.xaml">
@ -76,10 +88,10 @@
<MauiXaml Update="Pages\Egaliter.xaml"> <MauiXaml Update="Pages\Egaliter.xaml">
<Generator>MSBuild:Compile</Generator> <Generator>MSBuild:Compile</Generator>
</MauiXaml> </MauiXaml>
<MauiXaml Update="Pages\Mode.xaml"> <MauiXaml Update="Pages\ModePage.xaml">
<Generator>MSBuild:Compile</Generator> <Generator>MSBuild:Compile</Generator>
</MauiXaml> </MauiXaml>
<MauiXaml Update="Pages\Plateau.xaml"> <MauiXaml Update="Pages\PlateauPage.xaml">
<Generator>MSBuild:Compile</Generator> <Generator>MSBuild:Compile</Generator>
</MauiXaml> </MauiXaml>
<MauiXaml Update="Pages\Regle.xaml"> <MauiXaml Update="Pages\Regle.xaml">
@ -94,6 +106,18 @@
<MauiXaml Update="Views\CTableauScore.xaml"> <MauiXaml Update="Views\CTableauScore.xaml">
<Generator>MSBuild:Compile</Generator> <Generator>MSBuild:Compile</Generator>
</MauiXaml> </MauiXaml>
<MauiXaml Update="Vues\BoutonClassementVue.xaml">
<Generator>MSBuild:Compile</Generator>
</MauiXaml>
<MauiXaml Update="Vues\BoutonReglesVue.xaml">
<Generator>MSBuild:Compile</Generator>
</MauiXaml>
<MauiXaml Update="Vues\JetonVue.xaml">
<Generator>MSBuild:Compile</Generator>
</MauiXaml>
<MauiXaml Update="Vues\TitreVue.xaml">
<Generator>MSBuild:Compile</Generator>
</MauiXaml>
</ItemGroup> </ItemGroup>
</Project> </Project>

@ -1,45 +0,0 @@
<ContentPage xmlns="http://schemas.microsoft.com/dotnet/2021/maui"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
x:Class="MauiSpark.Pages.Accueil"
Title="Accueil">
<Grid
ColumnDefinitions="*"
RowDefinitions="auto, *, *">
<Grid
ColumnDefinitions="*,*"
RowDefinitions="auto">
<ImageButton
Style="{StaticResource AccueilBouton}"
Source="pointinterrogation.png"
HorizontalOptions="Start"
Clicked="QuandReglesClique"
/>
<ImageButton
Grid.Column="1"
Style="{StaticResource AccueilBouton}"
Source="statistiques.png"
HorizontalOptions="End"
Clicked="QuandTableauClique"
/>
</Grid>
<Label
Grid.Row="1"
Text="MASTERMIND"
FontSize="Header"
HorizontalTextAlignment="Center"/>
<Button
Grid.Row="2"
Text="Jouer"
Clicked="QuandJouerClique"/>
</Grid>
</ContentPage>

@ -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());
}
}

@ -0,0 +1,30 @@
<ContentPage xmlns="http://schemas.microsoft.com/dotnet/2021/maui"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
x:Class="MauiSpark.Pages.AccueilPage"
xmlns:vues="clr-namespace:MauiSpark.Vues"
Title="Accueil">
<Grid
ColumnDefinitions="*"
RowDefinitions="*, *">
<Grid
ColumnDefinitions="*, *, *"
RowDefinitions="*">
<vues:BoutonReglesVue HorizontalOptions="Start"/>
<vues:TitreVue Texte="mastermind" Grid.Column="1"/>
<vues:BoutonClassementVue Grid.Column="2" HorizontalOptions="End"/>
</Grid>
<Button
Grid.Row="2"
Text="Jouer"
VerticalOptions="Center"
Margin="0, 50"
Clicked="QuandJouerClique"/>
</Grid>
</ContentPage>

@ -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());
}
}

@ -3,17 +3,15 @@
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml" xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
xmlns:Views="clr-namespace:MauiSpark.Views" xmlns:Views="clr-namespace:MauiSpark.Views"
x:Class="MauiSpark.Pages.ConnexionPage" x:Class="MauiSpark.Pages.ConnexionPage"
xmlns:vues="clr-namespace:MauiSpark.Vues"
Title="Connexion"> Title="Connexion">
<Grid <Grid
ColumnDefinitions="*" ColumnDefinitions="*"
RowDefinitions="*, auto, *"> RowDefinitions="auto, *, *">
<vues:TitreVue Texte="joueurs"/>
<Label
VerticalOptions="Center"
Text="JOUEURS"
HorizontalOptions="Center"
FontSize="Header"
Margin="0"/>
<VerticalStackLayout <VerticalStackLayout
Grid.Row="1" Grid.Row="1"

@ -1,10 +0,0 @@
<?xml version="1.0" encoding="utf-8" ?>
<ContentPage xmlns="http://schemas.microsoft.com/dotnet/2021/maui"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
x:Class="MauiSpark.Pages.Mode"
Title="Mode">
<Grid ColumnDefinitions="*" RowDefinitions="*, *">
<Label Text="Mode de jeu"/>
<Button Grid.Row="1" Text="Règles classiques" Clicked="QuandReglesClassiques"/>
</Grid>
</ContentPage>

@ -0,0 +1,20 @@
<?xml version="1.0" encoding="utf-8" ?>
<ContentPage xmlns="http://schemas.microsoft.com/dotnet/2021/maui"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
x:Class="MauiSpark.Pages.ModePage"
xmlns:vues="clr-namespace:MauiSpark.Vues"
Title="ModePage">
<Grid
ColumnDefinitions="*"
RowDefinitions="*, *">
<vues:TitreVue Texte="mode de jeu"/>
<Button
x:Name="ReglesClassiques"
Grid.Row="1"
Text="Règles classiques"
Clicked="QuandReglesPresse"/>
</Grid>
</ContentPage>

@ -1,24 +1,28 @@
using CoreLibrary; using CoreLibrary;
using CoreLibrary.Events;
using CoreLibrary.Regles; using CoreLibrary.Regles;
namespace MauiSpark.Pages; namespace MauiSpark.Pages;
public partial class Mode : ContentPage public partial class ModePage : ContentPage
{ {
public Mode() public ModePage()
{ {
NavigationPage.SetHasNavigationBar(this, false); NavigationPage.SetHasNavigationBar(this, false);
InitializeComponent(); InitializeComponent();
} }
private void QuandReglesClassiques(Object? sender, EventArgs e) private void QuandReglesPresse(Object sender, EventArgs e)
{ {
Partie partie = new Partie(new ReglesClassiques()); Partie partie;
if (sender.Equals(ReglesClassiques))
partie = new Partie(new ReglesClassiques());
else
return;
partie.DemanderNom += new ConnexionPage().QuandDemanderNom; partie.DemanderNom += new ConnexionPage().QuandDemanderNom;
partie.NouveauTour += new Plateau().QuandNouveauTour; partie.NouveauTour += new PlateauPage().QuandNouveauTour;
partie.PartieTerminee += new Victoire().QuandPartieTerminee; partie.PartieTerminee += new Victoire().QuandPartieTerminee;
MauiProgram.Manageur.NouvellePartie(partie); MauiProgram.Manageur.NouvellePartie(partie);

@ -2,25 +2,19 @@
<ContentPage xmlns="http://schemas.microsoft.com/dotnet/2021/maui" <ContentPage xmlns="http://schemas.microsoft.com/dotnet/2021/maui"
xmlns:conv="clr-namespace:MauiSpark.Convertisseurs" xmlns:conv="clr-namespace:MauiSpark.Convertisseurs"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml" xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
x:Class="MauiSpark.Pages.Plateau" x:Class="MauiSpark.Pages.PlateauPage"
Title="Plateau"> xmlns:vues="clr-namespace:MauiSpark.Vues"
Title="PlateauPage">
<ContentPage.Resources> <ContentPage.Resources>
<conv:CouleurVersCouleurMAUI x:Key="CouleurVersCouleurMAUI"/> <conv:CouleurVersCouleurMAUI x:Key="CouleurVersCouleurMAUI"/>
<conv:IndicateurVersCouleurMAUI x:Key="IndicateurVersCouleurMAUI"/> <conv:IndicateurVersCouleurMAUI x:Key="IndicateurVersCouleurMAUI"/>
<conv:JetonVersTexte x:Key="JetonVersTexte"/> <conv:JetonVersTexte x:Key="JetonVersTexte"/>
</ContentPage.Resources> </ContentPage.Resources>
<Grid RowDefinitions="*" ColumnDefinitions="*, *,auto">
<ImageButton <Grid RowDefinitions="*" ColumnDefinitions="*, *">
Grid.Column="2"
Style="{StaticResource AccueilBouton}"
Source="pointinterrogation.png"
HorizontalOptions="End"
VerticalOptions="Start"
Clicked="QuandReglesClique"/>
<Grid RowDefinitions="*" ColumnDefinitions="*" Margin="50"> <Grid RowDefinitions="*" ColumnDefinitions="*" Margin="50">
<Border <Border
Stroke="#000000"
StrokeThickness="2" StrokeThickness="2"
StrokeShape="RoundRectangle 10" StrokeShape="RoundRectangle 10"
HorizontalOptions="Center"> HorizontalOptions="Center">
@ -65,15 +59,12 @@
BindableLayout.ItemsSource="{Binding [0]}"> BindableLayout.ItemsSource="{Binding [0]}">
<BindableLayout.ItemTemplate> <BindableLayout.ItemTemplate>
<DataTemplate> <DataTemplate>
<Label Text="O"
TextColor="{Binding Couleur, Converter={StaticResource CouleurVersCouleurMAUI}}"
VerticalOptions="Center"
HorizontalOptions="Center" />
</DataTemplate> </DataTemplate>
</BindableLayout.ItemTemplate> </BindableLayout.ItemTemplate>
</FlexLayout> </FlexLayout>
<BoxView Grid.Row="1" Grid.ColumnSpan="2" HeightRequest="1" BackgroundColor="#000000" VerticalOptions="End"/> <BoxView Grid.Row="1" Grid.ColumnSpan="2" HeightRequest="1" VerticalOptions="End"/>
</Grid> </Grid>
</DataTemplate> </DataTemplate>
</BindableLayout.ItemTemplate> </BindableLayout.ItemTemplate>
@ -88,7 +79,6 @@
<Border <Border
HorizontalOptions="FillAndExpand" HorizontalOptions="FillAndExpand"
Grid.Row="1" Grid.Row="1"
Stroke="#000000"
StrokeThickness="2" StrokeThickness="2"
StrokeShape="RoundRectangle 10"> StrokeShape="RoundRectangle 10">
@ -113,14 +103,7 @@
BindableLayout.ItemsSource="{Binding Code.Jetons}"> BindableLayout.ItemsSource="{Binding Code.Jetons}">
<BindableLayout.ItemTemplate> <BindableLayout.ItemTemplate>
<DataTemplate> <DataTemplate>
<Label <vues:JetonVue Couleur="{Binding Couleur, Converter={StaticResource conv:CouleurVersCouleurMAUI}}"/>
FontSize="Medium"
HorizontalOptions="Center"
VerticalOptions="Center"
HorizontalTextAlignment="Center"
VerticalTextAlignment="Center"
TextColor="{Binding Couleur, Converter={StaticResource CouleurVersCouleurMAUI}}"
Text="{Binding ., Converter={StaticResource JetonVersTexte}}"/>
</DataTemplate> </DataTemplate>
</BindableLayout.ItemTemplate> </BindableLayout.ItemTemplate>
</FlexLayout> </FlexLayout>
@ -131,45 +114,21 @@
</Label.GestureRecognizers> </Label.GestureRecognizers>
</Label> </Label>
<BoxView Grid.Row="1" Grid.ColumnSpan="6" HeightRequest="1" VerticalOptions="Center"/>
<BoxView Grid.Row="1" Grid.ColumnSpan="6" HeightRequest="1" BackgroundColor="#000000" VerticalOptions="Center"/> <vues:JetonVue Couleur="{x:Static conv:CouleurVersCouleurMAUI.Rouge}" HorizontalOptions="FillAndExpand" VerticalOptions="FillAndExpand" Grid.Column="0" Grid.Row="2" Grid.ColumnSpan="2"/>
<vues:JetonVue Couleur="{x:Static conv:CouleurVersCouleurMAUI.Vert}" HorizontalOptions="FillAndExpand" VerticalOptions="FillAndExpand" Grid.Column="2" Grid.Row="2" Grid.ColumnSpan="2"/>
<vues:JetonVue Couleur="{x:Static conv:CouleurVersCouleurMAUI.Bleu}" HorizontalOptions="FillAndExpand" VerticalOptions="FillAndExpand" Grid.Column="4" Grid.Row="2" Grid.ColumnSpan="2"/>
<Label x:Name="JetonRouge" FontSize="Medium" TextColor="{x:Static conv:CouleurVersCouleurMAUI.Rouge}" HorizontalOptions="FillAndExpand" VerticalOptions="FillAndExpand" HorizontalTextAlignment="Center" VerticalTextAlignment="Center" Grid.Column="0" Grid.Row="2" Grid.ColumnSpan="2" Text="O"> <vues:JetonVue Couleur="{x:Static conv:CouleurVersCouleurMAUI.Jaune}" HorizontalOptions="FillAndExpand" VerticalOptions="FillAndExpand" Grid.Column="0" Grid.Row="3" Grid.ColumnSpan="2"/>
<Label.GestureRecognizers> <vues:JetonVue Couleur="{x:Static conv:CouleurVersCouleurMAUI.Noir}" HorizontalOptions="FillAndExpand" VerticalOptions="FillAndExpand" Grid.Column="2" Grid.Row="3" Grid.ColumnSpan="2"/>
<TapGestureRecognizer Tapped="CouleurPresee"/> <vues:JetonVue Couleur="{x:Static conv:CouleurVersCouleurMAUI.Blanc}" HorizontalOptions="FillAndExpand" VerticalOptions="FillAndExpand" Grid.Column="4" Grid.Row="3" Grid.ColumnSpan="2"/>
</Label.GestureRecognizers>
</Label>
<Label x:Name="JetonVert" FontSize="Medium" TextColor="{x:Static conv:CouleurVersCouleurMAUI.Vert}" HorizontalOptions="FillAndExpand" VerticalOptions="FillAndExpand" HorizontalTextAlignment="Center" VerticalTextAlignment="Center" Grid.Column="2" Grid.Row="2" Grid.ColumnSpan="2" Text="O">
<Label.GestureRecognizers>
<TapGestureRecognizer Tapped="CouleurPresee"/>
</Label.GestureRecognizers>
</Label>
<Label x:Name="JetonBleu" FontSize="Medium" TextColor="{x:Static conv:CouleurVersCouleurMAUI.Bleu}" HorizontalOptions="FillAndExpand" VerticalOptions="FillAndExpand" HorizontalTextAlignment="Center" VerticalTextAlignment="Center" Grid.Column="4" Grid.Row="2" Grid.ColumnSpan="2" Text="O">
<Label.GestureRecognizers>
<TapGestureRecognizer Tapped="CouleurPresee"/>
</Label.GestureRecognizers>
</Label>
<Label x:Name="JetonJaune" FontSize="Medium" TextColor="{x:Static conv:CouleurVersCouleurMAUI.Jaune}" HorizontalOptions="FillAndExpand" VerticalOptions="FillAndExpand" HorizontalTextAlignment="Center" VerticalTextAlignment="Center" Grid.Column="0" Grid.Row="3" Grid.ColumnSpan="2" Text="O">
<Label.GestureRecognizers>
<TapGestureRecognizer Tapped="CouleurPresee"/>
</Label.GestureRecognizers>
</Label>
<Label x:Name="JetonNoir" FontSize="Medium" TextColor="{x:Static conv:CouleurVersCouleurMAUI.Noir}" HorizontalOptions="FillAndExpand" VerticalOptions="FillAndExpand" HorizontalTextAlignment="Center" VerticalTextAlignment="Center" Grid.Column="2" Grid.Row="3" Grid.ColumnSpan="2" Text="O">
<Label.GestureRecognizers>
<TapGestureRecognizer Tapped="CouleurPresee"/>
</Label.GestureRecognizers>
</Label>
<Label x:Name="JetonBlanc" FontSize="Medium" TextColor="{x:Static conv:CouleurVersCouleurMAUI.Blanc}" HorizontalOptions="FillAndExpand" VerticalOptions="FillAndExpand" HorizontalTextAlignment="Center" VerticalTextAlignment="Center" Grid.Column="4" Grid.Row="3" Grid.ColumnSpan="2" Text="O">
<Label.GestureRecognizers>
<TapGestureRecognizer Tapped="CouleurPresee"/>
</Label.GestureRecognizers>
</Label>
</Grid> </Grid>
</Border> </Border>
<Label Grid.Row="2" Text="{Binding Numero}" FontSize="Medium" VerticalOptions="Center" HorizontalOptions="Center"/> <Label Grid.Row="2" Text="{Binding Numero}" FontSize="Medium" VerticalOptions="Center" HorizontalOptions="Center"/>
</Grid> </Grid>
</Grid>
<vues:BoutonReglesVue Grid.Column="1" VerticalOptions="Start" HorizontalOptions="End"/>
</Grid>
</ContentPage> </ContentPage>

@ -32,12 +32,12 @@ internal class Tour
public partial class Plateau : ContentPage public partial class PlateauPage : ContentPage
{ {
private Code? code; private Code? code;
private Joueur? joueur; private Joueur? joueur;
public Plateau() public PlateauPage()
{ {
NavigationPage.SetHasNavigationBar(this, false); NavigationPage.SetHasNavigationBar(this, false);
@ -56,7 +56,7 @@ public partial class Plateau : ContentPage
foreach (Page page in pages) foreach (Page page in pages)
{ {
if (page is Accueil) if (page is AccueilPage)
break; break;
Application.Current.MainPage.Navigation.RemovePage(page); Application.Current.MainPage.Navigation.RemovePage(page);

@ -24,7 +24,7 @@ public partial class Victoire : ContentPage
foreach (Page page in pages) foreach (Page page in pages)
{ {
if (page is Accueil) if (page is AccueilPage)
break; break;
Application.Current.MainPage.Navigation.RemovePage(page); Application.Current.MainPage.Navigation.RemovePage(page);

@ -6,18 +6,16 @@
<!-- Note: For Android please see also Platforms\Android\Resources\values\colors.xml --> <!-- Note: For Android please see also Platforms\Android\Resources\values\colors.xml -->
<Color x:Key="Primary">#512BD4</Color> <Color x:Key="FondClair">#FFFFFF</Color>
<Color x:Key="PrimaryDark">#ac99ea</Color> <Color x:Key="FondSecondaireClair">#EFF2EF</Color>
<Color x:Key="PrimaryDarkText">#242424</Color> <Color x:Key="BordureClair">#CCCCCC</Color>
<Color x:Key="Secondary">#DFD8F7</Color> <Color x:Key="TexteSombre">#000000</Color>
<Color x:Key="SecondaryDarkText">#9880e5</Color>
<Color x:Key="Tertiary">#2B0B98</Color> <Color x:Key="FondSombre">#212121</Color>
<Color x:Key="FondSecondaireSombre">#2F2F2F</Color>
<Color x:Key="White">White</Color> <Color x:Key="BordureSombre">#101010</Color>
<Color x:Key="Black">Black</Color> <Color x:Key="TexteClair">#FFFFFF</Color>
<Color x:Key="Magenta">#D600AA</Color>
<Color x:Key="MidnightBlue">#190649</Color>
<Color x:Key="OffBlack">#1f1f1f</Color>
<Color x:Key="Poussin">#FAEEA1</Color> <Color x:Key="Poussin">#FAEEA1</Color>
<Color x:Key="Raisin">#2F0E36</Color> <Color x:Key="Raisin">#2F0E36</Color>
@ -33,6 +31,8 @@
<Color x:Key="Violet">#A908DC</Color> <Color x:Key="Violet">#A908DC</Color>
<Color x:Key="LightPurple">#C875A4</Color> <Color x:Key="LightPurple">#C875A4</Color>
<Color x:Key="LightYellow">#F0C67B</Color> <Color x:Key="LightYellow">#F0C67B</Color>
<Color x:Key="Black">#000000</Color>
<Color x:Key="White">#FFFFFF</Color>
<Color x:Key="Gray100">#E1E1E1</Color> <Color x:Key="Gray100">#E1E1E1</Color>
<Color x:Key="Gray200">#C8C8C8</Color> <Color x:Key="Gray200">#C8C8C8</Color>
@ -43,9 +43,6 @@
<Color x:Key="Gray900">#212121</Color> <Color x:Key="Gray900">#212121</Color>
<Color x:Key="Gray950">#141414</Color> <Color x:Key="Gray950">#141414</Color>
<SolidColorBrush x:Key="PrimaryBrush" Color="{StaticResource Primary}"/>
<SolidColorBrush x:Key="SecondaryBrush" Color="{StaticResource Secondary}"/>
<SolidColorBrush x:Key="TertiaryBrush" Color="{StaticResource Tertiary}"/>
<SolidColorBrush x:Key="WhiteBrush" Color="{StaticResource White}"/> <SolidColorBrush x:Key="WhiteBrush" Color="{StaticResource White}"/>
<SolidColorBrush x:Key="BlackBrush" Color="{StaticResource Black}"/> <SolidColorBrush x:Key="BlackBrush" Color="{StaticResource Black}"/>

@ -5,80 +5,42 @@
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"> xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml">
<Style TargetType="Page" ApplyToDerivedTypes="True"> <Style TargetType="Page" ApplyToDerivedTypes="True">
<Setter Property="BackgroundColor" Value="{AppThemeBinding Light={StaticResource Poussin}, Dark={StaticResource Raisin}}"/> <Setter Property="BackgroundColor" Value="{AppThemeBinding Light={StaticResource FondClair}, Dark={StaticResource FondSombre}}"/>
</Style> </Style>
<Style TargetType="Label"> <Style TargetType="Label">
<Setter Property="TextColor" Value="{AppThemeBinding Light={StaticResource Barbie}, Dark={StaticResource Perry}}"/> <Setter Property="TextColor" Value="{AppThemeBinding Light={StaticResource TexteSombre}, Dark={StaticResource TexteClair}}"/>
</Style>
<Style TargetType="Label" x:Key="TexteFrame">
<Setter Property="TextColor" Value="{AppThemeBinding Light={StaticResource Black}, Dark={StaticResource Black}}"/>
<Setter Property="FontSize" Value="20"/>
</Style>
<Style TargetType="Label" x:Key="TexteTitre">
<Setter Property="FontSize" Value="70"/>
<Setter Property="HorizontalOptions" Value="Center"/>
<Setter Property="Margin" Value="0,10,0,10"/>
</Style> </Style>
<Style TargetType="Button"> <Style TargetType="Button">
<Setter Property="TextColor" Value="{AppThemeBinding Light={StaticResource Black}, Dark={StaticResource Violet}}"/> <Setter Property="TextColor" Value="{AppThemeBinding Light={StaticResource TexteSombre}, Dark={StaticResource TexteClair}}"/>
<Setter Property="BackgroundColor" Value="{AppThemeBinding Light={StaticResource LightSaumon}, Dark={StaticResource Bordeaux}}" /> <Setter Property="BackgroundColor" Value="{AppThemeBinding Light={StaticResource FondSecondaireClair}, Dark={StaticResource FondSecondaireSombre}}" />
<Setter Property="FontSize" Value="Large"/> <Setter Property="FontSize" Value="Large"/>
<Setter Property="HeightRequest" Value="80"/> <Setter Property="HeightRequest" Value="80"/>
<Setter Property="Margin" Value="200, 0"/> <Setter Property="WidthRequest" Value="500"/>
</Style> </Style>
<Style TargetType="Frame"> <Style TargetType="Frame">
<Setter Property="BorderColor" Value="Black"/> <Setter Property="BorderColor" Value="Black"/>
<Setter Property="BackgroundColor" Value="{AppThemeBinding Light={StaticResource Peche}, Dark={StaticResource VertFonce}}"/>
</Style>
<Style TargetType="Entry">
<Setter Property="TextColor" Value="{AppThemeBinding Light={StaticResource Black}, Dark={StaticResource Vin}}"/>
</Style> </Style>
<Style TargetType="Button" x:Key="AccueilBouton"> <Style TargetType="Entry">
<Setter Property="HeightRequest" Value="150" /> <Setter Property="TextColor" Value="{AppThemeBinding Light={StaticResource TexteSombre}, Dark={StaticResource TexteClair}}"/>
<Setter Property="WidthRequest" Value="150" />
</Style>
<Style TargetType="Frame" x:Key="FrameTitrePage">
<Setter Property="BorderColor" Value="Black"/>
<Setter Property="BackgroundColor" Value="{AppThemeBinding Light={StaticResource LightYellow}, Dark={StaticResource LightPurple}}"/>
</Style> </Style>
<Style TargetType="ImageButton"> <Style TargetType="ImageButton">
<Setter Property="BackgroundColor" Value="Transparent"/> <Setter Property="MaximumWidthRequest" Value="150"/>
<Setter Property="BorderWidth" Value="0" /> <Setter Property="BackgroundColor" Value="{AppThemeBinding Light={StaticResource FondClair}, Dark={StaticResource FondSombre}}"/>
<Setter Property="BorderColor" Value="{AppThemeBinding Light={StaticResource FondClair}, Dark={StaticResource FondSombre}}"/>
</Style> </Style>
<Style TargetType="Border">
<Style TargetType="ImageButton" x:Key="ButtonFermeture"> <Setter Property="BackgroundColor" Value="{AppThemeBinding Light={StaticResource FondSecondaireClair}, Dark={StaticResource FondSecondaireSombre}}"/>
<Setter Property="WidthRequest" Value="50"/> <Setter Property="Stroke" Value="{AppThemeBinding Light={StaticResource BordureClair}, Dark={StaticResource BordureSombre}}"/>
<Setter Property="HeightRequest" Value="50"/>
<Setter Property="Source" Value="Fleche_Retour.png"/>
<Setter Property="Padding" Value="0"/>
<Setter Property="Margin" Value="5"/>
<Setter Property="BorderWidth" Value="0"/>
<Setter Property="CornerRadius" Value="8"/>
<Setter Property="Padding" Value="14,10"/>
<Setter Property="MinimumHeightRequest" Value="20"/>
<Setter Property="MinimumWidthRequest" Value="20"/>
<Setter Property="BackgroundColor" Value="{AppThemeBinding Light={StaticResource Pomme}, Dark={StaticResource DarkRed}}"/>
</Style> </Style>
<Style TargetType="Button" x:Key="ButtonTableau"> <Style TargetType="BoxView">
<Setter Property="BackgroundColor" Value="Transparent"/> <Setter Property="BackgroundColor" Value="{AppThemeBinding Light={StaticResource BordureClair}, Dark={StaticResource BordureSombre}}"/>
<Setter Property="BorderWidth" Value="0"/>
<Setter Property="CornerRadius" Value="8"/>
<Setter Property="Padding" Value="0"/>
<Setter Property="MinimumHeightRequest" Value="44"/>
<Setter Property="MinimumWidthRequest" Value="44"/>
<Setter Property="TextColor" Value="{AppThemeBinding Light={StaticResource Black}, Dark={StaticResource Black}}"/>
<Setter Property="FontSize" Value="25"/>
</Style> </Style>
</ResourceDictionary> </ResourceDictionary>

@ -0,0 +1,10 @@
<?xml version="1.0" encoding="utf-8" ?>
<ContentView xmlns="http://schemas.microsoft.com/dotnet/2021/maui"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
x:Class="MauiSpark.Vues.BoutonClassementVue"
x:Name="boutonClassementVue">
<ImageButton
Source="statistiques.png"
Clicked="QuandClassementClique"/>
</ContentView>

@ -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());
}
}

@ -0,0 +1,10 @@
<?xml version="1.0" encoding="utf-8" ?>
<ContentView xmlns="http://schemas.microsoft.com/dotnet/2021/maui"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
x:Class="MauiSpark.Vues.BoutonReglesVue"
x:Name="boutonReglesVue">
<ImageButton
Source="pointinterrogation.png"
Clicked="QuandReglesClique"/>
</ContentView>

@ -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());
}
}

@ -0,0 +1,16 @@
<?xml version="1.0" encoding="utf-8" ?>
<ContentView xmlns="http://schemas.microsoft.com/dotnet/2021/maui"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
x:Class="MauiSpark.Vues.JetonVue"
x:Name="jetonVue">
<Grid
x:Name="Grid"
SizeChanged="QuandTailleChangee">
<Ellipse
x:Name="Cercle"
Fill="{Binding Couleur, Source={x:Reference jetonVue}}"/>
</Grid>
</ContentView>

@ -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;
}
}
}

@ -0,0 +1,13 @@
<?xml version="1.0" encoding="utf-8" ?>
<ContentView xmlns="http://schemas.microsoft.com/dotnet/2021/maui"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
x:Class="MauiSpark.Vues.TitreVue"
x:Name="titreVue">
<Label
FontSize="Header"
Text="{Binding Texte, Source={x:Reference titreVue}}"
HorizontalTextAlignment="Center"
VerticalTextAlignment="Start"
Margin="10, 50"/>
</ContentView>

@ -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;
}
}

@ -14,6 +14,8 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "UnitTesting", "UnitTesting\
{341FB405-085D-4C34-B395-64EF0F9B93E0} = {341FB405-085D-4C34-B395-64EF0F9B93E0} {341FB405-085D-4C34-B395-64EF0F9B93E0} = {341FB405-085D-4C34-B395-64EF0F9B93E0}
EndProjectSection EndProjectSection
EndProject EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ConsoleApp1", "ConsoleApp1\ConsoleApp1.csproj", "{69A6F940-1A25-4FC0-83E3-ABEFA4003DD6}"
EndProject
Global Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU 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}.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.ActiveCfg = Release|Any CPU
{A2182054-C0D1-46D6-BD39-F3F7926CE2DD}.Release|Any CPU.Build.0 = 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 EndGlobalSection
GlobalSection(SolutionProperties) = preSolution GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE HideSolutionNode = FALSE

Loading…
Cancel
Save