Exemple #1
0
        public Player(JObject mobilePlayerInfo, JObject playerInfo)
        {
            _playerRatings = new PlayerRatings();
            _playerStats   = new List <Models.PlayerStats>();
            id             = playerInfo.GetValue("playerId").ToString();
            Salary         = Convert.ToInt32(playerInfo.GetValue("contCurrVal").ToString());
            YearsLeft      = Convert.ToInt32(playerInfo.GetValue("contCurrLen").ToString());
            IsTwoWay       = Convert.ToInt32(playerInfo.GetValue("contCurr2Way").ToString()) == 0 ? false : true;
            TradeValue     = Convert.ToInt32(playerInfo.GetValue("tradeValue").ToString());
            Team           = Convert.ToInt32(playerInfo.GetValue("proTeamID").ToString());
            TeamId         = Convert.ToInt32(playerInfo.GetValue("proTeamID").ToString());
            Jersey         = Convert.ToInt32(playerInfo.GetValue("jerseyorg").ToString());
            CountryCode    = Convert.ToInt32(playerInfo.GetValue("intlCountry").ToString());

            var artid = Convert.ToInt32(playerInfo.GetValue("playerArtID").ToString());

            ImageUrl = "http://cdn.content.easports.com/nhlhm_assets/assets/ios/14/GMC/0.0/playerheads/p" + artid + "@2x.png";

            Overall        = Convert.ToInt32(mobilePlayerInfo.GetValue("o").ToString());
            Potential      = Convert.ToInt32(mobilePlayerInfo.GetValue("pp").ToString());
            PotentialColor = Convert.ToInt32(mobilePlayerInfo.GetValue("po").ToString());
            Aid            = Convert.ToInt32(mobilePlayerInfo.GetValue("aid").ToString());

            JObject pBio = mobilePlayerInfo.GetValue("pb") as JObject;

            FirstName = pBio.GetValue("fn").ToString().ToLower();
            LastName  = pBio.GetValue("ln").ToString().ToLower();

            FirstName = char.ToUpper(FirstName[0]) + FirstName.Substring(1);
            LastName  = char.ToUpper(LastName[0]) + LastName.Substring(1);

            Position      = pBio.GetValue("p").ToString();
            Weight        = Convert.ToInt32(pBio.GetValue("w").ToString());
            Height        = Convert.ToInt32(pBio.GetValue("h").ToString());
            Age           = Convert.ToInt32(pBio.GetValue("a").ToString());
            BirthPlace    = pBio.GetValue("bp").ToString();
            DraftRound    = Convert.ToInt32(pBio.GetValue("dr").ToString());
            DraftTeam     = Convert.ToInt32(pBio.GetValue("dt").ToString());
            DraftPosition = Convert.ToInt32(pBio.GetValue("dp").ToString());
            Shoots        = Convert.ToInt32(pBio.GetValue("s").ToString());

            GetPlayerStats(mobilePlayerInfo);
            PopulatePlayerRatings(mobilePlayerInfo);
        }
Exemple #2
0
        public Player(JObject mobilePlayerInfo)
        {
            _playerRatings = new PlayerRatings();
            _playerStats   = new List <Models.PlayerStats>();
            Overall        = Convert.ToInt32(mobilePlayerInfo.GetValue("o").ToString());
            Aid            = Convert.ToInt32(mobilePlayerInfo.GetValue("aid").ToString());
            ImageUrl       = "http://cdn.content.easports.com/nhlhm_assets/assets/ios/0.0/playerheads/" + Aid + "@2x.png";

            JObject pBio = mobilePlayerInfo.GetValue("pb") as JObject;

            FirstName = pBio.GetValue("fn").ToString().ToLower();
            LastName  = pBio.GetValue("ln").ToString().ToLower();

            FirstName = char.ToUpper(FirstName[0]) + FirstName.Substring(1);
            LastName  = char.ToUpper(LastName[0]) + LastName.Substring(1);
            Position  = pBio.GetValue("p").ToString();
            Weight    = Convert.ToInt32(pBio.GetValue("w").ToString());
            Height    = Convert.ToInt32(pBio.GetValue("h").ToString());
            Age       = Convert.ToInt32(pBio.GetValue("a").ToString());
            Shoots    = Convert.ToInt32(pBio.GetValue("s").ToString());

            GetPlayerStats(mobilePlayerInfo);
            PopulatePlayerRatings(mobilePlayerInfo);
        }
Exemple #3
0
 public Player()
 {
     _playerRatings = new PlayerRatings();
     _playerStats   = new List <Models.PlayerStats>();
 }