From c00819bec6d66d3c8aadd1f134d47b4d0b91e2c5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tommy=20=C3=96man?= Date: Mon, 6 Oct 2025 17:49:20 +0200 Subject: [PATCH] =?UTF-8?q?Nu=20hanteras=20=C3=A4ven=20den=20som=20vinner?= =?UTF-8?q?=20ett=20game?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- GreadyPoang.EntityLayer/Enums/GamePointStatus.cs | 3 ++- .../HelperEntities/RoundBuilderElement.cs | 2 -- .../ViewModelClasses/RoundRunningViewModel.cs | 7 +++++++ GreadyPoang/Resources/Styles/AppStyles.xaml | 3 +++ GreadyPoang/Views/RoundRunningView.xaml | 1 + 5 files changed, 13 insertions(+), 3 deletions(-) diff --git a/GreadyPoang.EntityLayer/Enums/GamePointStatus.cs b/GreadyPoang.EntityLayer/Enums/GamePointStatus.cs index 8b2f684..46e7f1d 100644 --- a/GreadyPoang.EntityLayer/Enums/GamePointStatus.cs +++ b/GreadyPoang.EntityLayer/Enums/GamePointStatus.cs @@ -5,5 +5,6 @@ public enum GamePointStatus New = 0, InProgress = 1, Completed = 2, - Cancelled = 3 + Cancelled = 3, + Winning = 4 } diff --git a/GreadyPoang.EntityLayer/HelperEntities/RoundBuilderElement.cs b/GreadyPoang.EntityLayer/HelperEntities/RoundBuilderElement.cs index 1b6c854..f956bf7 100644 --- a/GreadyPoang.EntityLayer/HelperEntities/RoundBuilderElement.cs +++ b/GreadyPoang.EntityLayer/HelperEntities/RoundBuilderElement.cs @@ -123,6 +123,4 @@ public class RoundBuilderElement : EntityBase } - - } diff --git a/GreadyPoang.ViewModelLayer/ViewModelClasses/RoundRunningViewModel.cs b/GreadyPoang.ViewModelLayer/ViewModelClasses/RoundRunningViewModel.cs index 08099ef..234e2c3 100644 --- a/GreadyPoang.ViewModelLayer/ViewModelClasses/RoundRunningViewModel.cs +++ b/GreadyPoang.ViewModelLayer/ViewModelClasses/RoundRunningViewModel.cs @@ -107,6 +107,8 @@ public class RoundRunningViewModel : ViewModelBase } + + public ObservableCollection Get() { @@ -246,6 +248,11 @@ public class RoundRunningViewModel : ViewModelBase { player.Values.Add(element.GameRegPoints.ToString()); player.PlayerPoints += element.GameRegPoints; + if (player.PlayerPoints > 10000) + { + var winner = RoundElements.FirstOrDefault(e => e.ParticipantId == player.PlayerId); + winner.Status = GamePointStatus.Winning; + } } //oldPart = element.ParticipantId; diff --git a/GreadyPoang/Resources/Styles/AppStyles.xaml b/GreadyPoang/Resources/Styles/AppStyles.xaml index e297278..2a2c39d 100644 --- a/GreadyPoang/Resources/Styles/AppStyles.xaml +++ b/GreadyPoang/Resources/Styles/AppStyles.xaml @@ -55,6 +55,9 @@ + + + diff --git a/GreadyPoang/Views/RoundRunningView.xaml b/GreadyPoang/Views/RoundRunningView.xaml index a02cc12..44bd68d 100644 --- a/GreadyPoang/Views/RoundRunningView.xaml +++ b/GreadyPoang/Views/RoundRunningView.xaml @@ -34,6 +34,7 @@ Padding="10" Margin="5" StrokeShape="RoundRectangle 10" + BackgroundColor="{Binding OverrideColor}" Style="{StaticResource StatusBorderStyle}">