pass bottypes array into basebot class

This commit is contained in:
Chomp 2021-08-20 08:23:55 +01:00
parent d8e216d773
commit 6846d518c1
3 changed files with 9 additions and 6 deletions

View File

@ -14,12 +14,14 @@ namespace Generator
{
private readonly List<Datum> _rawParsedBots;
private readonly string _workingPath;
private readonly string[] _botTypes;
//TODO: pass in bot types and use those to create the clases in rawBots list
public BaseBotGenerator(List<Datum> parsedBots, string workingPath)
public BaseBotGenerator(List<Datum> parsedBots, string workingPath, string[] botTypes)
{
_rawParsedBots = parsedBots;
_workingPath = workingPath;
_botTypes = botTypes;
}
public List<Bot> AddBaseDetails()

View File

@ -15,7 +15,7 @@ namespace Generator
{
private readonly string _dumpPath;
public BotParser(string dumpPath, string[] botTypes)
public BotParser(string dumpPath)
{
_dumpPath = dumpPath;
}

View File

@ -16,7 +16,7 @@ namespace Generator
"bosskilla",
"bosskojaniy",
"bosssanitar",
"bossstormtrooper",
//"bossstormtrooper",
"followerbully",
"followergluharassault",
@ -25,7 +25,7 @@ namespace Generator
"followergluharsnipe",
"followerkojaniy",
"followersanitar",
"followerstormtrooper",
//"followerstormtrooper",
"cursedassault",
@ -36,7 +36,8 @@ namespace Generator
// Read raw bot dumps from live and turn into c# objects
var workingPath = Directory.GetCurrentDirectory();
var dumpPath = $"{workingPath}//dumps";
var botParser = new BotParser(dumpPath, botTypes);
var botParser = new BotParser(dumpPath);
var parsedBots = botParser.Parse();
if (parsedBots.Count == 0)
@ -47,7 +48,7 @@ namespace Generator
}
// Generate the base bot class and add basic details (health/body part hp etc)
var baseBotGenerator = new BaseBotGenerator(parsedBots, workingPath);
var baseBotGenerator = new BaseBotGenerator(parsedBots, workingPath, botTypes);
var baseBots = baseBotGenerator.AddBaseDetails();
// Add weapons/armor to bot