Nu hanteras även den som vinner ett game

This commit is contained in:
2025-10-06 17:49:20 +02:00
parent fa6c1e125f
commit c00819bec6
5 changed files with 13 additions and 3 deletions

View File

@ -5,5 +5,6 @@ public enum GamePointStatus
New = 0, New = 0,
InProgress = 1, InProgress = 1,
Completed = 2, Completed = 2,
Cancelled = 3 Cancelled = 3,
Winning = 4
} }

View File

@ -123,6 +123,4 @@ public class RoundBuilderElement : EntityBase
} }
} }

View File

@ -107,6 +107,8 @@ public class RoundRunningViewModel : ViewModelBase
} }
public ObservableCollection<RoundBuilderElement> Get() public ObservableCollection<RoundBuilderElement> Get()
{ {
@ -246,6 +248,11 @@ public class RoundRunningViewModel : ViewModelBase
{ {
player.Values.Add(element.GameRegPoints.ToString()); player.Values.Add(element.GameRegPoints.ToString());
player.PlayerPoints += element.GameRegPoints; player.PlayerPoints += element.GameRegPoints;
if (player.PlayerPoints > 10000)
{
var winner = RoundElements.FirstOrDefault(e => e.ParticipantId == player.PlayerId);
winner.Status = GamePointStatus.Winning;
}
} }
//oldPart = element.ParticipantId; //oldPart = element.ParticipantId;

View File

@ -55,6 +55,9 @@
<DataTrigger TargetType="Border" Binding="{Binding Status}" Value="Cancelled"> <DataTrigger TargetType="Border" Binding="{Binding Status}" Value="Cancelled">
<Setter Property="BackgroundColor" Value="LightCoral" /> <Setter Property="BackgroundColor" Value="LightCoral" />
</DataTrigger> </DataTrigger>
<DataTrigger TargetType="Border" Binding="{Binding Status}" Value="Winning">
<Setter Property="BackgroundColor" Value="Red" />
</DataTrigger>
</Style.Triggers> </Style.Triggers>
</Style> </Style>

View File

@ -34,6 +34,7 @@
Padding="10" Padding="10"
Margin="5" Margin="5"
StrokeShape="RoundRectangle 10" StrokeShape="RoundRectangle 10"
BackgroundColor="{Binding OverrideColor}"
Style="{StaticResource StatusBorderStyle}"> Style="{StaticResource StatusBorderStyle}">
<Border.GestureRecognizers> <Border.GestureRecognizers>
<TapGestureRecognizer <TapGestureRecognizer