|
|
@ -12,14 +12,16 @@ public partial class PageBoard : ContentPage
|
|
|
|
public PageBoard()
|
|
|
|
public PageBoard()
|
|
|
|
{
|
|
|
|
{
|
|
|
|
InitializeComponent();
|
|
|
|
InitializeComponent();
|
|
|
|
|
|
|
|
MyStub.ThePartie.DiceRolled += ThePartie_DiceRolled;
|
|
|
|
BindingContext = MyStub;
|
|
|
|
BindingContext = MyStub;
|
|
|
|
MyStub.ThePartie.InitializeGame(MyStub.ThePartie.UsedMap, MyStub.ListPlayer[0]);
|
|
|
|
MyStub.ThePartie.InitializeGame(MyStub.ThePartie.UsedMap, MyStub.ListPlayer[0]);
|
|
|
|
MyStub.ThePartie.DiceRolled += ThePartie_DiceRolled;
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
private void ThePartie_DiceRolled(object? sender, Models.Events.DiceRolledEventArgs e)
|
|
|
|
private void ThePartie_DiceRolled(object? sender, Models.Events.DiceRolledEventArgs e)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
MyStub.ThePartie.Dice1.Roll();
|
|
|
|
Dice1.Text = $"{e.Dice1Value}";
|
|
|
|
|
|
|
|
Dice2.Text = $"{e.Dice2Value}";
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
private void OnOperationCellSelected(object sender, SelectionChangedEventArgs e)
|
|
|
|
private void OnOperationCellSelected(object sender, SelectionChangedEventArgs e)
|
|
|
@ -36,4 +38,9 @@ public partial class PageBoard : ContentPage
|
|
|
|
((CollectionView)sender).SelectedItem = null; // Déselectionne l'élément pour la CollectionView
|
|
|
|
((CollectionView)sender).SelectedItem = null; // Déselectionne l'élément pour la CollectionView
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
private void Button_Clicked(object sender, EventArgs e)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
MyStub.ThePartie.RollAllDice();
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|