From eccfb39f0c3f12a557cb518832633bea40248e4c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Elias=20H=C3=B6rner?= Date: Sun, 29 Jun 2025 09:55:11 +0200 Subject: [PATCH 1/2] rm --- src/Turnierplan.Core/Tournament/Match.cs | 5 ----- 1 file changed, 5 deletions(-) diff --git a/src/Turnierplan.Core/Tournament/Match.cs b/src/Turnierplan.Core/Tournament/Match.cs index dba269a7..5f7b78b5 100644 --- a/src/Turnierplan.Core/Tournament/Match.cs +++ b/src/Turnierplan.Core/Tournament/Match.cs @@ -88,11 +88,6 @@ public void SetOutcome(bool isCurrentlyPlaying, int scoreA, int scoreB, MatchOut { throw new TurnierplanException("Deciding matches cannot end with a draw."); } - - if (outcomeType == MatchOutcomeType.AfterPenalties && scoreA == scoreB) - { - throw new TurnierplanException($"When outcome type is '{nameof(MatchOutcomeType.AfterPenalties)}', the match may not be a draw."); - } } IsCurrentlyPlaying = isCurrentlyPlaying; From 40af586e252879be57c97e1a2e6ea8ff1744e23c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Elias=20H=C3=B6rner?= Date: Sun, 29 Jun 2025 09:56:03 +0200 Subject: [PATCH 2/2] simplify if --- src/Turnierplan.Core/Tournament/Match.cs | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/src/Turnierplan.Core/Tournament/Match.cs b/src/Turnierplan.Core/Tournament/Match.cs index 5f7b78b5..3714f104 100644 --- a/src/Turnierplan.Core/Tournament/Match.cs +++ b/src/Turnierplan.Core/Tournament/Match.cs @@ -82,12 +82,9 @@ internal Match(int id, int index, TeamSelectorBase teamSelectorA, TeamSelectorBa public void SetOutcome(bool isCurrentlyPlaying, int scoreA, int scoreB, MatchOutcomeType outcomeType) { - if (!isCurrentlyPlaying) + if (!isCurrentlyPlaying && IsDecidingMatch && scoreA == scoreB) { - if (IsDecidingMatch && scoreA == scoreB) - { - throw new TurnierplanException("Deciding matches cannot end with a draw."); - } + throw new TurnierplanException("Deciding matches cannot end with a draw."); } IsCurrentlyPlaying = isCurrentlyPlaying;