Feature: find min and max of skills before saving to json

This commit is contained in:
Chomp 2023-01-17 10:59:03 +00:00
parent 483793ea20
commit 65909e0f5b
2 changed files with 118 additions and 9 deletions

View File

@ -33,6 +33,68 @@
"60db29ce99594040e04c4a27": 4, "60db29ce99594040e04c4a27": 4,
"61f7c9e189e6fb1a5e3ea78d": 32 "61f7c9e189e6fb1a5e3ea78d": 32
}, },
"TacticalVest": {
"544a5caa4bdc2d1a388b4568": 1,
"5648a69d4bdc2ded0b8b457b": 2,
"572b7adb24597762ae139821": 2,
"5929a2a086f7744f4b234d43": 2,
"592c2d1a86f7746dbe2af32a": 2,
"59e7643b86f7742cbf2c109a": 2,
"5ab8dab586f77441cd04f2a2": 2,
"5c0e446786f7742013381639": 1,
"5c0e6a1586f77404597b4965": 2,
"5ca20abf86f77418567a43f2": 2,
"5d5d646386f7742797261fd9": 1,
"5e4abfed86f77406a2713cf7": 2,
"5fd4c4fa16cac650092f6771": 2,
"5fd4c5477a8d854fa0105061": 2,
"5fd4c60f875c30179f5d04c2": 2,
"6034cf5fffd42c541047f72e": 2,
"6034d0230ca681766b6a0fb5": 2,
"603648ff5a45383c122086ac": 2,
"6040dd4ddcf9592f401632d2": 2
},
"FaceCover": {
"572b7f1624597762ae139822": 10,
"572b7fa524597762b747ce82": 10,
"59e7715586f7742ee5789605": 10,
"5ab8f39486f7745cd93a1cca": 8,
"5ab8f4ff86f77431c60d91ba": 5,
"5b4326435acfc433000ed01d": 10,
"5b432b2f5acfc4771e1c6622": 10,
"5b432b6c5acfc4001a599bf0": 6,
"5b432c305acfc40019478128": 10,
"5b432f3d5acfc4704b4a1dfb": 10,
"5bd06f5d86f77427101ad47c": 10,
"5bd0716d86f774171822ef4b": 5,
"5bd071d786f7747e707b93a3": 5,
"5bd073a586f7747e6f135799": 7,
"5c1a1e3f2e221602b66cc4c2": 0,
"5e54f76986f7740366043752": 3,
"5e54f79686f7744022011103": 1,
"60363c0c92ec1c31037959f5": 10
},
"ArmorVest": {
"5648a7494bdc2d9d488b4583": 3,
"59e7635f86f7742cbf2c1095": 3,
"5ab8e4ed86f7742d8e50c7fa": 2,
"5ab8e79e86f7742d8b372e78": 1,
"5b44d22286f774172b0c9de8": 3,
"5c0e53c886f7747fa54205c7": 2,
"5c0e5edb86f77461f55ed1f7": 3,
"5df8a2ca86f7740bfe6df777": 3,
"609e8540d5c319764c2bc2e9": 2
},
"Eyewear": {
"557ff21e4bdc2d89578b4586": 3,
"59e770b986f7742cbd762754": 2,
"5aa2b923e5b5b000137b7589": 2,
"5aa2b986e5b5b00014028f4c": 3,
"5aa2b9aee5b5b00015693121": 2,
"5b432be65acfc433000ed01f": 3,
"5d6d2ef3a4b93618084f58bd": 2,
"603409c80ca681766b6a0fb2": 1
},
"Backpack": { "Backpack": {
"544a5cde4bdc2d39388b456b": 9, "544a5cde4bdc2d39388b456b": 9,
"56e335e4d2720b6c058b456d": 4, "56e335e4d2720b6c058b456d": 4,
@ -43,20 +105,49 @@
"5ab8f04f86f774585f4237d8": 12, "5ab8f04f86f774585f4237d8": 12,
"5f5e45cc5021ce62144be7aa": 4, "5f5e45cc5021ce62144be7aa": 4,
"60a2828e8689911a226117f9": 5 "60a2828e8689911a226117f9": 5
},
"Scabbard": {
"54491bb74bdc2d09088b4567": 5,
"57e26ea924597715ca604a09": 5,
"57e26fc7245977162a14b800": 5,
"5bc9c1e2d4351e00367fbcf0": 1,
"5c07df7f0db834001b73588a": 2
} }
}, },
"Ammo": { "Ammo": {
"Caliber366TKM": { "Caliber366TKM": {
"5f0596629e22f464da6bbdd9": 1, "59e6542b86f77411dc52a77a": 44,
"59e6542b86f77411dc52a77a": 1, "59e655cb86f77411dc52a77b": 20,
"59e655cb86f77411dc52a77b": 1 "59e6658b86f77411d949b250": 31,
"5f0596629e22f464da6bbdd9": 8
}, },
"Caliber12g": { "Caliber12g": {
"5d6e67fba4b9361bc73bc779": 1, "560d5e524bdc2d25448b4571": 5,
"5d6e689ca4b9361bc8618956": 1, "58820d1224597753c90aeb13": 2,
"560d5e524bdc2d25448b4571": 1, "5d6e6772a4b936088465b17c": 4,
"5d6e6806a4b936088465b17e": 1, "5d6e67fba4b9361bc73bc779": 4,
"5d6e68dea4b9361bcc29e659": 1 "5d6e6806a4b936088465b17e": 3,
"5d6e6869a4b9361c140bcfde": 1,
"5d6e6891a4b9361bd473feea": 1,
"5d6e68b3a4b9361bca7e50b5": 1,
"5d6e68dea4b9361bcc29e659": 1,
"5d6e68e6a4b9361c140bcfe0": 1,
"5d6e6911a4b9361bd5780d52": 1
},
"Caliber556x45NATO": {
"54527a984bdc2d4e668b4567": 4,
"54527ac44bdc2d36668b4567": 1,
"5c0d5ae286f7741e46554302": 3
},
"Caliber762x39": {
"5656d7c34bdc2d9d198b4587": 2,
"59e4cf5286f7741778269d8a": 2,
"59e4d3d286f774176a36250a": 1
},
"Caliber762x51": {
"5a6086ea4f39f99cd479502f": 1,
"5e023e53d4353e3302577c4c": 15,
"5e023e6e34d52a55c3304f71": 10
} }
} }
}, },

View File

@ -69,9 +69,27 @@ namespace Generator
{ {
var firstBotOfDesiredType = rawBotsOfSameType.FirstOrDefault(); var firstBotOfDesiredType = rawBotsOfSameType.FirstOrDefault();
foreach (var skill in firstBotOfDesiredType.Skills.Common) foreach (var skill in firstBotOfDesiredType.Skills.Common)
{ {
botToUpdate.skills.Common.Add(skill.Id, new MinMax(skill.Progress, skill.Progress)); var skills = new List<Common.Models.Input.Common>();
foreach (var bot in rawBotsOfSameType)
{
skills.Add(bot.Skills.Common.Find(x => x.Id == skill.Id));
}
var min = skills.Min(x => x.Progress);
var max = skills.Max(x => x.Progress);
botToUpdate.skills.Common.Add(skill.Id, new MinMax(min, max));
}
foreach (var bot in rawBotsOfSameType)
{
if (bot.Skills.Mastering.Count > 0)
{
var x = 2;
}
} }
} }