Update values

This commit is contained in:
Chomp 2023-02-23 10:37:53 +00:00
parent 9110fabfcf
commit a9b87b625a
6 changed files with 47 additions and 15 deletions

View File

@ -3,7 +3,7 @@
public enum BotType public enum BotType
{ {
assault = 1, assault = 1,
pmcBot = 2, pmcbot = 2,
marksman = 3, marksman = 3,
bossbully = 4, bossbully = 4,
bossgluhar = 5, bossgluhar = 5,
@ -24,12 +24,12 @@
sectantpriest = 20, sectantpriest = 20,
sectantwarrior = 21, sectantwarrior = 21,
usec = 22, usec = 22,
exUsec = 23, exusec = 23,
gifter = 24, gifter = 24,
bossknight = 25, bossknight = 25,
followerbirdeye = 26, followerbirdeye = 26,
followerbigpipe = 27, followerbigpipe = 27,
bossZryachiy = 28, bosszryachiy = 28,
followerZryachiy = 29 followerzryachiy = 29
} }
} }

View File

@ -68,15 +68,14 @@ public static class BotParser
continue; continue;
} }
if (!parsedBotsDict.ContainsKey(bot._id)) if (parsedBotsDict.ContainsKey(bot._id))
{ {
parsedBotsDict.Add(bot._id, bot); //var existingBot = parsedBotsDict[bot._id];
}
else
{
var existingBot = parsedBotsDict[bot._id];
dupeCount++; dupeCount++;
continue;
} }
parsedBotsDict.Add(bot._id, bot);
} }
totalDupeCount += dupeCount; totalDupeCount += dupeCount;

View File

@ -0,0 +1,31 @@
using System.Collections.Concurrent;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
namespace Common.Extensions
{
public static class ParallelExtensions
{
public static Task ParallelForEachAsync<T>(this IEnumerable<T> source, int dop, Func<T, Task> body)
{
async Task AwaitPartition(IEnumerator<T> partition)
{
using (partition)
{
while (partition.MoveNext())
{
await Task.Yield(); // prevents a sync/hot thread hangup
await body(partition.Current);
}
}
}
return Task.WhenAll(
Partitioner
.Create(source)
.GetPartitions(dop)
.AsParallel()
.Select(p => AwaitPartition(p)));
}
}
}

View File

@ -180,7 +180,7 @@ namespace Generator
if (name.Length > 1) if (name.Length > 1)
{ {
// Add lastnames to all bots except raiders // Add lastnames to all bots except raiders
if (botToUpdate.botType != BotType.pmcBot) if (botToUpdate.botType != BotType.pmcbot)
{ {
botToUpdate.lastName.AddUnique(name[1]); botToUpdate.lastName.AddUnique(name[1]);
} }

View File

@ -114,7 +114,7 @@ namespace Generator.Helpers.Gear
case BotType.bosssanitar: case BotType.bosssanitar:
botToUpdate.chances.mods["mod_scope"] = 100; botToUpdate.chances.mods["mod_scope"] = 100;
break; break;
case BotType.pmcBot: case BotType.pmcbot:
botToUpdate.chances.mods["mod_stock"] = 100; botToUpdate.chances.mods["mod_stock"] = 100;
break; break;
case BotType.followerbully: case BotType.followerbully:
@ -140,8 +140,10 @@ namespace Generator.Helpers.Gear
botToUpdate.chances.mods["mod_scope"] = 100; botToUpdate.chances.mods["mod_scope"] = 100;
botToUpdate.chances.mods["mod_stock"] = 100; botToUpdate.chances.mods["mod_stock"] = 100;
break; break;
case BotType.exUsec: case BotType.exusec:
botToUpdate.chances.mods["mod_stock"] = 100;
botToUpdate.chances.mods["mod_stock_000"] = 100; botToUpdate.chances.mods["mod_stock_000"] = 100;
botToUpdate.chances.mods["mod_stock_001"] = 100;
break; break;
} }
@ -243,7 +245,7 @@ namespace Generator.Helpers.Gear
min = 0; min = 0;
max = 0; max = 0;
break; break;
case BotType.exUsec: case BotType.exusec:
min = 2; min = 2;
max = 4; max = 4;
break; break;

View File

@ -70,7 +70,7 @@ namespace Generator.Helpers.Gear
{ {
case BotType.assault: case BotType.assault:
break; break;
case BotType.pmcBot: case BotType.pmcbot:
break; break;
case BotType.marksman: case BotType.marksman:
break; break;