|
|
|
@ -9,40 +9,51 @@ using QwirkleClassLibrary.Players;
|
|
|
|
|
using QwirkleClassLibrary.Tiles;
|
|
|
|
|
using QwirkleClassLibrary.Events;
|
|
|
|
|
using QwirkleClassLibrary.Boards;
|
|
|
|
|
using System.Globalization;
|
|
|
|
|
|
|
|
|
|
namespace Qwirkle.Views;
|
|
|
|
|
|
|
|
|
|
public partial class TileCircle : ContentView
|
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
public static readonly BindableProperty TileInfoProperty = BindableProperty.Create(nameof(TileInfo), typeof(Tile), typeof(TileCircle), default(Tile));
|
|
|
|
|
|
|
|
|
|
public Tile TileInfo
|
|
|
|
|
{
|
|
|
|
|
get => (Tile)GetValue(TileInfoProperty);
|
|
|
|
|
set => SetValue(TileInfoProperty, value);
|
|
|
|
|
}
|
|
|
|
|
public TileCircle()
|
|
|
|
|
{
|
|
|
|
|
InitializeComponent();
|
|
|
|
|
((App)Application.Current!).Game.Board.PropertyChanged += Board_PropertyChanged;
|
|
|
|
|
ColorPush = "Transparent";
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private void Board_PropertyChanged(object? sender, System.ComponentModel.PropertyChangedEventArgs e)
|
|
|
|
|
{
|
|
|
|
|
if (TileInfo == null)
|
|
|
|
|
Console.WriteLine(Shape);
|
|
|
|
|
if (Shape == "Round")
|
|
|
|
|
{
|
|
|
|
|
return;
|
|
|
|
|
ColorPush = Color;
|
|
|
|
|
}
|
|
|
|
|
Shape = TileInfo.GetShape.ToString();
|
|
|
|
|
if (Shape != "Round")
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
return;
|
|
|
|
|
ColorPush = "Transparent";
|
|
|
|
|
}
|
|
|
|
|
Color = TileInfo.GetColor.ToString();
|
|
|
|
|
BC = "Grey300";
|
|
|
|
|
}
|
|
|
|
|
public string BC { get; set; } = "Transparent";
|
|
|
|
|
public string Color { get; set; } = "Transparent";
|
|
|
|
|
public string Shape { get; set; } = "None";
|
|
|
|
|
|
|
|
|
|
public static readonly BindableProperty ColorProperty =
|
|
|
|
|
BindableProperty.Create("Color", typeof(string), typeof(TileCircle), "");
|
|
|
|
|
|
|
|
|
|
public string Color
|
|
|
|
|
{
|
|
|
|
|
get => (string)GetValue(ColorProperty);
|
|
|
|
|
set => SetValue(ColorProperty, value);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public static readonly BindableProperty ShapeProperty =
|
|
|
|
|
BindableProperty.Create("Shape", typeof(string), typeof(TileCircle), "");
|
|
|
|
|
|
|
|
|
|
public string Shape
|
|
|
|
|
{
|
|
|
|
|
get => (string)GetValue(ShapeProperty);
|
|
|
|
|
set => SetValue(ShapeProperty, value);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public string? ColorPush { get; set; }
|
|
|
|
|
}
|