public string getAnswerKeyboard(mod_xyzzy_coredata localData) { List<string> answers = new List<string>(); foreach (string cardID in cardsInHand) { mod_xyzzy_card c = localData.getAnswerCard(cardID); answers.Add(c.text); } return (TelegramAPI.createKeyboard(answers,1)); }
public string getAnswerKeyboard(mod_xyzzy_coredata localData) { List<string> answers = new List<string>(); List<string> invalidCards = new List<string>(); foreach (string cardID in cardsInHand) { mod_xyzzy_card c = localData.getAnswerCard(cardID); if (c != null) { answers.Add(c.text); } else { Roboto.log.log("Answer card " + cardID + " not found! Removing from " + name + "'s hand", logging.loglevel.critical); invalidCards.Add(cardID); } } //remove any invalid cards foreach(string cardID in invalidCards) { cardsInHand.Remove(cardID); } return (TelegramAPI.createKeyboard(answers,1)); }
public override void initData() { try { localData = Roboto.Settings.getPluginData<mod_xyzzy_coredata>(); } catch (InvalidDataException) { //Data doesnt exist, create, populate with sample data and register for saving localData = new mod_xyzzy_coredata(); sampleData(); Roboto.Settings.registerData(localData); } Console.WriteLine(localData.questions.Count.ToString() + " questions and " + localData.answers.Count.ToString() + " answers loaded for xyzzy"); }
public override void initData() { try { localData = Roboto.Settings.getPluginData<mod_xyzzy_coredata>(); } catch (InvalidDataException) { //Data doesnt exist, create, populate with sample data and register for saving localData = new mod_xyzzy_coredata(); sampleData(); Roboto.Settings.registerData(localData); } Roboto.Settings.stats.registerStatType("New Games Started", this.GetType(), System.Drawing.Color.Aqua); Roboto.Settings.stats.registerStatType("Games Ended", this.GetType(), System.Drawing.Color.Orange); Roboto.Settings.stats.registerStatType("Hands Played", this.GetType(), System.Drawing.Color.Olive); Roboto.Settings.stats.registerStatType("Packs Synced", this.GetType(), System.Drawing.Color.DarkBlue ); Roboto.Settings.stats.registerStatType("Bad Responses", this.GetType(), System.Drawing.Color.Olive); Roboto.Settings.stats.registerStatType("Active Games", this.GetType(), System.Drawing.Color.Green, stats.displaymode.line, stats.statmode.absolute); Roboto.Settings.stats.registerStatType("Active Players", this.GetType(), System.Drawing.Color.Blue, stats.displaymode.line, stats.statmode.absolute); Roboto.Settings.stats.registerStatType("Background Wait", this.GetType(), System.Drawing.Color.Red, stats.displaymode.line, stats.statmode.absolute); Roboto.Settings.stats.registerStatType("Background Wait (Quickcheck)", this.GetType(), System.Drawing.Color.Red, stats.displaymode.line, stats.statmode.absolute); Console.WriteLine(localData.questions.Count.ToString() + " questions and " + localData.answers.Count.ToString() + " answers loaded for xyzzy"); }