leaderboard !!
continuous-integration/drone/push Build is failing Details

old_branch_before_remy
Jérémy Mouyon 11 months ago
parent b9183452ec
commit 9d482d7373

@ -41,7 +41,7 @@ namespace QwirkleClassLibrary.Tiles
} }
}*/ }*/
Tile t1 = new Tile(Shape.Club, Color.Red); Tile t1 = new Tile(Shape.Club, Color.Yellow);
Tile t2 = new Tile(Shape.Round, Color.Orange); Tile t2 = new Tile(Shape.Round, Color.Orange);
tiles.Add(t1); tiles.Add(t1);

@ -17,7 +17,7 @@ namespace Qwirkle.Converters
if (colorstring == "Red") return Colors.Red; if (colorstring == "Red") return Colors.Red;
if (colorstring == "Blue") return Colors.Blue; if (colorstring == "Blue") return Colors.Blue;
if (colorstring == "Green") return Colors.Green; if (colorstring == "Green") return Colors.Green;
if (colorstring == "Orange") return Colors.OrangeRed; if (colorstring == "Orange") return Colors.Orange;
if (colorstring == "Purple") return Colors.Purple; if (colorstring == "Purple") return Colors.Purple;
if (colorstring == "Transparent") return Colors.Transparent; if (colorstring == "Transparent") return Colors.Transparent;

@ -28,7 +28,7 @@
<Border WidthRequest="80" HeightRequest="80" <Border WidthRequest="80" HeightRequest="80"
BackgroundColor="WhiteSmoke" BackgroundColor="Transparent"
Margin="0" > Margin="0" >
<Border.GestureRecognizers > <Border.GestureRecognizers >
<DropGestureRecognizer DragOver="OnDragOverBag" <DropGestureRecognizer DragOver="OnDragOverBag"

@ -3,8 +3,9 @@
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml" xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
x:Class="Qwirkle.Pages.Leaderboard" x:Class="Qwirkle.Pages.Leaderboard"
xmlns:controls="clr-namespace:Qwirkle.Views" xmlns:controls="clr-namespace:Qwirkle.Views"
Title="Leaderboard"> Title="Leaderboard"
x:Name="root">
<ScrollView> <ScrollView>
<VerticalStackLayout Spacing="25" Padding="5, 5, 5, 10"> <VerticalStackLayout Spacing="25" Padding="5, 5, 5, 10">
<Grid Style="{StaticResource GridMain}"> <Grid Style="{StaticResource GridMain}">
@ -24,60 +25,47 @@
<StackLayout> <StackLayout>
<Grid ColumnDefinitions="4*, auto, 2*, auto, 2*, auto, 2*" <Grid ColumnDefinitions="4*, auto, 2*, auto, 2*, auto, 2*"
RowDefinitions="50"> RowDefinitions="50">
<Label <Label
Text="Player tag" Text="Player tag"
Style="{StaticResource ContentTab}" Style="{StaticResource ContentTab}"/>
/>
<Rectangle <Rectangle
Style="{StaticResource RectangleTab}" Style="{StaticResource RectangleTab}"
Grid.Column="1"/> Grid.Column="1"/>
<Label <Label
Grid.Column="2" Grid.Column="2"
Text="Date" Text="Date"
Style="{StaticResource ContentTab}"/> Style="{StaticResource ContentTab}"/>
<Rectangle <Rectangle
Style="{StaticResource RectangleTab}" Style="{StaticResource RectangleTab}"
Grid.Column="3"/> Grid.Column="3"/>
<Label <Label
Grid.Column="4" Grid.Column="4"
Text="Points" Text="Points"
Style="{StaticResource ContentTab}"/> Style="{StaticResource ContentTab}"/>
<Rectangle <Rectangle
Style="{StaticResource RectangleTab}" Style="{StaticResource RectangleTab}"
Grid.Column="5"/> Grid.Column="5"/>
<Label <Label
Grid.Column="6" Grid.Column="6"
Style="{StaticResource ContentTab}" Style="{StaticResource ContentTab}"
Text="Victories" Text="Victories"/>
/>
</Grid> </Grid>
<CollectionView ItemsSource="{Binding Lb}"> <CollectionView ItemsSource="{Binding Lb}">
<CollectionView.ItemsLayout> <CollectionView.ItemsLayout>
<GridItemsLayout Orientation="Vertical"/> <GridItemsLayout Orientation="Vertical"/>
</CollectionView.ItemsLayout> </CollectionView.ItemsLayout>
<CollectionView.ItemTemplate> <CollectionView.ItemTemplate>
<DataTemplate> <DataTemplate>
<controls:LeaderboardLine Name="{Binding Score.PlayerName}"></controls:LeaderboardLine> <controls:LeaderboardLine PlayerName="{Binding PlayerName}" Date="{Binding Date}" Points="{Binding Points}" Victories="{Binding Victories}" />
</DataTemplate> </DataTemplate>
</CollectionView.ItemTemplate> </CollectionView.ItemTemplate>
</CollectionView> </CollectionView>
</StackLayout> </StackLayout>
</Border> </Border>
</VerticalStackLayout> </VerticalStackLayout>
</ScrollView> </ScrollView>
</ContentPage>
</ContentPage>

