Départ de stub pour le leaderboard
continuous-integration/drone/push Build is passing Details

pull/94/head
Remi NEVEU 11 months ago
parent 2f8923cc0e
commit 3a2eee23b6

@ -1,10 +1,12 @@
namespace Models.Game using System.ComponentModel;
namespace Models.Game
{ {
/// <summary> /// <summary>
/// Represents a player in the game. /// Represents a player in the game.
/// </summary> /// </summary>
public class Player public class Player : INotifyPropertyChanged
{ {
/// <summary> /// <summary>
/// It is he pseudo of the player. /// It is he pseudo of the player.
@ -46,6 +48,16 @@
ProfilePicture = profilePicture; ProfilePicture = profilePicture;
} }
public event PropertyChangedEventHandler? PropertyChanged;
void OnPropertyChanged(string propertyName)
{
if (PropertyChanged != null)
{
PropertyChanged(this, new PropertyChangedEventArgs(propertyName));
}
}
/// <summary> /// <summary>
/// Chooses the operation for the player. /// Chooses the operation for the player.
/// </summary> /// </summary>

@ -0,0 +1,29 @@
using System.Collections.ObjectModel;
using System.Data;
using System.Numerics;
using Models.Game;
namespace Stub
{
public class Stub
{
public ReadOnlyObservableCollection<Player> ListPlayer { get; private set; }
private readonly ObservableCollection<Player> listplayer = new ObservableCollection<Player>();
public Stub()
{
LoadPlayer();
ListPlayer = new ReadOnlyObservableCollection<Player>(listplayer);
}
public void LoadPlayer()
{
listplayer.Add(new Player());
listplayer.Add(new Player("Lucas"));
listplayer.Add(new Player("relavergne"));
listplayer.Add(new Player("reneveu"));
}
}
}

@ -0,0 +1,13 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>net8.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
</PropertyGroup>
<ItemGroup>
<ProjectReference Include="..\Models\Models.csproj" />
</ItemGroup>
</Project>

@ -13,6 +13,8 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Tests", "Tests\Tests.csproj
EndProject EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "DataContractPersistence", "DataContractPersistence\DataContractPersistence.csproj", "{FC6A23C3-A1E3-4BF4-85B0-404D8574E190}" Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "DataContractPersistence", "DataContractPersistence\DataContractPersistence.csproj", "{FC6A23C3-A1E3-4BF4-85B0-404D8574E190}"
EndProject EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Stub", "Stub\Stub.csproj", "{49360F7D-C59D-4B4F-AF5A-73FF61D9EF9B}"
EndProject
Global Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU 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}.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.ActiveCfg = Release|Any CPU
{FC6A23C3-A1E3-4BF4-85B0-404D8574E190}.Release|Any CPU.Build.0 = 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 EndGlobalSection
GlobalSection(SolutionProperties) = preSolution GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE HideSolutionNode = FALSE

@ -1,43 +1,54 @@
<?xml version="1.0" encoding="utf-8" ?> <?xml version="1.0" encoding="utf-8" ?>
<ContentPage xmlns="http://schemas.microsoft.com/dotnet/2021/maui" <ContentPage xmlns="http://schemas.microsoft.com/dotnet/2021/maui"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml" xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
xmlns:views="clr-namespace:Trek_12.Views.Components" xmlns:views="clr-namespace:Trek_12.Views.Components"
x:Class="Trek_12.Views.PageLeaderBoard" x:Class="Trek_12.Views.PageLeaderBoard"
Title="PageLeaderBoard"> Title="PageLeaderBoard">
<Grid BackgroundColor="BlanchedAlmond"
RowDefinitions="auto,6*,*">
<VerticalStackLayout> <Grid BackgroundColor="BlanchedAlmond"
<Label RowDefinitions="auto,6*,*">
Text="Leader board"
VerticalOptions="Center"
HorizontalOptions="Center" <VerticalStackLayout>
FontSize="Title"/> <Label
<BoxView Text="Leader board"
Color="DarkSalmon" VerticalOptions="Center"
HeightRequest="1" HorizontalOptions="Center"
WidthRequest="125"/> FontSize="Title"/>
</VerticalStackLayout> <BoxView
<ScrollView Grid.Row="1" Color="DarkSalmon"
VerticalOptions="FillAndExpand" HeightRequest="1"
VerticalScrollBarVisibility="Never" WidthRequest="125"/>
Margin="0,10"> </VerticalStackLayout>
<VerticalStackLayout>
<views:ContentLeaderBoard/>
<views:ContentLeaderBoard/>
<views:ContentLeaderBoard/> <ScrollView Grid.Row="1"
<views:ContentLeaderBoard/> VerticalOptions="FillAndExpand"
<views:ContentLeaderBoard/> VerticalScrollBarVisibility="Never"
<views:ContentLeaderBoard/> Margin="0,10">
</VerticalStackLayout>
</ScrollView>
<Button Text="Back" <CollectionView ItemsSource="{Binding ListPlayer}">
BackgroundColor="OliveDrab" <CollectionView.ItemTemplate>
FontSize="Title" <DataTemplate>
Grid.Row="2" <Label Text="{Binding Pseudo}"/>
HorizontalOptions="Start" </DataTemplate>
CornerRadius="20" </CollectionView.ItemTemplate>
WidthRequest="150" </CollectionView>
HeightRequest="75"
Margin="10"/> </ScrollView>
</Grid>
<Button Text="Back"
BackgroundColor="OliveDrab"
FontSize="Title"
Grid.Row="2"
HorizontalOptions="Start"
CornerRadius="20"
WidthRequest="150"
HeightRequest="75"
Margin="10"/>
</Grid>
</ContentPage> </ContentPage>

@ -1,9 +1,12 @@
namespace Trek_12.Views; namespace Trek_12.Views;
using Stub;
public partial class PageLeaderBoard : ContentPage
{ public partial class PageLeaderBoard : ContentPage
public PageLeaderBoard() {
{ public Stub MyStub { get; set; } = new Stub();
InitializeComponent(); public PageLeaderBoard()
} {
InitializeComponent();
BindingContext = MyStub;
}
} }

@ -64,27 +64,29 @@
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<Compile Update="Views\PageLeaderBoard.xaml.cs"> <ProjectReference Include="..\Models\Models.csproj" />
<ProjectReference Include="..\Stub\Stub.csproj" />
</ItemGroup>
<ItemGroup>
<Compile Update="Resources\Views\PageLeaderBoard.xaml.cs">
<DependentUpon>PageLeaderBoard.xaml</DependentUpon> <DependentUpon>PageLeaderBoard.xaml</DependentUpon>
</Compile> </Compile>
<Compile Update="Views\pageProfils.xaml.cs"> <Compile Update="Resources\Views\pageProfils.xaml.cs">
<DependentUpon>PageProfils.xaml</DependentUpon> <DependentUpon>PageProfils.xaml</DependentUpon>
</Compile> </Compile>
<Compile Update="Views\pageRegles.xaml.cs"> <Compile Update="Resources\Views\pageRegles.xaml.cs">
<DependentUpon>PageRegles.xaml</DependentUpon> <DependentUpon>PageRegles.xaml</DependentUpon>
</Compile> </Compile>
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<MauiXaml Update="Views\Components\ContentLeaderBoard.xaml"> <MauiXaml Update="Resources\Views\Components\ContentLeaderBoard.xaml">
<Generator>MSBuild:Compile</Generator> <Generator>MSBuild:Compile</Generator>
</MauiXaml> </MauiXaml>
<MauiXaml Update="Views\PageLeaderBoard.xaml"> <MauiXaml Update="Resources\Views\PageLeaderBoard.xaml">
<Generator>MSBuild:Compile</Generator> <Generator>MSBuild:Compile</Generator>
</MauiXaml> </MauiXaml>
<MauiXaml Update="Views\PageConnexion.xaml">
<Generator>MSBuild:Compile</Generator>
</MauiXaml>
</ItemGroup> </ItemGroup>
</Project> </Project>

Loading…
Cancel
Save