2021-08-12 16:52:06 +01:00
|
|
|
|
using System.IO;
|
|
|
|
|
|
|
|
|
|
namespace Generator
|
|
|
|
|
{
|
|
|
|
|
class Program
|
|
|
|
|
{
|
|
|
|
|
static void Main(string[] args)
|
|
|
|
|
{
|
2021-08-13 16:25:19 +01:00
|
|
|
|
//TODO: pass these into functions to act as whitelist
|
2021-08-12 22:26:25 +01:00
|
|
|
|
string[] botTypes = { "assault", "marksman", "pmcbot", "bossbully", "bosskilla" };
|
2021-08-12 16:52:06 +01:00
|
|
|
|
|
|
|
|
|
// Read raw bot dumps from live and turn into c# objects
|
|
|
|
|
var workingPath = Directory.GetCurrentDirectory();
|
|
|
|
|
var dumpPath = $"{workingPath}//dumps";
|
2021-08-13 16:25:19 +01:00
|
|
|
|
var botParser = new BotParser(dumpPath, botTypes);
|
2021-08-12 16:52:06 +01:00
|
|
|
|
var parsedBots = botParser.Parse();
|
|
|
|
|
|
2021-08-12 22:26:25 +01:00
|
|
|
|
if (parsedBots.Count == 0)
|
|
|
|
|
{
|
|
|
|
|
Helpers.LoggingHelpers.LogToConsole("no bots found, unable to continue");
|
2021-08-13 16:25:19 +01:00
|
|
|
|
Helpers.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)
|
|
|
|
|
var baseBotGenerator = new BaseBotGenerator(parsedBots);
|
|
|
|
|
var baseBots = baseBotGenerator.AddBaseDetails();
|
|
|
|
|
|
|
|
|
|
// Add weapons/armor to bot
|
|
|
|
|
var botGearGenerator = new BotGearGenerator(baseBots, parsedBots);
|
|
|
|
|
var botsWithGear = botGearGenerator.AddGear();
|
|
|
|
|
|
|
|
|
|
// Add loot to bot
|
|
|
|
|
var botLootGenerator = new BotLootGenerator(botsWithGear, parsedBots);
|
|
|
|
|
var botsWithGearAndLoot = botLootGenerator.AddLoot();
|
|
|
|
|
|
|
|
|
|
// Output bot to json file
|
|
|
|
|
var jsonWriter = new JsonWriter(workingPath, "output");
|
|
|
|
|
jsonWriter.WriteJson(botsWithGearAndLoot);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|