|
|
@ -9,6 +9,7 @@ using System.ComponentModel;
|
|
|
|
using Cell = QwirkleClassLibrary.Boards.Cell;
|
|
|
|
using Cell = QwirkleClassLibrary.Boards.Cell;
|
|
|
|
using Color = Microsoft.Maui.Graphics.Color;
|
|
|
|
using Color = Microsoft.Maui.Graphics.Color;
|
|
|
|
using System.Drawing;
|
|
|
|
using System.Drawing;
|
|
|
|
|
|
|
|
using QwirkleClassLibrary.Persistences;
|
|
|
|
using CommunityToolkit.Maui.Views;
|
|
|
|
using CommunityToolkit.Maui.Views;
|
|
|
|
|
|
|
|
|
|
|
|
namespace Qwirkle.Pages;
|
|
|
|
namespace Qwirkle.Pages;
|
|
|
@ -112,6 +113,11 @@ public partial class Gameboard : ContentPage
|
|
|
|
game.DrawTiles(game.GetPlayingPlayer());
|
|
|
|
game.DrawTiles(game.GetPlayingPlayer());
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
game.CheckGameOver(game.GetPlayingPlayer());
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
IGamePersistence gameIntermediateSave = new GamePersistenceXml();
|
|
|
|
|
|
|
|
gameIntermediateSave.SaveGame(game);
|
|
|
|
|
|
|
|
|
|
|
|
if (!game.CheckGameOver(game.GetPlayingPlayer()))
|
|
|
|
if (!game.CheckGameOver(game.GetPlayingPlayer()))
|
|
|
|
{
|
|
|
|
{
|
|
|
|
game.SetNextPlayer();
|
|
|
|
game.SetNextPlayer();
|
|
|
@ -119,7 +125,14 @@ public partial class Gameboard : ContentPage
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else
|
|
|
|
else
|
|
|
|
{
|
|
|
|
{
|
|
|
|
((App)Application.Current!).LD.AddScoreInLead(game.ScoreBoard);
|
|
|
|
((App)Application.Current!).Ld.AddScoreInLead(game.ScoreBoard);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
IGamePersistence gameEndSave = new GamePersistenceXml();
|
|
|
|
|
|
|
|
gameEndSave.SaveGame(game);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
ILeaderboardPersistence leaderboardSave = new LeaderboardPersistenceJson();
|
|
|
|
|
|
|
|
leaderboardSave.SaveLeaderboard(((App)Application.Current!).Ld);
|
|
|
|
|
|
|
|
|
|
|
|
game.ClearGame();
|
|
|
|
game.ClearGame();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
game.NextPlayerNotified -= Game_NextPlayerNotified;
|
|
|
|
game.NextPlayerNotified -= Game_NextPlayerNotified;
|
|
|
|