public static DrillReward Parse(JToken token) { var result = new DrillReward(); result.Award = (int)token["award"]; result.Name = (string)token["name"]; return(result); }
public static DrillResult Parse(JToken token) { var reward = token["reward"]; if (reward == null) { return(null); } var result = new DrillResult(); var rewards = new List <DrillReward>(); var totalItemList = (JArray)reward["totalItemList"]; foreach (JToken subToken in totalItemList) { rewards.Add(DrillReward.Parse(subToken)); } result.Rewards = rewards; return(result); }