From 54d4b1475fba15784d776578ed82de31babf11c2 Mon Sep 17 00:00:00 2001 From: "Alex 'Braker' R." Date: Sun, 1 Dec 2024 13:30:48 +0100 Subject: [PATCH] Improve code maintainability --- src/Modules/RoundRankingModule/Models/PointsRepartition.cs | 4 ++-- src/Modules/RoundRankingModule/Utils/RoundRankingUtils.cs | 2 +- .../Interfaces/IScoreboardNicknamesService.cs | 4 +--- src/Modules/ScoreboardModule/Utils/ScoreboardNicknameUtils.cs | 2 +- 4 files changed, 5 insertions(+), 7 deletions(-) diff --git a/src/Modules/RoundRankingModule/Models/PointsRepartition.cs b/src/Modules/RoundRankingModule/Models/PointsRepartition.cs index b91eef3e..78a5a5bc 100644 --- a/src/Modules/RoundRankingModule/Models/PointsRepartition.cs +++ b/src/Modules/RoundRankingModule/Models/PointsRepartition.cs @@ -6,8 +6,8 @@ /// public class PointsRepartition : List { - public const string ModeScriptSetting = "S_PointsRepartition"; - public const string DefaultValue = "10,6,4,3,2,1"; + public static readonly string ModeScriptSetting = "S_PointsRepartition"; + public static readonly string DefaultValue = "10,6,4,3,2,1"; public PointsRepartition() { diff --git a/src/Modules/RoundRankingModule/Utils/RoundRankingUtils.cs b/src/Modules/RoundRankingModule/Utils/RoundRankingUtils.cs index d952e366..6055c3c1 100644 --- a/src/Modules/RoundRankingModule/Utils/RoundRankingUtils.cs +++ b/src/Modules/RoundRankingModule/Utils/RoundRankingUtils.cs @@ -12,7 +12,7 @@ public abstract class RoundRankingUtils /// /// public static bool HasPlayerInFinish(List checkpoints) => - checkpoints.Any(checkpoint => checkpoint.IsFinish); + checkpoints.Exists(checkpoint => checkpoint.IsFinish); /// /// Determines the winning team based on the given checkpoint data. diff --git a/src/Modules/ScoreboardModule/Interfaces/IScoreboardNicknamesService.cs b/src/Modules/ScoreboardModule/Interfaces/IScoreboardNicknamesService.cs index f2633e0d..ee913743 100644 --- a/src/Modules/ScoreboardModule/Interfaces/IScoreboardNicknamesService.cs +++ b/src/Modules/ScoreboardModule/Interfaces/IScoreboardNicknamesService.cs @@ -1,6 +1,4 @@ -using System.Collections.Concurrent; - -namespace EvoSC.Modules.Official.ScoreboardModule.Interfaces; +namespace EvoSC.Modules.Official.ScoreboardModule.Interfaces; public interface IScoreboardNicknamesService { diff --git a/src/Modules/ScoreboardModule/Utils/ScoreboardNicknameUtils.cs b/src/Modules/ScoreboardModule/Utils/ScoreboardNicknameUtils.cs index 39f39147..9e864c45 100644 --- a/src/Modules/ScoreboardModule/Utils/ScoreboardNicknameUtils.cs +++ b/src/Modules/ScoreboardModule/Utils/ScoreboardNicknameUtils.cs @@ -2,7 +2,7 @@ namespace EvoSC.Modules.Official.ScoreboardModule.Utils; -public class ScoreboardNicknameUtils +public static class ScoreboardNicknameUtils { /// /// Converts the nickname repo to a ManiaScript array.