예제 #1
0
파일: WeaveTeam.cs 프로젝트: enrevol/tqtk
        public static WeaveTeam Parse(JToken token)
        {
            var result = new WeaveTeam();

            result.CriticalRate   = (string)token["baojirate"];
            result.Cost           = (int)token["cost"];
            result.desc           = (string)token["desc"];
            result.legion         = (int)token["legion"];
            result.Level          = (int)token["level"];
            result.limit          = (int)token["limit"];
            result.limitlv        = (int)token["limitlv"];
            result.MaxPlayerCount = (int)token["maxnum"];
            result.mnation        = (int)token["mnation"];
            result.nation         = (int)token["nation"];
            result.PlayerCount    = (int)token["num"];
            result.Price          = (int)token["price"];
            result.product        = (string)token["product"];
            result.SuccessRate    = (string)token["succrate"];
            result.Id             = (int)token["teamid"];
            result.Name           = (string)token["teamname"];
            return(result);
        }
예제 #2
0
파일: WeaveInfo.cs 프로젝트: enrevol/tqtk
        public static WeaveInfo Parse(JToken token)
        {
            var message = token["message"];

            if (message != null)
            {
                // Chưa đủ lv 82.
                return(null);
            }

            var result = new WeaveInfo();

            var baseinfo = token["baseinfo"];

            result.Level        = (int)baseinfo["totallevel"];
            result.Turns        = (int)baseinfo["num"];
            result.MaxTurns     = (int)baseinfo["maxnum"];
            result.Price        = (int)baseinfo["price"];
            result.PriceWay     = (WeavePriceWay)(int)baseinfo["priceway"];
            result.SuccessRate  = (int)baseinfo["succrate"];
            result.CriticalRate = (int)baseinfo["baojirate"];
            result.gold         = (int)baseinfo["gold"];

            var teamList = token["teamList"];
            var teams    = new List <WeaveTeam>();

            foreach (var teamToken in teamList)
            {
                var team = WeaveTeam.Parse(teamToken);
                teams.Add(team);
            }
            result.Teams = teams;

            var makecd = (int)token["makecd"];

            result.cooldown = new Cooldown(makecd);

            return(result);
        }