public void StartBattle() { CheckForSupportInjection(); b.Assert.True(botSupportActivity != null, "Engine/Start Battle - You can not start a battle without an form of BotSupport"); b.Assert.True(botSupportQuery != null, "Engine/Start Battle - You can not start a battle without an form of BotSupport"); EachBot((mappedBot) => { Guid g = GetPublicIdFromPrivateId(mappedBot.EngineId); b.Info.Log("Preparing Bot " + mappedBot.Bot.Name + " Granting Guid: " + g.ToString()); PerformEngineInitOnBot(mappedBot); mappedBot.Bot.PrepareForBattle(botSupportActivity, botSupportQuery, g); PerformBotInitialisation(mappedBot); SystemMessageContext smc = new SystemMessageContext(); smc.BotId = mappedBot.EngineId; smc.Message = mappedBot.Bot.FanfareMessage; hub.Launch <Message_Ui>(new Message_Ui(MainMessageKind.UIMessage, KnownSubkinds.BotFanfareOccurred) { RequestContext = smc, }); }); // Defaults allow the main loop to tick over to turn 1 tick 0 on first increment. Turn = 0; Tick = 10; HavePrepared = true; }
private void BattleStarts() { BattleActive = true; SystemMessageContext smc = new SystemMessageContext(); smc.BotId = -1; smc.Message = "Let Battle Commence...."; hub.Launch <Message_Game>(new Message_Game(MainMessageKind.GameStructure, KnownSubkinds.BattleStarts) { RequestContext = smc }); activeData = new ActiveTurnData(); }