示例#1
0
        private void SetNumplayers(PlayerPollResult pResult, XElement results)
        {

            string value = results.Attribute("numplayers").Value;
            if (value.Contains("+"))
            {
                pResult.NumPlayersIsAndHigher = true;
            }
            value = value.Replace("+", string.Empty);

            int res = 0;
            int.TryParse(value, out res);

            pResult.NumPlayers = res;
        }
示例#2
0
 private List<PlayerPollResult> LoadPlayerPollResults(XElement xElement)
 {
     List<PlayerPollResult> playerPollResult = new List<PlayerPollResult>();
     if (xElement != null)
     {
         foreach (XElement results in xElement.Elements("results"))
         {
             PlayerPollResult pResult = new PlayerPollResult()
             {
                 Best = GetIntResultScore(results, "Best"),
                 Recommended = GetIntResultScore(results, "Recommended"),
                 NotRecommended = GetIntResultScore(results, "Not Recommended")
             };
             SetNumplayers(pResult, results);
             playerPollResult.Add(pResult);
         }
     }
     return playerPollResult;
 }