Пример #1
0
        public static DrillReward Parse(JToken token)
        {
            var result = new DrillReward();

            result.Award = (int)token["award"];
            result.Name  = (string)token["name"];
            return(result);
        }
Пример #2
0
        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);
        }