BotGenerator/Generator/Program.cs

68 lines
2.3 KiB
C#
Raw Normal View History

2021-08-24 12:08:30 +01:00
using Common;
using System.IO;
2021-08-12 16:52:06 +01:00
namespace Generator
{
class Program
{
static void Main(string[] args)
{
// Create list of bots we want to process
2021-08-18 21:13:46 +01:00
string[] botTypes = {
2021-08-17 17:32:03 +01:00
"assault",
"marksman",
2021-08-20 08:33:49 +01:00
"pmcBot",
2021-08-17 17:32:03 +01:00
"bossbully",
"bossgluhar",
"bosskilla",
"bosskojaniy",
2021-08-18 21:13:46 +01:00
"bosssanitar",
2021-08-20 08:23:55 +01:00
//"bossstormtrooper",
2021-08-18 21:41:59 +01:00
2021-08-18 21:13:46 +01:00
"followerbully",
"followergluharassault",
"followergluharscout",
"followergluharsecurity",
//"followergluharsnipe",
2021-08-18 21:13:46 +01:00
"followerkojaniy",
"followersanitar",
2021-08-20 08:23:55 +01:00
//"followerstormtrooper",
2021-08-18 21:41:59 +01:00
"cursedassault",
"sectantpriest",
"sectantwarrior",
2021-08-17 17:32:03 +01:00
};
2021-08-12 16:52:06 +01:00
// Read raw bot dumps and turn into c# objects
2021-08-12 16:52:06 +01:00
var workingPath = Directory.GetCurrentDirectory();
var dumpPath = $"{workingPath}//dumps";
2021-08-20 08:23:55 +01:00
var botParser = new BotParser(dumpPath);
2021-08-12 16:52:06 +01:00
var parsedBots = botParser.Parse();
2021-08-12 22:26:25 +01:00
if (parsedBots.Count == 0)
{
2021-08-24 12:08:30 +01:00
LoggingHelpers.LogToConsole("no bots found, unable to continue");
LoggingHelpers.LogToConsole("Check your dumps are in 'Generator\\bin\\Debug\\netcoreapp3.1\\dumps' and start with 'resp.' NOT 'req.'");
2021-08-12 22:26:25 +01:00
return;
}
2021-08-12 16:52:06 +01:00
// Generate the base bot class and add basic details (health/body part hp etc)
2021-08-20 08:23:55 +01:00
var baseBotGenerator = new BaseBotGenerator(parsedBots, workingPath, botTypes);
2021-08-12 16:52:06 +01:00
var baseBots = baseBotGenerator.AddBaseDetails();
// Add weapons/armor to bots
2021-08-12 16:52:06 +01:00
var botGearGenerator = new BotGearGenerator(baseBots, parsedBots);
var botsWithGear = botGearGenerator.AddGear();
// Add loot to bots
2021-08-12 16:52:06 +01:00
var botLootGenerator = new BotLootGenerator(botsWithGear, parsedBots);
var botsWithGearAndLoot = botLootGenerator.AddLoot();
// Output bot to json file
var jsonWriter = new JsonWriter(workingPath, "output");
jsonWriter.WriteJson(botsWithGearAndLoot);
}
}
}