🚧 Deroulement de la partie
continuous-integration/drone/push Build is failing Details

pull/99/head
Lucas DUFLOT 11 months ago
parent 32f7516c5a
commit 531b45f159

@ -111,6 +111,16 @@ namespace Models.Game
IsRunning = false;
}
public Game()
{
UsedMap = new Map("Map1");
BestScores = new List<BestScore>();
GameRules = new Rules.Rules();
IsRunning = false;
}
/// <summary>
/// Rolls all the dice.
/// </summary>

@ -12,10 +12,13 @@ namespace Stub
public ReadOnlyObservableCollection<Map> ListMap { get; private set; }
private readonly ObservableCollection<Map> listmap = new ObservableCollection<Map>();
public Game ThePartie { get; private set; }
public Stub()
{
ListPlayer = new ReadOnlyObservableCollection<Player>(listplayer);
ListMap = new ReadOnlyObservableCollection<Map>(listmap);
ThePartie = new Game();
LoadPlayer();
LoadMap();
}

@ -5,12 +5,26 @@
Title="Board"
BackgroundColor="Bisque">
<Grid RowDefinitions="*,auto" ColumnDefinitions="*,auto">
<Grid RowDefinitions="*,auto" ColumnDefinitions="auto,*,auto">
<Frame BorderColor="DarkGray"
HeightRequest="50"
WidthRequest="50"
Grid.Column="0"
HorizontalOptions="Center"
VerticalOptions="Center"
Padding="0">
<Label Text="{Binding ThePartie.Dice1.Value}"
FontSize="16"
VerticalOptions="Center"
HorizontalOptions="Center"
TextColor="Black"
/>
</Frame>
<Image Source="maptest.png" Aspect="AspectFit" Grid.ColumnSpan="2" Grid.RowSpan="3"/>
<CollectionView ItemsSource="{Binding ListMap[0].Boards}"
Grid.Row="1"
Grid.Column="0"
Grid.Column="1"
SelectionMode="Single"
WidthRequest="350"
HeightRequest="350"
@ -46,7 +60,7 @@
</CollectionView>
<!-- Operation Grid -->
<CollectionView Grid.Row="0" Grid.Column="1"
<CollectionView Grid.Row="0" Grid.Column="2"
ItemsSource="{Binding ListMap[0].OperationGrid}"
ItemsLayout="VerticalGrid,4"
WidthRequest="200"

@ -13,6 +13,13 @@ public partial class PageBoard : ContentPage
{
InitializeComponent();
BindingContext = MyStub;
MyStub.ThePartie.InitializeGame(MyStub.ThePartie.UsedMap, MyStub.ListPlayer[0]);
MyStub.ThePartie.DiceRolled += ThePartie_DiceRolled;
}
private void ThePartie_DiceRolled(object? sender, Models.Events.DiceRolledEventArgs e)
{
MyStub.ThePartie.Dice1.Roll();
}
private void OnOperationCellSelected(object sender, SelectionChangedEventArgs e)

Loading…
Cancel
Save