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);
tiles.Add(t1);

@ -17,7 +17,7 @@ namespace Qwirkle.Converters
if (colorstring == "Red") return Colors.Red;
if (colorstring == "Blue") return Colors.Blue;
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 == "Transparent") return Colors.Transparent;

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

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

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

@ -1,22 +1,23 @@
<?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="Qwirkle.Views.LeaderboardLine">
x:Class="Qwirkle.Views.LeaderboardLine"
x:Name="root">
<Grid ColumnDefinitions="4*, auto, 2*, auto, 2*, auto, 2*"
RowDefinitions="50">
<Label
Text="{Binding Name}"
Style="{StaticResource ContentTab}"
/>
Text="{Binding PlayerName}"
Style="{StaticResource ContentTab}"/>
<Rectangle
Style="{StaticResource RectangleTab}"
Grid.Column="1"/>
<Label
Grid.Column="2"
Text="Date"
Text="{Binding Date, StringFormat='{0:MM/dd/yyyy}'}"
Style="{StaticResource ContentTab}"/>
<Rectangle
@ -25,7 +26,7 @@
<Label
Grid.Column="4"
Text="Points"
Text="{Binding Points}"
Style="{StaticResource ContentTab}"/>
<Rectangle
@ -35,8 +36,7 @@
<Label
Grid.Column="6"
Style="{StaticResource ContentTab}"
Text="Victories"
/>
Text="{Binding Victories}"/>
</Grid>
</ContentView>

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