DRAG AND DROP ESTIE BESTIE BABY
continuous-integration/drone/push Build is passing Details

test_old_branch
Jérémy Mouyon 11 months ago
parent 02a0fc8b65
commit bb59acaf57

@ -2,7 +2,6 @@ using QwirkleClassLibrary.Games;
using QwirkleClassLibrary.Players;
using QwirkleClassLibrary.Tiles;
using System.Collections.ObjectModel;
using WinRT;
namespace Qwirkle.Pages;
@ -14,8 +13,15 @@ public partial class Gameboard : ContentPage
{
InitializeComponent();
BindingContext = game;
DisplayAlert("List", ((App)App.Current!).Game.PlayerList[0].Tiles[0].ToString(), "chut");
}
public List<Tile> PlayerCells1 { get; set; } = ((App)App.Current!).Game.PlayerList[0].Tiles.ToList();
void OnDragOver(object sender, DragEventArgs e)
{
}
}

@ -7,7 +7,7 @@
x:Name="root">
<ScrollView>
<StackLayout>
<CollectionView ItemsSource="{Binding GetCellsInBoard}"
HorizontalOptions="Center"
@ -18,14 +18,43 @@
</CollectionView.ItemsLayout>
<CollectionView.ItemTemplate>
<DataTemplate>
<Border WidthRequest="70" HeightRequest="70"
BackgroundColor="WhiteSmoke"
Margin="0">
<Label Text="{Binding Tile}"></Label>
<Border.GestureRecognizers>
<DropGestureRecognizer />
</Border.GestureRecognizers>
</Border>
</DataTemplate>
</CollectionView.ItemTemplate>
</CollectionView>
<CollectionView ItemsSource="{Binding PlayerCells1, Source={x:Reference root}}"
HorizontalOptions="Center"
VerticalOptions="Start" >
<CollectionView.ItemsLayout>
<GridItemsLayout Orientation="Horizontal"/>
</CollectionView.ItemsLayout>
<CollectionView.ItemTemplate>
<DataTemplate>
<Border WidthRequest="70" HeightRequest="70"
BackgroundColor="WhiteSmoke"
Margin="0">
<Label Text="{Binding}">
<Label.GestureRecognizers>
<DragGestureRecognizer />
</Label.GestureRecognizers>
</Label>
</Border>
</DataTemplate>
</CollectionView.ItemTemplate>
</CollectionView>
</StackLayout>

@ -50,6 +50,9 @@ public partial class SetPlayers : ContentPage
if (game.AddPlayerInGame(playerstag))
{
game.StartGame();
game.GiveTilesToPlayers();
game.SetNextPlayer();
Navigation.PushAsync(new Gameboard());
}

Loading…
Cancel
Save