Nu hanteras även den som vinner ett game
This commit is contained in:
@ -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
|
||||||
}
|
}
|
||||||
|
|||||||
@ -123,6 +123,4 @@ public class RoundBuilderElement : EntityBase
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -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;
|
||||||
|
|
||||||
|
|||||||
@ -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>
|
||||||
|
|
||||||
|
|||||||
@ -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
|
||||||
|
|||||||
Reference in New Issue
Block a user