コード例 #1
0
        /// <summary>
        /// Gets a list of Enemy Groups.
        /// </summary>
        /// <returns>List of Enemy groups.</returns>
        public async Task <Group[]> GetEnemies()
        {
            int          c      = 1;
            List <Group> allies = new List <Group>();

            while (c < 1000)
            {
                GroupResult_t res = await GetEnemyPage(c);

                allies.AddRange(res.Groups);
                c++;
                if (res.FinalPage)
                {
                    break;
                }
            }
            return(allies.ToArray());
        }
コード例 #2
0
        /// <summary>
        /// Gets a list of Allied Groups.
        /// </summary>
        /// <returns>List of allied groups.</returns>
        public async Task <Group[]> GetAllies()
        {
            int          c      = 1;
            List <Group> allies = new List <Group>();

            while (c < 1000)
            {
                GroupResult_t res = await GetAllyPage(c);

                Console.WriteLine("{0} {1}", res.FinalPage, c);
                foreach (Group g in res.Groups)
                {
                    allies.Add(g);
                }
                c++;
                if (res.FinalPage)
                {
                    break;
                }
            }
            return(allies.ToArray());
        }