@ -41,15 +41,15 @@ public partial class Gameboard : ContentPage
}
private void Game_EndOfGameNotified ( object? sender , EndOfGameNotifiedEventArgs e )
private async void Game_EndOfGameNotified ( object? sender , EndOfGameNotifiedEventArgs e )
{
PopUpEnd ( ) ;
Navigation . PushAsync ( new MainPage ( ) ) ;
await PopUpEnd ( ) ;
await Navigation . PushAsync ( new MainPage ( ) ) ;
}
private async void PopUpEnd ( )
private Task PopUpEnd ( )
{
await this . ShowPopupAsync ( new PopUpEndGame ( ) ) ;
return this . ShowPopupAsync ( new PopUpEndGame ( ) ) ;
}
private void OnDragStarting ( object sender , DragStartingEventArgs e )
@ -186,13 +186,13 @@ public partial class Gameboard : ContentPage
if ( game . CellsUsed . Count = = 0 & & ! game . PlayerSwapping )
{
AnswerSwap( ) ;
_ = AnswerSwap( ) ;
}
game . PlaceTileNotified - = Game_PlaceTileNotified ;
}
private async void 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" ) ;
@ -215,4 +215,18 @@ public partial class Gameboard : ContentPage
tilesSwap . Add ( tiledrag ! ) ;
}
}
private async void OnButtonExitClicked ( object sender , EventArgs e )
{
bool answer = await DisplayAlert ( "System information" , "Are you sure you want to quit? You can resume your game at any time from the home screen." , "Yes" , "No" ) ;
if ( answer )
{
await Navigation . PushAsync ( new MainPage ( ) ) ;
}
}
}