commit
68841cdc92
File diff suppressed because it is too large
Load Diff
@ -0,0 +1,17 @@
|
||||
<?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.IndicateurVue"
|
||||
x:Name="indicateurVue">
|
||||
|
||||
<Grid
|
||||
x:Name="Grid"
|
||||
SizeChanged="QuandTailleChangee"
|
||||
VerticalOptions="FillAndExpand"
|
||||
HorizontalOptions="FillAndExpand">
|
||||
<Rectangle
|
||||
x:Name="Carre"
|
||||
Fill="{Binding Couleur, Source={x:Reference indicateurVue}}">
|
||||
</Rectangle>
|
||||
</Grid>
|
||||
</ContentView>
|
@ -0,0 +1,28 @@
|
||||
using CoreLibrary.Core;
|
||||
using MauiSpark.Convertisseurs;
|
||||
using System.Globalization;
|
||||
|
||||
namespace MauiSpark.Vues;
|
||||
|
||||
public partial class IndicateurVue : ContentView
|
||||
{
|
||||
public static readonly BindableProperty CouleurProperty = BindableProperty.Create(nameof(Couleur), typeof(Color), typeof(IndicateurVue), default(Color));
|
||||
|
||||
public Color Couleur
|
||||
{
|
||||
get => (Color)GetValue(CouleurProperty);
|
||||
|
||||
set => SetValue(CouleurProperty, value);
|
||||
}
|
||||
public IndicateurVue()
|
||||
{
|
||||
InitializeComponent();
|
||||
BindingContext = this;
|
||||
}
|
||||
|
||||
private void QuandTailleChangee(object sender, EventArgs e)
|
||||
{
|
||||
double taille = Math.Min(Grid.Width, Grid.Height) / 2;
|
||||
Carre.WidthRequest = Carre.HeightRequest = taille;
|
||||
}
|
||||
}
|
@ -0,0 +1,11 @@
|
||||
<?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.ModeVue"
|
||||
x:Name="modeVue">
|
||||
|
||||
<Button
|
||||
Text="{Binding Regles.Nom, Source={x:Reference modeVue}}"
|
||||
Clicked="QuandReglesPresse"
|
||||
Margin="0, 50"/>
|
||||
</ContentView>
|
@ -0,0 +1,32 @@
|
||||
using CoreLibrary;
|
||||
using CoreLibrary.Regles;
|
||||
using MauiSpark.Pages;
|
||||
|
||||
namespace MauiSpark.Vues;
|
||||
|
||||
public partial class ModeVue : ContentView
|
||||
{
|
||||
public static readonly BindableProperty ReglesProperty = BindableProperty.Create(nameof(Regles), typeof(IRegles), typeof(ModeVue), null);
|
||||
|
||||
public IRegles Regles
|
||||
{
|
||||
get => (IRegles)GetValue(ReglesProperty);
|
||||
set => SetValue(ReglesProperty, value);
|
||||
}
|
||||
|
||||
public ModeVue()
|
||||
{
|
||||
InitializeComponent();
|
||||
}
|
||||
|
||||
private void QuandReglesPresse(Object sender, EventArgs e)
|
||||
{
|
||||
Partie partie = MauiProgram.Manageur.NouvellePartie(Regles);
|
||||
|
||||
partie.PartieDemanderJoueur += new ConnexionPage().QuandDemanderNom;
|
||||
partie.PartiePartieTerminee += new VictoirePage().QuandPartieTerminee;
|
||||
partie.PartieNouveauTour += new PlateauPage().QuandNouveauTour;
|
||||
|
||||
partie.Jouer();
|
||||
}
|
||||
}
|
Loading…
Reference in new issue