Exemplo n.º 1
0
        public static ArenaPlayer Parse(JToken token)
        {
            var result = new ArenaPlayer();

            result.awardLevel      = (int)token["awardLevel"];
            result.awardName       = (string)token["awardName"];
            result.awardnum        = (int)token["awardnum"];
            result.Cascade         = (int)token["cascade"];
            result.cascadeRewards  = (int)token["cascadeRewards"];
            result.countDownRemain = (int)token["countDownRemain"];
            result.Level           = (int)token["level"];
            result.Nation          = (string)token["nation"];
            result.Id          = (long)token["playerId"];
            result.Name        = (string)token["playerName"];
            result.Rank        = (int)token["rank"];
            result.RemainTimes = (int)token["remainTimes"];
            result.TopCascade  = (int)token["topestCascade"];
            result.TopRank     = (int)token["topestRank"];
            return(result);
        }
Exemplo n.º 2
0
        public static ArenaInfo Parse(JToken token)
        {
            var result = new ArenaInfo();

            result.Players = new List <ArenaPlayer>();
            var rankList = (JArray)token["rankList"];

            foreach (var rank in rankList)
            {
                var player = ArenaPlayer.Parse(rank);
                result.Players.Add(player);
            }

            var playerInfo = token["playerInfo"];

            result.CurrentPlayer = ArenaPlayer.Parse(playerInfo);

            var cd = (int)token["cd"];  // seconds.

            result.cooldown = new Cooldown(cd * 1000);

            return(result);
        }