Ne fonctionne pas j'arrete pour ce soir - Amélioration design
continuous-integration/drone/push Build is failing
Details
continuous-integration/drone/push Build is failing
Details
parent
0f15fb0e16
commit
f05a0f997d
@ -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());
|
||||
}
|
||||
}
|
@ -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.Events;
|
||||
using CoreLibrary.Regles;
|
||||
|
||||
namespace MauiSpark.Pages;
|
||||
|
||||
public partial class Mode : ContentPage
|
||||
public partial class ModePage : ContentPage
|
||||
{
|
||||
public Mode()
|
||||
public ModePage()
|
||||
{
|
||||
NavigationPage.SetHasNavigationBar(this, false);
|
||||
|
||||
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.NouveauTour += new Plateau().QuandNouveauTour;
|
||||
partie.NouveauTour += new PlateauPage().QuandNouveauTour;
|
||||
partie.PartieTerminee += new Victoire().QuandPartieTerminee;
|
||||
|
||||
MauiProgram.Manageur.NouvellePartie(partie);
|
@ -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;
|
||||
}
|
||||
}
|
Loading…
Reference in new issue