Remove count for any
This commit is contained in:
@@ -1005,7 +1005,7 @@ public class BotEquipmentModGenerator(
|
||||
tpl =>
|
||||
_botConfig.LowProfileGasBlockTpls.Contains(tpl)
|
||||
);
|
||||
if (onlyLowProfileGasBlocks.Count() > 0)
|
||||
if (onlyLowProfileGasBlocks.Any())
|
||||
{
|
||||
modPool = onlyLowProfileGasBlocks.ToHashSet();
|
||||
}
|
||||
@@ -1016,7 +1016,7 @@ public class BotEquipmentModGenerator(
|
||||
var onlyHighProfileGasBlocks = modPool.Where(
|
||||
tpl => !_botConfig.LowProfileGasBlockTpls.Contains(tpl)
|
||||
);
|
||||
if (onlyHighProfileGasBlocks.Count() > 0)
|
||||
if (onlyHighProfileGasBlocks.Any())
|
||||
{
|
||||
modPool = onlyHighProfileGasBlocks.ToHashSet();
|
||||
}
|
||||
@@ -1356,7 +1356,7 @@ public class BotEquipmentModGenerator(
|
||||
|
||||
// Last ditch, use full pool of items minus conflicts
|
||||
var newListOfModsForSlot = parentSlotCompatibleItems.Where(tpl => !request.ConflictingItemTpls.Contains(tpl));
|
||||
if (newListOfModsForSlot.Count() > 0)
|
||||
if (newListOfModsForSlot.Any())
|
||||
{
|
||||
return newListOfModsForSlot.ToHashSet();
|
||||
}
|
||||
@@ -1781,7 +1781,7 @@ public class BotEquipmentModGenerator(
|
||||
// Edge case, what if item is a mount for a scope and not directly a scope?
|
||||
// Check item is mount + has child items
|
||||
var itemDetails = _itemHelper.GetItem(item).Value;
|
||||
if (_itemHelper.IsOfBaseclass(item, BaseClasses.MOUNT) && itemDetails.Properties.Slots.Count() > 0)
|
||||
if (_itemHelper.IsOfBaseclass(item, BaseClasses.MOUNT) && itemDetails.Properties.Slots.Any())
|
||||
{
|
||||
// Check to see if mount has a scope slot (only include primary slot, ignore the rest like the backup sight slots)
|
||||
// Should only find 1 as there's currently no items with a mod_scope AND a mod_scope_000
|
||||
|
||||
@@ -608,7 +608,7 @@ public class LootGenerator(
|
||||
item.Properties.QuestItem is null
|
||||
);
|
||||
|
||||
if (rewardItemPool.Count() == 0)
|
||||
if (!rewardItemPool.Any())
|
||||
{
|
||||
if (_logger.IsLogEnabled(LogLevel.Debug))
|
||||
{
|
||||
@@ -664,7 +664,7 @@ public class LootGenerator(
|
||||
var relatedItems = linkedItemsToWeapon?.Where(
|
||||
item => item?.Parent == rewardKey && !_itemFilterService.IsItemBlacklisted(item.Id)
|
||||
);
|
||||
if (relatedItems is null || relatedItems.Count() == 0)
|
||||
if (relatedItems is null || !relatedItems.Any())
|
||||
{
|
||||
if (_logger.IsLogEnabled(LogLevel.Debug))
|
||||
{
|
||||
|
||||
@@ -85,7 +85,7 @@ public class DialogueHelper(
|
||||
}
|
||||
|
||||
var rewardItems = message.Items.Data?.Where(x => x.Id != itemId);
|
||||
if (rewardItems.Count() == 0)
|
||||
if (!rewardItems.Any())
|
||||
{
|
||||
message.RewardCollected = true;
|
||||
message.HasRewards = false;
|
||||
|
||||
@@ -591,7 +591,7 @@ public class ProfileHelper(
|
||||
public double GetBonusValueFromProfile(PmcData pmcProfile, BonusType desiredBonus)
|
||||
{
|
||||
var bonuses = pmcProfile?.Bonuses?.Where(b => b.Type == desiredBonus);
|
||||
if (bonuses.Count() == 0)
|
||||
if (!bonuses.Any())
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
@@ -621,7 +621,7 @@ public class ProfileHelper(
|
||||
// Find all pockets in profile, may be multiple as they could have equipment stand
|
||||
// (1 pocket for each upgrade level of equipment stand)
|
||||
var pockets = pmcProfile.Inventory.Items.Where(i => i.SlotId == "Pockets");
|
||||
if (pockets.Count() == 0)
|
||||
if (!pockets.Any())
|
||||
{
|
||||
_logger.Error($"Unable to replace profile: {pmcProfile.Id} pocket tpl with: {newPocketTpl} as Pocket item could not be found.");
|
||||
return;
|
||||
|
||||
@@ -737,7 +737,7 @@ public class QuestHelper(
|
||||
// Quest found and no repeatable found
|
||||
if (quest is not null && matchingRepeatableQuest is null)
|
||||
{
|
||||
if (quest.FailMessageText.Trim().Count() > 0)
|
||||
if (quest.FailMessageText.Trim().Any())
|
||||
{
|
||||
_mailSendService.SendLocalisedNpcMessageToPlayer(
|
||||
sessionID,
|
||||
|
||||
@@ -412,7 +412,7 @@ public class SeasonalEventService(
|
||||
|
||||
// Get non-christmas items
|
||||
var nonChristmasTpls = prop.Where(tpl => !christmasItems.Contains(tpl.Key));
|
||||
if (nonChristmasTpls.Count() == 0)
|
||||
if (!nonChristmasTpls.Any())
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user