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); }
private static MonsterList NewListUser(int number) { MonsterList list = new MonsterList(); for (int i = 0; i < number; i++) { list.Add(Monster.GetUserMonster(i)); } return(list); }
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; }
private static MonsterList NewListUser(int number) { MonsterList list = new MonsterList(); for (int i = 0; i < number; i++) { list.Add(Monster.GetUserMonster(i)); } return list; }