@ -6,6 +6,5 @@ public partial class Leaderboard : ContentPage
{ {
InitializeComponent(); InitializeComponent();
BindingContext = ((App)Application.Current!).LD; BindingContext = ((App)Application.Current!).LD;
} }
} }

@ -1,42 +1,42 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<ContentView xmlns="http://schemas.microsoft.com/dotnet/2021/maui" <ContentView 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"
x:Class="Qwirkle.Views.LeaderboardLine"> x:Class="Qwirkle.Views.LeaderboardLine"
x:Name="root">
<Grid ColumnDefinitions="4*, auto, 2*, auto, 2*, auto, 2*" <Grid ColumnDefinitions="4*, auto, 2*, auto, 2*, auto, 2*"
RowDefinitions="50"> RowDefinitions="50">
<Label <Label
Text="{Binding Name}" Text="{Binding PlayerName}"
Style="{StaticResource ContentTab}" Style="{StaticResource ContentTab}"/>
/>
<Rectangle <Rectangle
Style="{StaticResource RectangleTab}" Style="{StaticResource RectangleTab}"
Grid.Column="1"/> Grid.Column="1"/>
<Label <Label
Grid.Column="2" Grid.Column="2"
Text="Date" Text="{Binding Date, StringFormat='{0:MM/dd/yyyy}'}"
Style="{StaticResource ContentTab}"/> Style="{StaticResource ContentTab}"/>
<Rectangle <Rectangle
Style="{StaticResource RectangleTab}" Style="{StaticResource RectangleTab}"
Grid.Column="3"/> Grid.Column="3"/>
<Label <Label
Grid.Column="4" Grid.Column="4"
Text="Points" Text="{Binding Points}"
Style="{StaticResource ContentTab}"/> Style="{StaticResource ContentTab}"/>
<Rectangle <Rectangle
Style="{StaticResource RectangleTab}" Style="{StaticResource RectangleTab}"
Grid.Column="5"/> Grid.Column="5"/>
<Label <Label
Grid.Column="6" Grid.Column="6"
Style="{StaticResource ContentTab}" Style="{StaticResource ContentTab}"
Text="Victories" Text="{Binding Victories}"/>
/>
</Grid> </Grid>
</ContentView> </ContentView>

@ -3,23 +3,51 @@ using System.Collections.Generic;
using System.Linq; using System.Linq;
using System.Text; using System.Text;
using System.Threading.Tasks; using System.Threading.Tasks;
using Microsoft.Maui.Controls;
namespace Qwirkle.Views; namespace Qwirkle.Views
public partial class LeaderboardLine : ContentView
{ {
public LeaderboardLine() public partial class LeaderboardLine : ContentView
{ {
InitializeComponent(); public LeaderboardLine()
BindingContext = this; {
} InitializeComponent();
}
public static readonly BindableProperty NameProperty = public static readonly BindableProperty PlayerNameProperty =
BindableProperty.Create(nameof(Name), typeof(string), typeof(LeaderboardLine), ""); BindableProperty.Create(nameof(PlayerName), typeof(string), typeof(LeaderboardLine), "");
public string Name public static readonly BindableProperty DateProperty =
{ BindableProperty.Create(nameof(Date), typeof(DateTime), typeof(LeaderboardLine), default(DateTime));
get => (string)GetValue(NameProperty);
set => SetValue(NameProperty, value); public static readonly BindableProperty PointsProperty =
BindableProperty.Create(nameof(Points), typeof(int), typeof(LeaderboardLine), 0);
public static readonly BindableProperty VictoriesProperty =
BindableProperty.Create(nameof(Victories), typeof(int), typeof(LeaderboardLine), 0);
public string PlayerName
{
get => (string)GetValue(PlayerNameProperty);
set => SetValue(PlayerNameProperty, value);
}
public DateTime Date
{
get => (DateTime)GetValue(DateProperty);
set => SetValue(DateProperty, value);
}
public int Points
{
get => (int)GetValue(PointsProperty);
set => SetValue(PointsProperty, value);
}
public int Victories
{
get => (int)GetValue(VictoriesProperty);
set => SetValue(VictoriesProperty, value);
}
} }
} }

Loading…
Cancel
Save