|
|
@ -11,6 +11,7 @@ using Color = Microsoft.Maui.Graphics.Color;
|
|
|
|
using System.Drawing;
|
|
|
|
using System.Drawing;
|
|
|
|
using QwirkleClassLibrary.Persistences;
|
|
|
|
using QwirkleClassLibrary.Persistences;
|
|
|
|
using CommunityToolkit.Maui.Views;
|
|
|
|
using CommunityToolkit.Maui.Views;
|
|
|
|
|
|
|
|
using System.Diagnostics;
|
|
|
|
|
|
|
|
|
|
|
|
namespace Qwirkle.Pages;
|
|
|
|
namespace Qwirkle.Pages;
|
|
|
|
|
|
|
|
|
|
|
@ -191,7 +192,7 @@ public partial class Gameboard : ContentPage
|
|
|
|
|
|
|
|
|
|
|
|
private void Game_NextPlayerNotified(object? sender, NextPlayerNotifiedEventArgs args)
|
|
|
|
private void Game_NextPlayerNotified(object? sender, NextPlayerNotifiedEventArgs args)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
DisplayAlert("Player switch !", "It's your turn : " + args.Player.NameTag, "<3");
|
|
|
|
Debug.WriteLine(args.Player.NameTag);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
private void OnButtonSwapClicked(object sender, EventArgs e)
|
|
|
|
private void OnButtonSwapClicked(object sender, EventArgs e)
|
|
|
@ -208,7 +209,7 @@ public partial class Gameboard : ContentPage
|
|
|
|
|
|
|
|
|
|
|
|
private async Task AnswerSwap()
|
|
|
|
private async Task AnswerSwap()
|
|
|
|
{
|
|
|
|
{
|
|
|
|
bool answer = await DisplayAlert("Swap System", "Etes vous sur de vouloir swap vos tuiles ? Attention, si vous swapez vous ne pouvez pu jouer", "Yes", "No");
|
|
|
|
bool answer = await DisplayAlert("Swap System", "Are you sure you want to swap your tiles? Attention, if you swap you can not play", "Yes", "No");
|
|
|
|
|
|
|
|
|
|
|
|
if (answer)
|
|
|
|
if (answer)
|
|
|
|
{
|
|
|
|
{
|
|
|
@ -236,7 +237,13 @@ public partial class Gameboard : ContentPage
|
|
|
|
|
|
|
|
|
|
|
|
if (answer)
|
|
|
|
if (answer)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
|
|
|
|
IGamePersistence gameIntermediateSave = new GamePersistenceXml();
|
|
|
|
|
|
|
|
gameIntermediateSave.SaveGame(game);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
game.ClearGame();
|
|
|
|
await Navigation.PopToRootAsync();
|
|
|
|
await Navigation.PopToRootAsync();
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|