private List <HuntInfo> HuntInfosFromJContainer(JContainer jContainer) { var list = new List <HuntInfo>(); foreach (var hunt in jContainer) { HuntInfo info = HuntInfo.FromJObject((JObject)hunt); list.Add(info); } return(list); }
private void OnReceivedStartedHunts(string response) { JObject obj = JObject.Parse(response); if ((int)obj["code"] != 200) { UpdateView(); return; } _startedHunts.Clear(); foreach (JObject startedHunt in obj["data"]) { HuntInfo info = HuntInfo.FromJObject((JObject)startedHunt["hunt_info"]); AddStartedHunt(info, (int)startedHunt["started_hunt"]["current_clue"]); } UpdateView(); }
private void OnReceived_CompletedHunts(string response) { JObject obj = JObject.Parse(response); if ((int)obj["code"] != 200) { UpdateView(); return; } _completedHunts.Clear(); foreach (JObject completedHunt in obj["data"]) { HuntInfo info = HuntInfo.FromJObject((JObject)completedHunt["hunt_info"]); _completedHunts.Add(info); } UpdateView(); }