.NET Format Style Fixes
This commit is contained in:
@@ -504,7 +504,7 @@ public class InsuranceController(
|
||||
|
||||
// Draw x attachments from weighted array to remove from parent, remove from pool after being picked
|
||||
var attachmentIdsToRemove = attachmentsProbabilityArray.Draw(
|
||||
(int) countOfAttachmentsToRemove,
|
||||
(int)countOfAttachmentsToRemove,
|
||||
false
|
||||
);
|
||||
foreach (var attachmentId in attachmentIdsToRemove)
|
||||
|
||||
@@ -408,7 +408,7 @@ public class LocationLootGenerator(
|
||||
containerDistribution.Add(new ProbabilityObject<string, double>(x, value, value));
|
||||
}
|
||||
|
||||
chosenContainerIds.AddRange(containerDistribution.Draw((int) containerData.ChosenCount));
|
||||
chosenContainerIds.AddRange(containerDistribution.Draw((int)containerData.ChosenCount));
|
||||
|
||||
return chosenContainerIds;
|
||||
}
|
||||
@@ -855,7 +855,7 @@ public class LocationLootGenerator(
|
||||
if (randomSpawnPointCount > 0 && spawnPointArray.Count > 0)
|
||||
// Add randomly chosen spawn points
|
||||
{
|
||||
foreach (var si in spawnPointArray.Draw((int) randomSpawnPointCount, false))
|
||||
foreach (var si in spawnPointArray.Draw((int)randomSpawnPointCount, false))
|
||||
{
|
||||
chosenSpawnPoints.Add(spawnPointArray.Data(si));
|
||||
}
|
||||
|
||||
+18
-18
@@ -605,9 +605,9 @@ public class EliminationQuestGenerator(
|
||||
+ generationData.EliminationConfig.MinDistance
|
||||
);
|
||||
|
||||
distance = (int) Math.Ceiling((decimal) (distance / 5d)) * 5;
|
||||
distance = (int)Math.Ceiling((decimal)(distance / 5d)) * 5;
|
||||
|
||||
var distanceDifficulty = (int) (
|
||||
var distanceDifficulty = (int)(
|
||||
MaxDistDifficulty * distance / generationData.EliminationConfig.MaxDistance
|
||||
);
|
||||
|
||||
@@ -629,26 +629,26 @@ public class EliminationQuestGenerator(
|
||||
{
|
||||
// Filter out close range weapons from far distance requirement
|
||||
case > 50:
|
||||
{
|
||||
List<string> weaponTypeBlacklist = ["Shotgun", "Pistol"];
|
||||
{
|
||||
List<string> weaponTypeBlacklist = ["Shotgun", "Pistol"];
|
||||
|
||||
// Filter out close range weapons from long distance requirement
|
||||
generationData.WeaponCategoryRequirementConfig.RemoveAll(category =>
|
||||
weaponTypeBlacklist.Contains(category.Key)
|
||||
);
|
||||
break;
|
||||
}
|
||||
// Filter out close range weapons from long distance requirement
|
||||
generationData.WeaponCategoryRequirementConfig.RemoveAll(category =>
|
||||
weaponTypeBlacklist.Contains(category.Key)
|
||||
);
|
||||
break;
|
||||
}
|
||||
// Filter out long range weapons from close distance requirement
|
||||
case < 20:
|
||||
{
|
||||
List<string> weaponTypeBlacklist = ["MarksmanRifle", "DMR"];
|
||||
{
|
||||
List<string> weaponTypeBlacklist = ["MarksmanRifle", "DMR"];
|
||||
|
||||
// Filter out far range weapons from close distance requirement
|
||||
generationData.WeaponCategoryRequirementConfig.RemoveAll(category =>
|
||||
weaponTypeBlacklist.Contains(category.Key)
|
||||
);
|
||||
break;
|
||||
}
|
||||
// Filter out far range weapons from close distance requirement
|
||||
generationData.WeaponCategoryRequirementConfig.RemoveAll(category =>
|
||||
weaponTypeBlacklist.Contains(category.Key)
|
||||
);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
// Pick a weighted weapon category
|
||||
|
||||
@@ -433,7 +433,7 @@ public class ItemHelper(
|
||||
// Run getItemPrice for each tpl in tpls array, return sum
|
||||
return tpls.Aggregate(
|
||||
0,
|
||||
(total, tpl) => total + (int) GetItemPrice(tpl).GetValueOrDefault(0)
|
||||
(total, tpl) => total + (int)GetItemPrice(tpl).GetValueOrDefault(0)
|
||||
);
|
||||
}
|
||||
|
||||
@@ -902,8 +902,8 @@ public class ItemHelper(
|
||||
// Find required items to take after buying (handles multiple items)
|
||||
var desiredBarterIds =
|
||||
desiredBarterItemIds.GetType() == typeof(string)
|
||||
? [(string) desiredBarterItemIds]
|
||||
: (List<string>) desiredBarterItemIds;
|
||||
? [(string)desiredBarterItemIds]
|
||||
: (List<string>)desiredBarterItemIds;
|
||||
|
||||
List<Item> matchingItems = [];
|
||||
foreach (var barterId in desiredBarterIds)
|
||||
@@ -1456,7 +1456,7 @@ public class ItemHelper(
|
||||
var cartridgeItemToAdd = CreateCartridges(
|
||||
ammoBox[0].Id,
|
||||
cartridgeTpl,
|
||||
(int) cartridgeCountToAdd,
|
||||
(int)cartridgeCountToAdd,
|
||||
location
|
||||
);
|
||||
|
||||
@@ -1485,7 +1485,7 @@ public class ItemHelper(
|
||||
0
|
||||
].Filter?.FirstOrDefault();
|
||||
ammoBox.Add(
|
||||
CreateCartridges(ammoBox[0].Id, cartridgeTpl, (int) ammoBoxMaxCartridgeCount, 0)
|
||||
CreateCartridges(ammoBox[0].Id, cartridgeTpl, (int)ammoBoxMaxCartridgeCount, 0)
|
||||
);
|
||||
}
|
||||
|
||||
@@ -1593,8 +1593,8 @@ public class ItemHelper(
|
||||
}
|
||||
|
||||
var desiredStackCount = _randomUtil.GetInt(
|
||||
(int) Math.Round(minSizeMultiplier * magazineCartridgeMaxCount ?? 0),
|
||||
(int) magazineCartridgeMaxCount
|
||||
(int)Math.Round(minSizeMultiplier * magazineCartridgeMaxCount ?? 0),
|
||||
(int)magazineCartridgeMaxCount
|
||||
);
|
||||
|
||||
if (magazineWithChildCartridges.Count > 1)
|
||||
@@ -1706,7 +1706,7 @@ public class ItemHelper(
|
||||
ammoArray.Add(
|
||||
new ProbabilityObject<string, float?>(
|
||||
icd.Tpl,
|
||||
(double) icd.RelativeProbability,
|
||||
(double)icd.RelativeProbability,
|
||||
null
|
||||
)
|
||||
);
|
||||
|
||||
@@ -90,7 +90,7 @@ public class ProbabilityObjectArray<K, V> : List<ProbabilityObject<K, V>>
|
||||
/// <returns>ProbabilityObjectArray without the dropped element</returns>
|
||||
public ProbabilityObjectArray<K, V> Drop(K key)
|
||||
{
|
||||
return (ProbabilityObjectArray<K, V>) this.Where(r => !r.Key?.Equals(key) ?? false);
|
||||
return (ProbabilityObjectArray<K, V>)this.Where(r => !r.Key?.Equals(key) ?? false);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
||||
Reference in New Issue
Block a user