its better for end game
continuous-integration/drone/push Build is passing Details

test_old_branch
Jérémy Mouyon 11 months ago
parent 788d560bb5
commit 8a8ef2fe04

@ -16,6 +16,7 @@ namespace Qwirkle
Routing.RegisterRoute(nameof(SetPlayers), typeof(SetPlayers)); Routing.RegisterRoute(nameof(SetPlayers), typeof(SetPlayers));
Routing.RegisterRoute(nameof(Gameboard), typeof(Gameboard)); Routing.RegisterRoute(nameof(Gameboard), typeof(Gameboard));
Routing.RegisterRoute(nameof(Rules), typeof(Rules)); Routing.RegisterRoute(nameof(Rules), typeof(Rules));
Routing.RegisterRoute(nameof(MainPage), typeof(MainPage));
} }

@ -31,7 +31,6 @@ public partial class Gameboard : ContentPage
public Gameboard() public Gameboard()
{ {
game.EndOfGameNotified += Game_EndOfGameNotified;
InitializeComponent(); InitializeComponent();
BindingContext = game; BindingContext = game;
@ -44,6 +43,8 @@ public partial class Gameboard : ContentPage
private void Game_EndOfGameNotified(object? sender, EndOfGameNotifiedEventArgs e) private void Game_EndOfGameNotified(object? sender, EndOfGameNotifiedEventArgs e)
{ {
DisplayAlert("THE END.", "FAUT QU'ON PARLE DE CE QUE QU'ON VEUT FAIRE ICI !!!" ,"<3"); DisplayAlert("THE END.", "FAUT QU'ON PARLE DE CE QUE QU'ON VEUT FAIRE ICI !!!" ,"<3");
Navigation.PushAsync(new MainPage());
game.ClearGame();
} }
private void OnDragStarting(object sender, DragStartingEventArgs e) private void OnDragStarting(object sender, DragStartingEventArgs e)
@ -89,6 +90,7 @@ public partial class Gameboard : ContentPage
private void OnButtonSkipClicked(object sender, EventArgs e) private void OnButtonSkipClicked(object sender, EventArgs e)
{ {
game.NextPlayerNotified += Game_NextPlayerNotified; game.NextPlayerNotified += Game_NextPlayerNotified;
game.EndOfGameNotified += Game_EndOfGameNotified;
if (game.PlayerSwapping) if (game.PlayerSwapping)
{ {
@ -106,6 +108,7 @@ public partial class Gameboard : ContentPage
game.CheckGameOver(game.GetPlayingPlayer()); game.CheckGameOver(game.GetPlayingPlayer());
game.SetNextPlayer(); game.SetNextPlayer();
game.NextPlayerNotified -= Game_NextPlayerNotified; game.NextPlayerNotified -= Game_NextPlayerNotified;
game.EndOfGameNotified -= Game_EndOfGameNotified;
ChangeColorBC(); ChangeColorBC();
} }

@ -35,7 +35,7 @@
DropCommand="{Binding OnDropB, Source={x:Reference root}}" DropCommand="{Binding OnDropB, Source={x:Reference root}}"
/> />
</Border.GestureRecognizers> </Border.GestureRecognizers>
<Image Source="bag.png"></Image> <Image Source="bag.png" ToolTipProperties.Text="Pour m'utiliser il faut cliquer sur le boutton swap avant ^^"></Image>
</Border> </Border>
<Button <Button
@ -43,6 +43,7 @@
Grid.Row="0" Grid.Column="1" Grid.Row="0" Grid.Column="1"
Text="Swap" Text="Swap"
Clicked="OnButtonSwapClicked" Clicked="OnButtonSwapClicked"
ToolTipProperties.Text="Click to swap your tiles !"
Style="{StaticResource GameButton}"/> Style="{StaticResource GameButton}"/>
<Button <Button
@ -50,12 +51,14 @@
Grid.Row="2" Grid.Column="1" Grid.Row="2" Grid.Column="1"
Text="Skip / End Turn" WidthRequest="200" Text="Skip / End Turn" WidthRequest="200"
Clicked="OnButtonSkipClicked" Clicked="OnButtonSkipClicked"
ToolTipProperties.Text="Click for skip / end your turn ;)"
Style="{StaticResource GameButton}"/> Style="{StaticResource GameButton}"/>
<Button <Button
HorizontalOptions="Start" HorizontalOptions="Start"
Grid.Row="2" Grid.Column="1" Grid.Row="2" Grid.Column="1"
Text="Settings" Text="Settings"
ToolTipProperties.Text="Click to check your settings -_-"
Style="{StaticResource GameButton}"/> Style="{StaticResource GameButton}"/>
<CollectionView Grid.Row="0" Grid.Column="1" ItemsSource="{Binding PlayerList[0].Tiles}" <CollectionView Grid.Row="0" Grid.Column="1" ItemsSource="{Binding PlayerList[0].Tiles}"

Loading…
Cancel
Save