From d9132e5325eea19cc5eb8ec71da1c8c12c3fe749 Mon Sep 17 00:00:00 2001 From: Chomp Date: Mon, 9 Jun 2025 11:47:49 +0100 Subject: [PATCH] made class props readonly Removed unused injections Removed unnecessary .ToLower() --- .../Controllers/RepeatableQuestController.cs | 4 ++-- .../SPTarkov.Server.Core/Services/SeasonalEventService.cs | 8 +++----- 2 files changed, 5 insertions(+), 7 deletions(-) diff --git a/Libraries/SPTarkov.Server.Core/Controllers/RepeatableQuestController.cs b/Libraries/SPTarkov.Server.Core/Controllers/RepeatableQuestController.cs index 4175f076..de59d8b6 100644 --- a/Libraries/SPTarkov.Server.Core/Controllers/RepeatableQuestController.cs +++ b/Libraries/SPTarkov.Server.Core/Controllers/RepeatableQuestController.cs @@ -829,12 +829,12 @@ public class RepeatableQuestController( protected bool IsPmcLevelAllowedOnLocation(string location, int pmcLevel) { // All PMC levels are allowed for 'any' location requirement - if (location == ELocationName.any.ToString()) + if (location == nameof(ELocationName.any)) { return true; } - var locationBase = _databaseService.GetLocation(location.ToLower())?.Base; + var locationBase = _databaseService.GetLocation(location)?.Base; if (locationBase is null) { return true; diff --git a/Libraries/SPTarkov.Server.Core/Services/SeasonalEventService.cs b/Libraries/SPTarkov.Server.Core/Services/SeasonalEventService.cs index aff1587e..a5c126ba 100644 --- a/Libraries/SPTarkov.Server.Core/Services/SeasonalEventService.cs +++ b/Libraries/SPTarkov.Server.Core/Services/SeasonalEventService.cs @@ -18,16 +18,14 @@ public class SeasonalEventService( DatabaseService _databaseService, GiftService _giftService, LocalisationService _localisationService, - BotHelper _botHelper, ProfileHelper _profileHelper, - //DatabaseImporter _databaseImporter, ConfigServer _configServer, LocaleService _localeService ) { private bool _christmasEventActive; - protected HashSet _christmasEventItems = + protected readonly HashSet _christmasEventItems = [ ItemTpl.ARMOR_6B13_M_ASSAULT_ARMOR_CHRISTMAS_EDITION, ItemTpl.BACKPACK_SANTAS_BAG, @@ -60,12 +58,12 @@ public class SeasonalEventService( private List _currentlyActiveEvents = []; - protected HashSet _equipmentSlotsToFilter = + protected readonly HashSet _equipmentSlotsToFilter = [EquipmentSlots.FaceCover, EquipmentSlots.Headwear, EquipmentSlots.Backpack, EquipmentSlots.TacticalVest]; private bool _halloweenEventActive; - protected HashSet _halloweenEventItems = + protected readonly HashSet _halloweenEventItems = [ ItemTpl.HEADWEAR_JACKOLANTERN_TACTICAL_PUMPKIN_HELMET, ItemTpl.FACECOVER_FACELESS_MASK,