Beispiel #1
0
        public async Task <List <Items> > getRandomItem(Gods god)
        {
            //List<Items> temp1 = null;
            List <Items> temp2 = null;

            Console.WriteLine(god.Type + ":" + items[0].RootItemId);
            var item = items.Where(x => x.Type == god.Type).ToList();

            foreach (Items i in item)
            {
                Console.WriteLine(i.DeviceName);
            }
            int r = 0;

            //foreach (Items i in items)
            //{
            //    if (i.Type == god.Type)
            //        temp1.Add(i);
            //}
            Console.WriteLine(item.ToString());
            for (int i = 0; i < 6; i++)
            {
                /*r = random.Next(await item.Count());
                 * if(temp2.Contains(await item.ElementAt(r)))
                 * {
                 *  i--;
                 *  continue;
                 * }
                 * Console.WriteLine("Adding: " + item.ElementAt(r));
                 * temp2.Add(await item.ElementAt(r));*/
            }

            return(temp2);
        }
Beispiel #2
0
 public async Task SmiteCommand(string param = "")
 {
     if (param.ToLower().Equals("random"))
     {
         Gods god = smite.getRandomGod();
         await audio.SendTextAsync(Context, god.Name);
     }
     else if (param.ToLower().Equals("refresh"))
     {
         await smite.CreateSession();
     }
     else
     {
         await audio.SendTextAsync(Context, "Invalid parameter!");
     }
 }