I am creating a Sample bot for the Free Pascal / Delphi language suite. I have a Console App that does nothing except echoing ‘Hello World. I am robot’ to the console for now, but when I run it via the Gaming Framework (tower-defence-runner-1.0.1.jar), I get the following NullPointerException:
D:\2018-TowerDefence-master\starter-pack>java -jar tower-defence-runner-1.0.1.jar
java.lang.NullPointerException
at za.co.entelect.challenge.botrunners.BotRunnerFactory.createBotRunner(BotRunnerFactory.java:8)
at za.co.entelect.challenge.bootstrapper.GameBootstrapper.parsePlayer(GameBootstrapper.java:97)
at za.co.entelect.challenge.bootstrapper.GameBootstrapper.prepareGame(GameBootstrapper.java:86)
at za.co.entelect.challenge.bootstrapper.GameBootstrapper.main(GameBootstrapper.java:41)
Sorry, answering my own stupid question after ooking at the Game code. Suppose it will be resolved once I submit the new BOT.
The ClassFactory that executes the custom code looks as follow:
public class BotRunnerFactory { public static BotRunner createBotRunner(BotMetaData botMetaData, int timeoutInMilliseconds) throws InvalidRunnerState { switch (botMetaData.getBotLanguage()){ case JAVA: return new JavaBotRunner(botMetaData, timeoutInMilliseconds); case CSHARPCORE: return new CSharpCoreBotRunner(botMetaData, timeoutInMilliseconds); case JAVASCRIPT: return new JavaScriptBotRunner(botMetaData, timeoutInMilliseconds); case RUST: return new RustBotRunner(botMetaData, timeoutInMilliseconds); case CPLUSPLUS: return new CPlusPlusBotRunner(botMetaData, timeoutInMilliseconds); case PYTHON2: return new Python2BotRunner(botMetaData, timeoutInMilliseconds); case PYTHON3: return new Python3BotRunner(botMetaData, timeoutInMilliseconds); case KOTLIN: return new KotlinBotRunner(botMetaData, timeoutInMilliseconds); case CPLUSPLUS return new CPlusPlusBotRunner(botMetaData, timeoutInMilliseconds); default: break;
} throw new InvalidRunnerState(“Invalid bot language”);
}
}
The main issue is that the following code is missing: case PASCAL return new PascalBotRunner(botMetaData, timeoutInMilliseconds);
with PascalBotRunnerexactly exactly the same as CPlusPlusBotRunner.
You will need to provide the bot runner as a pull request to https://github.com/EntelectChallenge/2018-TowerDefence
With this, and a readme of how to compile and run a pascal bot on windows, we can look into adding the bot as a new language
I have already created the pascal starter bot code, bot.json, build.bat and readme.md files and is trying to figure out how to submit them. Do I just add them to the GitHub repository mentioned?