|
|
@ -3,6 +3,7 @@ using QwirkleClassLibrary;
|
|
|
|
using QwirkleClassLibrary.Games;
|
|
|
|
using QwirkleClassLibrary.Games;
|
|
|
|
using Microsoft.Maui.Controls;
|
|
|
|
using Microsoft.Maui.Controls;
|
|
|
|
using Qwirkle.Pages;
|
|
|
|
using Qwirkle.Pages;
|
|
|
|
|
|
|
|
using QwirkleClassLibrary.Persistences;
|
|
|
|
|
|
|
|
|
|
|
|
namespace Qwirkle
|
|
|
|
namespace Qwirkle
|
|
|
|
{
|
|
|
|
{
|
|
|
@ -22,9 +23,25 @@ namespace Qwirkle
|
|
|
|
Navigation.PushAsync(new SetPlayers());
|
|
|
|
Navigation.PushAsync(new SetPlayers());
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public void OnContinueClicked(object sender, EventArgs e)
|
|
|
|
public async void OnContinueClicked(object sender, EventArgs e)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
Navigation.PushAsync(new Gameboard("ContinueGame"));
|
|
|
|
IGamePersistence gameLoad = new GamePersistenceXml();
|
|
|
|
|
|
|
|
try
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
((App)Application.Current!).Game = gameLoad.LoadGame();
|
|
|
|
|
|
|
|
await Navigation.PushAsync(new Gameboard());
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
catch
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
await DisplayAlert("Error", "No game found", "Got it !");
|
|
|
|
|
|
|
|
await Navigation.PopAsync();
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (!((App)Application.Current!).Game.GameRunning)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
await DisplayAlert("Error", "No game found", "Got it !");
|
|
|
|
|
|
|
|
await Navigation.PopAsync();
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public void OnRulesClicked(object sender, EventArgs e)
|
|
|
|
public void OnRulesClicked(object sender, EventArgs e)
|
|
|
|