public static void CreateWithSecondBot(Assembly botFrom, IBotSelector botSelector) { Field field = new Field(); AbstractBot secondBot = botSelector.GetBotFromAssembly(botFrom, field, CellState.Tack); IPlayer firstPlayer = new HumanPlayer(field, CellState.Tick); IPlayer secondPlayer = new BotPlayer(secondBot); Instance = new Game(field, firstPlayer, secondPlayer); }
public rndWalker(string[] args) { _thread = new Thread(ExecutingThread); if (args != null) { _botClass = args[0]; } ItemParser.ParseFile("picklist.txt"); var botType = Type.GetType("rndWalker.Bots." + _botClass); if (botType != null) { _bot = (AbstractBot) Activator.CreateInstance(botType); } else { //TODO needfix: this will output the error and stop the bot from running, but the file is still loaded. throw new Exception("Class rndWalker.Bots." + _botClass + " not found. Exiting."); } Game.OnTickEvent += Game_OnTickEvent; Game.OnDrawEvent += Game_OnDrawEvent; }
public BotPlayer(AbstractBot bot) { _bot = bot; }