|
|
|
@ -9,24 +9,34 @@ using System.ComponentModel;
|
|
|
|
|
using Cell = QwirkleClassLibrary.Boards.Cell;
|
|
|
|
|
namespace Qwirkle.Pages;
|
|
|
|
|
|
|
|
|
|
public partial class Gameboard : ContentPage
|
|
|
|
|
public partial class Gameboard : ContentPage, INotifyPropertyChanged
|
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
public ICommand OnDrop => new Command<Cell>(OnDropTile);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
private Game game = ((App)Application.Current!).Game;
|
|
|
|
|
|
|
|
|
|
private Tile? tiledrag;
|
|
|
|
|
|
|
|
|
|
private ObservableCollection<Tile> playerCells1;
|
|
|
|
|
public ObservableCollection<Tile> PlayerCells1
|
|
|
|
|
{
|
|
|
|
|
get => playerCells1;
|
|
|
|
|
set
|
|
|
|
|
{
|
|
|
|
|
playerCells1 = value;
|
|
|
|
|
OnPropertyChanged(nameof(PlayerCells1));
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
public Gameboard()
|
|
|
|
|
{
|
|
|
|
|
InitializeComponent();
|
|
|
|
|
BindingContext = game;
|
|
|
|
|
|
|
|
|
|
DisplayAlert("List", ((App)Application.Current!).Game.PlayerList[0].Tiles[0].ToString(), "chut");
|
|
|
|
|
PlayerCells1 = new ObservableCollection<Tile>(game.PlayerList[0].Tiles.ToList());
|
|
|
|
|
|
|
|
|
|
DisplayAlert("List", playerCells1[0].ToString(), "chut");
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public List<Tile> PlayerCells1 { get; set; } = ((App)Application.Current!).Game.PlayerList[0].Tiles.ToList();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
private void OnDragOver(object sender, DragEventArgs e)
|
|
|
|
@ -59,4 +69,11 @@ public partial class Gameboard : ContentPage
|
|
|
|
|
{
|
|
|
|
|
DisplayAlert("Tile place notified", args.Reason, "<3");
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public event PropertyChangedEventHandler PropertyChanged;
|
|
|
|
|
|
|
|
|
|
protected virtual void OnPropertyChanged(string propertyName)
|
|
|
|
|
{
|
|
|
|
|
PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(propertyName));
|
|
|
|
|
}
|
|
|
|
|
}
|