Avancement sur le test en vue

master
cldupland 6 years ago
parent b196a1fd2b
commit 0f6c23ec42

@ -126,6 +126,10 @@ namespace TheGameExtreme.model.manager
public void joue(int valueCard, int orderedStackSelected) public void joue(int valueCard, int orderedStackSelected)
{ {
if (EndMessage != null)
{
throw new Exception("Le jeu est fini! Veuillez lancer une nouvelle partie!");
}
foreach(Card card in CurrentHand) foreach(Card card in CurrentHand)
{ {
if (valueCard == card.Value) if (valueCard == card.Value)

@ -16,7 +16,7 @@
Margin="0,0,0,40"> Margin="0,0,0,40">
<StackLayout <StackLayout
Orientation="Vertical"> Orientation="Vertical">
<Label HorizontalTextAlignment="Center" x:Name="pile0" /> <Label HorizontalTextAlignment="Center" x:Name="pile0" Text="1" />
<StackLayout <StackLayout
Orientation="Horizontal"> Orientation="Horizontal">
<CheckBox x:Name="checkbox0" CheckedChanged="radioButton" /> <CheckBox x:Name="checkbox0" CheckedChanged="radioButton" />
@ -25,7 +25,7 @@
</StackLayout> </StackLayout>
<StackLayout <StackLayout
Orientation="Vertical"> Orientation="Vertical">
<Label HorizontalTextAlignment="Center" x:Name="pile1" /> <Label HorizontalTextAlignment="Center" x:Name="pile1" Text="1" />
<StackLayout <StackLayout
Orientation="Horizontal"> Orientation="Horizontal">
<CheckBox x:Name="checkbox1" CheckedChanged="radioButton" /> <CheckBox x:Name="checkbox1" CheckedChanged="radioButton" />
@ -34,7 +34,7 @@
</StackLayout> </StackLayout>
<StackLayout <StackLayout
Orientation="Vertical"> Orientation="Vertical">
<Label HorizontalTextAlignment="Center" x:Name="pile2" /> <Label HorizontalTextAlignment="Center" x:Name="pile2" Text="100" />
<StackLayout <StackLayout
Orientation="Horizontal"> Orientation="Horizontal">
<CheckBox x:Name="checkbox2" CheckedChanged="radioButton" /> <CheckBox x:Name="checkbox2" CheckedChanged="radioButton" />
@ -43,7 +43,7 @@
</StackLayout> </StackLayout>
<StackLayout <StackLayout
Orientation="Vertical"> Orientation="Vertical">
<Label HorizontalTextAlignment="Center" x:Name="pile3" /> <Label HorizontalTextAlignment="Center" x:Name="pile3" Text="100" />
<StackLayout <StackLayout
Orientation="Horizontal"> Orientation="Horizontal">
<CheckBox x:Name="checkbox3" CheckedChanged="radioButton" /> <CheckBox x:Name="checkbox3" CheckedChanged="radioButton" />

@ -150,6 +150,13 @@ namespace TheGameExtreme
Alert.SetBinding(Label.TextProperty, new Binding("Alert", source: viewmodel)); Alert.SetBinding(Label.TextProperty, new Binding("Alert", source: viewmodel));
inflateHand(); inflateHand();
pile0.Text = "1";
pile1.Text = "1";
pile2.Text = "100";
pile3.Text = "100";
botPanel.Children.Remove(button);
} }
private void endTurn(object sender, EventArgs args) private void endTurn(object sender, EventArgs args)

@ -103,7 +103,9 @@ namespace TheGameExtreme.viewmodel
{ {
try try
{ {
return gameManager.endTurn(); bool isEnd = gameManager.endTurn();
Alert = gameManager.EndMessage;
return isEnd;
} }
catch(Exception e) catch(Exception e)
{ {

Loading…
Cancel
Save