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

@ -6,10 +6,10 @@
Title="Gameboard" Title="Gameboard"
x:Name="root"> x:Name="root">
<ScrollView> <ScrollView>
<StackLayout>
<CollectionView ItemsSource="{Binding GetCellsInBoard}" <CollectionView ItemsSource="{Binding GetCellsInBoard}"
HorizontalOptions="Center" HorizontalOptions="Center"
VerticalOptions="Center"> VerticalOptions="Center">
<CollectionView.ItemsLayout> <CollectionView.ItemsLayout>
@ -18,14 +18,43 @@
</CollectionView.ItemsLayout> </CollectionView.ItemsLayout>
<CollectionView.ItemTemplate> <CollectionView.ItemTemplate>
<DataTemplate> <DataTemplate>
<Border WidthRequest="70" HeightRequest="70"
<Border WidthRequest="70" HeightRequest="70"
BackgroundColor="WhiteSmoke" BackgroundColor="WhiteSmoke"
Margin="0"> Margin="0">
</Border> <Label Text="{Binding Tile}"></Label>
</DataTemplate> <Border.GestureRecognizers>
<DropGestureRecognizer />
</Border.GestureRecognizers>
</Border>
</DataTemplate>
</CollectionView.ItemTemplate> </CollectionView.ItemTemplate>
</CollectionView> </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)) if (game.AddPlayerInGame(playerstag))
{ {
game.StartGame();
game.GiveTilesToPlayers();
game.SetNextPlayer();
Navigation.PushAsync(new Gameboard()); Navigation.PushAsync(new Gameboard());
} }

Loading…
Cancel
Save