예제 #1
0
        internal static MonsterList GetUserMonsterListFromJson(JObject jObject, int number = -1)
        {
            if (jObject == null)
            {
                return(NewListUser(number));
            }

            MonsterList ret = new MonsterList();

            try
            {
                JArray Array = jObject["monsters"].ToObject <JArray>();

                int i = 0;
                foreach (JObject monster in Array)
                {
                    if (i == number)
                    {
                        break;
                    }
                    ret.Add(Monster.GetUserMonster(monster));
                    i++;
                }
            }
            catch (Exception ex)
            {
                Debug.WriteLine("GetMonsterListFromJson :" + ex.ToString());
            }
            return(ret);
        }
예제 #2
0
        private static MonsterList NewListUser(int number)
        {
            MonsterList list = new MonsterList();

            for (int i = 0; i < number; i++)
            {
                list.Add(Monster.GetUserMonster(i));
            }
            return(list);
        }
예제 #3
0
        internal static MonsterList GetMonsterListFromJson(JObject jObject, int number = -1)
        {
            if (jObject == null)
                return NewList(number);

            MonsterList ret = new MonsterList();
            try
            {
                JArray Array = jObject["monsters"].ToObject<JArray>();

                int i = 0;
                foreach (JObject monster in Array)
                {
                    if (i == number)
                        break;
                    ret.Add(Monster.GetMonster(monster));
                    i++;
                }
            }
            catch (Exception ex)
            {
                Debug.WriteLine("GetMonsterListFromJson :" + ex.ToString());
            }
            return ret;
        }
예제 #4
0
 private static MonsterList NewListUser(int number)
 {
     MonsterList list = new MonsterList();
     for (int i = 0; i < number; i++)
     {
         list.Add(Monster.GetUserMonster(i));
     }
     return list;
 }