public static BotBase GetCurrentBotBase() { BotBase bot = TreeRoot.Current; if (bot != null) { if ((bot is NewMixedMode.MixedModeEx)) { NewMixedMode.MixedModeEx mmb = (NewMixedMode.MixedModeEx)bot; if (mmb != null) { if (mmb.SecondaryBot != null && mmb.SecondaryBot.RequirementsMet) { bot = mmb.SecondaryBot; } else { bot = mmb.PrimaryBot; } } } } return(bot); }
public static BotBase GetBot() { BotBase bot = null; if (TreeRoot.Current != null) { if (!(TreeRoot.Current is NewMixedMode.MixedModeEx)) { bot = TreeRoot.Current; } else { NewMixedMode.MixedModeEx mmb = (NewMixedMode.MixedModeEx)TreeRoot.Current; if (mmb != null) { string sPrimary = mmb.PrimaryBot != null ? mmb.PrimaryBot.Name : "[primary null]"; string sSecondary = mmb.SecondaryBot != null ? mmb.SecondaryBot.Name : "[secondary null]"; if (CurrentWoWContext == WoWContext.Battlegrounds || CurrentWoWContext == WoWContext.Instances) { bot = mmb.SecondaryBot; } else { bot = mmb.PrimaryBot; } } } } return(bot); }
public static string GetBotName() { BotBase bot = null; if (TreeRoot.Current != null) { if (!(TreeRoot.Current is NewMixedMode.MixedModeEx)) { bot = TreeRoot.Current; } else { NewMixedMode.MixedModeEx mmb = (NewMixedMode.MixedModeEx)TreeRoot.Current; if (mmb != null) { if (mmb.SecondaryBot != null && mmb.SecondaryBot.RequirementsMet) { return("Mixed:" + mmb.SecondaryBot.Name); } return(mmb.PrimaryBot != null ? "Mixed:" + mmb.PrimaryBot.Name : "Mixed:[primary null]"); } } } return(bot == null ? "(null)" : bot.Name); }