add skills/standing/experience to bot output

This commit is contained in:
Chomp 2021-08-17 16:21:27 +01:00
parent 5fe63e3b4f
commit a639b5b9e9

View File

@ -44,6 +44,9 @@ namespace Generator
UpdateBodyPartHealth(botToUpdate, rawBotsOfSameType); UpdateBodyPartHealth(botToUpdate, rawBotsOfSameType);
AddDifficulties(botToUpdate, _workingPath); AddDifficulties(botToUpdate, _workingPath);
AddExperience(botToUpdate, rawBotsOfSameType);
AddStandingForKill(botToUpdate, rawBotsOfSameType);
AddSkills(botToUpdate, rawBotsOfSameType);
foreach (var rawParsedBot in rawBotsOfSameType) foreach (var rawParsedBot in rawBotsOfSameType)
{ {
@ -59,6 +62,31 @@ namespace Generator
return rawBots; return rawBots;
} }
private void AddSkills(Bot botToUpdate, List<Datum> rawBotsOfSameType)
{
var firstBotOfDesiredType = rawBotsOfSameType.FirstOrDefault();
foreach (var skill in firstBotOfDesiredType.Skills.Common)
{
botToUpdate.skills.Common.Add(skill.Id, new MinMax(skill.Progress, skill.Progress));
}
}
private void AddStandingForKill(Bot botToUpdate, List<Datum> rawBotsOfSameType)
{
var firstBotOfDesiredType = rawBotsOfSameType.FirstOrDefault();
botToUpdate.experience.standingForKill = firstBotOfDesiredType.Info.Settings.StandingForKill;
}
private void AddExperience(Bot botToUpdate, List<Datum> rawBotsOfSameType)
{
var firstBotOfDesiredType = rawBotsOfSameType.FirstOrDefault();
botToUpdate.experience.reward.min = firstBotOfDesiredType.Info.Settings.Experience;
botToUpdate.experience.reward.max = firstBotOfDesiredType.Info.Settings.Experience;
}
private void AddVoice(Bot bot, Datum rawParsedBot) private void AddVoice(Bot bot, Datum rawParsedBot)
{ {
bot.appearance.voice.AddUnique(rawParsedBot.Info.Voice); bot.appearance.voice.AddUnique(rawParsedBot.Info.Voice);