From 3a2eee23b67fb32b8888eaeee9e6ae01a78e9873 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9mi?= Date: Fri, 31 May 2024 15:31:56 +0200 Subject: [PATCH] =?UTF-8?q?D=C3=A9part=20de=20stub=20pour=20le=20leaderboa?= =?UTF-8?q?rd?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- source/Trek-12/Models/Game/Player.cs | 16 +++- source/Trek-12/Stub/Stub.cs | 29 ++++++ source/Trek-12/Stub/Stub.csproj | 13 +++ source/Trek-12/Trek-12.sln | 6 ++ .../Views/Components/ContentLeaderBoard.xaml | 0 .../Components/ContentLeaderBoard.xaml.cs | 0 .../Views/Components/viewsProfils.xaml | 0 .../Views/Components/viewsProfils.xaml.cs | 0 .../Views/PageLeaderBoard.xaml | 95 +++++++++++-------- .../Views/PageLeaderBoard.xaml.cs | 19 ++-- .../Views/PageMenuPrincipal.xaml | 0 .../Views/PageMenuPrincipal.xaml.cs | 0 .../{ => Resources}/Views/pageProfils.xaml | 0 .../{ => Resources}/Views/pageProfils.xaml.cs | 0 .../{ => Resources}/Views/pageRegles.xaml | 0 .../{ => Resources}/Views/pageRegles.xaml.cs | 0 source/Trek-12/Trek-12/Trek-12.csproj | 18 ++-- 17 files changed, 136 insertions(+), 60 deletions(-) create mode 100644 source/Trek-12/Stub/Stub.cs create mode 100644 source/Trek-12/Stub/Stub.csproj rename source/Trek-12/Trek-12/{ => Resources}/Views/Components/ContentLeaderBoard.xaml (100%) rename source/Trek-12/Trek-12/{ => Resources}/Views/Components/ContentLeaderBoard.xaml.cs (100%) rename source/Trek-12/Trek-12/{ => Resources}/Views/Components/viewsProfils.xaml (100%) rename source/Trek-12/Trek-12/{ => Resources}/Views/Components/viewsProfils.xaml.cs (100%) rename source/Trek-12/Trek-12/{ => Resources}/Views/PageLeaderBoard.xaml (76%) rename source/Trek-12/Trek-12/{ => Resources}/Views/PageLeaderBoard.xaml.cs (60%) rename source/Trek-12/Trek-12/{ => Resources}/Views/PageMenuPrincipal.xaml (100%) rename source/Trek-12/Trek-12/{ => Resources}/Views/PageMenuPrincipal.xaml.cs (100%) rename source/Trek-12/Trek-12/{ => Resources}/Views/pageProfils.xaml (100%) rename source/Trek-12/Trek-12/{ => Resources}/Views/pageProfils.xaml.cs (100%) rename source/Trek-12/Trek-12/{ => Resources}/Views/pageRegles.xaml (100%) rename source/Trek-12/Trek-12/{ => Resources}/Views/pageRegles.xaml.cs (100%) diff --git a/source/Trek-12/Models/Game/Player.cs b/source/Trek-12/Models/Game/Player.cs index f363eb4..9ac6b8a 100644 --- a/source/Trek-12/Models/Game/Player.cs +++ b/source/Trek-12/Models/Game/Player.cs @@ -1,10 +1,12 @@ -namespace Models.Game +using System.ComponentModel; + +namespace Models.Game { /// /// Represents a player in the game. /// - public class Player + public class Player : INotifyPropertyChanged { /// /// It is he pseudo of the player. @@ -46,6 +48,16 @@ ProfilePicture = profilePicture; } + public event PropertyChangedEventHandler? PropertyChanged; + + void OnPropertyChanged(string propertyName) + { + if (PropertyChanged != null) + { + PropertyChanged(this, new PropertyChangedEventArgs(propertyName)); + } + } + /// /// Chooses the operation for the player. /// diff --git a/source/Trek-12/Stub/Stub.cs b/source/Trek-12/Stub/Stub.cs new file mode 100644 index 0000000..03b7013 --- /dev/null +++ b/source/Trek-12/Stub/Stub.cs @@ -0,0 +1,29 @@ +using System.Collections.ObjectModel; +using System.Data; +using System.Numerics; +using Models.Game; + +namespace Stub +{ + public class Stub + { + public ReadOnlyObservableCollection ListPlayer { get; private set; } + private readonly ObservableCollection listplayer = new ObservableCollection(); + + public Stub() + { + LoadPlayer(); + ListPlayer = new ReadOnlyObservableCollection(listplayer); + } + + public void LoadPlayer() + { + + listplayer.Add(new Player()); + listplayer.Add(new Player("Lucas")); + listplayer.Add(new Player("relavergne")); + listplayer.Add(new Player("reneveu")); + + } + } +} diff --git a/source/Trek-12/Stub/Stub.csproj b/source/Trek-12/Stub/Stub.csproj new file mode 100644 index 0000000..8dcc508 --- /dev/null +++ b/source/Trek-12/Stub/Stub.csproj @@ -0,0 +1,13 @@ + + + + net8.0 + enable + enable + + + + + + + diff --git a/source/Trek-12/Trek-12.sln b/source/Trek-12/Trek-12.sln index fda4705..4ce1243 100644 --- a/source/Trek-12/Trek-12.sln +++ b/source/Trek-12/Trek-12.sln @@ -13,6 +13,8 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Tests", "Tests\Tests.csproj EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "DataContractPersistence", "DataContractPersistence\DataContractPersistence.csproj", "{FC6A23C3-A1E3-4BF4-85B0-404D8574E190}" EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Stub", "Stub\Stub.csproj", "{49360F7D-C59D-4B4F-AF5A-73FF61D9EF9B}" +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU @@ -41,6 +43,10 @@ Global {FC6A23C3-A1E3-4BF4-85B0-404D8574E190}.Debug|Any CPU.Build.0 = Debug|Any CPU {FC6A23C3-A1E3-4BF4-85B0-404D8574E190}.Release|Any CPU.ActiveCfg = Release|Any CPU {FC6A23C3-A1E3-4BF4-85B0-404D8574E190}.Release|Any CPU.Build.0 = Release|Any CPU + {49360F7D-C59D-4B4F-AF5A-73FF61D9EF9B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {49360F7D-C59D-4B4F-AF5A-73FF61D9EF9B}.Debug|Any CPU.Build.0 = Debug|Any CPU + {49360F7D-C59D-4B4F-AF5A-73FF61D9EF9B}.Release|Any CPU.ActiveCfg = Release|Any CPU + {49360F7D-C59D-4B4F-AF5A-73FF61D9EF9B}.Release|Any CPU.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE diff --git a/source/Trek-12/Trek-12/Views/Components/ContentLeaderBoard.xaml b/source/Trek-12/Trek-12/Resources/Views/Components/ContentLeaderBoard.xaml similarity index 100% rename from source/Trek-12/Trek-12/Views/Components/ContentLeaderBoard.xaml rename to source/Trek-12/Trek-12/Resources/Views/Components/ContentLeaderBoard.xaml diff --git a/source/Trek-12/Trek-12/Views/Components/ContentLeaderBoard.xaml.cs b/source/Trek-12/Trek-12/Resources/Views/Components/ContentLeaderBoard.xaml.cs similarity index 100% rename from source/Trek-12/Trek-12/Views/Components/ContentLeaderBoard.xaml.cs rename to source/Trek-12/Trek-12/Resources/Views/Components/ContentLeaderBoard.xaml.cs diff --git a/source/Trek-12/Trek-12/Views/Components/viewsProfils.xaml b/source/Trek-12/Trek-12/Resources/Views/Components/viewsProfils.xaml similarity index 100% rename from source/Trek-12/Trek-12/Views/Components/viewsProfils.xaml rename to source/Trek-12/Trek-12/Resources/Views/Components/viewsProfils.xaml diff --git a/source/Trek-12/Trek-12/Views/Components/viewsProfils.xaml.cs b/source/Trek-12/Trek-12/Resources/Views/Components/viewsProfils.xaml.cs similarity index 100% rename from source/Trek-12/Trek-12/Views/Components/viewsProfils.xaml.cs rename to source/Trek-12/Trek-12/Resources/Views/Components/viewsProfils.xaml.cs diff --git a/source/Trek-12/Trek-12/Views/PageLeaderBoard.xaml b/source/Trek-12/Trek-12/Resources/Views/PageLeaderBoard.xaml similarity index 76% rename from source/Trek-12/Trek-12/Views/PageLeaderBoard.xaml rename to source/Trek-12/Trek-12/Resources/Views/PageLeaderBoard.xaml index fb1dff7..4420404 100644 --- a/source/Trek-12/Trek-12/Views/PageLeaderBoard.xaml +++ b/source/Trek-12/Trek-12/Resources/Views/PageLeaderBoard.xaml @@ -1,43 +1,54 @@ - - - - - - - - - - - - - - - -