/// <summary> /// Event called by the bot runner when a bot's state changes. /// </summary> /// <param name="bot"></param> /// <param name="newState"></param> private void BotRunner_OnBotStateChange(VTankBot bot, AIFramework.Runner.BotRunner.BotRunnerState newState) { if (newState != BotRunner.BotRunnerState.SelectingTank && OnBotChange != null) { buffer.Enqueue(new Invocation.InvocationTarget((o) => { OnBotChange((VTankBot)o); }), bot); NeedsBalance = true; } buffer.Enqueue(new Invocation((o) => { Print("{0}'s state: {1}", bot.AuthInfo.Username, newState.ToString()); })); }