diff --git a/Sources/CoreLibrary/Manager/Manager.cs b/Sources/CoreLibrary/Manager/Manager.cs index 55ad615..48ec4af 100644 --- a/Sources/CoreLibrary/Manager/Manager.cs +++ b/Sources/CoreLibrary/Manager/Manager.cs @@ -1,4 +1,5 @@ using CoreLibrary.Joueurs; +using CoreLibrary; using CoreLibrary.Regles; namespace CoreLibrary.Manager @@ -8,6 +9,14 @@ namespace CoreLibrary.Manager private Joueur[] joueurs = []; public IReadOnlyList Joueurs => Array.AsReadOnly(joueurs); + + public Partie Partie { get; private set; } + + public Manager() + { + Partie = new Partie(new ReglesClassiques()); + } + public void Charger() { joueurs = [ diff --git a/Sources/CoreLibrary/Partie.cs b/Sources/CoreLibrary/Partie.cs index c56a8bd..0699b67 100644 --- a/Sources/CoreLibrary/Partie.cs +++ b/Sources/CoreLibrary/Partie.cs @@ -10,7 +10,7 @@ namespace CoreLibrary /// public class Partie { - private readonly IRegles regles; + public IRegles Regles { get; private set; } /// diff --git a/Sources/MauiSpark/AppShell.xaml b/Sources/MauiSpark/AppShell.xaml index 7242e6c..02ae22b 100644 --- a/Sources/MauiSpark/AppShell.xaml +++ b/Sources/MauiSpark/AppShell.xaml @@ -37,4 +37,8 @@ Title="Egalite" ContentTemplate="{DataTemplate pages:Egalite}" /> + + diff --git a/Sources/MauiSpark/MauiProgram.cs b/Sources/MauiSpark/MauiProgram.cs index be3b5b2..bcd04ec 100644 --- a/Sources/MauiSpark/MauiProgram.cs +++ b/Sources/MauiSpark/MauiProgram.cs @@ -1,4 +1,5 @@ -using CoreLibrary.Manager; +using CoreLibrary.Events; +using CoreLibrary.Manager; using Microsoft.Extensions.Logging; namespace MauiSpark @@ -10,6 +11,9 @@ namespace MauiSpark public static MauiApp CreateMauiApp() { Manager.Charger(); + Manager.Partie.Jouer(); + + Manager.Partie.DemanderJoueur += (Object? sender, DemanderJoueurEventArgs e) => null; var builder = MauiApp.CreateBuilder(); builder diff --git a/Sources/MauiSpark/Pages/Plateau.xaml b/Sources/MauiSpark/Pages/Plateau.xaml index 2ffcd6c..9b21f98 100644 --- a/Sources/MauiSpark/Pages/Plateau.xaml +++ b/Sources/MauiSpark/Pages/Plateau.xaml @@ -3,9 +3,36 @@ xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml" x:Class="MauiSpark.Pages.Plateau" Title="Plateau"> - - - - - + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/Sources/MauiSpark/Pages/Plateau.xaml.cs b/Sources/MauiSpark/Pages/Plateau.xaml.cs index 8ed32c8..dfd0f0c 100644 --- a/Sources/MauiSpark/Pages/Plateau.xaml.cs +++ b/Sources/MauiSpark/Pages/Plateau.xaml.cs @@ -1,3 +1,6 @@ +using CoreLibrary.Events; +using CoreLibrary.Manager; + namespace MauiSpark.Pages; public partial class Plateau : ContentPage @@ -5,5 +8,10 @@ public partial class Plateau : ContentPage public Plateau() { InitializeComponent(); - } + } + + public void NouveauTour(Object? sender, NouveauTourEventArgs e) + { + BindingContext = e; + } } \ No newline at end of file