Example #1
0
        /// <summary>
        /// Parse line and add to SteamSpyView.
        /// </summary>
        /// <param name="line">Line to parse.</param>
        /// <returns>Item.</returns>
        static protected SteamSpyItem ParseLine(string line)
        {
            if (string.IsNullOrEmpty(line))
            {
                return(null);
            }

            var info = line.Split('\t');

            var item = new SteamSpyItem()
            {
                Name      = info[0],
                ScoreRank = (string.IsNullOrEmpty(info[1])) ? -1 : int.Parse(info[1]),

                Owners         = int.Parse(info[2]),
                OwnersVariance = int.Parse(info[3]),

                Players         = int.Parse(info[4]),
                PlayersVariance = int.Parse(info[5]),

                PlayersIn2Week         = int.Parse(info[6]),
                PlayersIn2WeekVariance = int.Parse(info[7]),

                AverageTimeIn2Weeks = int.Parse(info[8]),
                MedianTimeIn2Weeks  = int.Parse(info[9]),
            };

            return(item);
        }
Example #2
0
        public void SetData(SteamSpyItem item)
        {
            //Item = item;

            Name.text = item.Name;

            TooltipText.text = item.Name;

            ScoreRank.text = (item.ScoreRank == -1) ? string.Empty : item.ScoreRank.ToString();

            Owners.text = item.Owners.ToString("N0") + "\n±" + item.OwnersVariance.ToString("N0");

            Players.text = item.Players.ToString("N0") + "\n±" + item.PlayersVariance.ToString("N0");

            PlayersIn2Week.text = item.PlayersIn2Week.ToString("N0") + "\n±" + item.PlayersIn2WeekVariance.ToString("N0");

            TimeIn2Week.text = Minutes2String(item.AverageTimeIn2Weeks) + "\n(" + Minutes2String(item.MedianTimeIn2Weeks) + ")";
        }
		public void SetData(SteamSpyItem item)
		{
			//Item = item;
			
			Name.text = item.Name;

			TooltipText.text = item.Name;

			ScoreRank.text = (item.ScoreRank==-1) ? string.Empty : item.ScoreRank.ToString();

			Owners.text = item.Owners.ToString("N") + "\n±" + item.OwnersVariance.ToString("N");

			Players.text = item.Players.ToString("N") + "\n±" + item.PlayersVariance.ToString("N");

			PlayersIn2Week.text = item.PlayersIn2Week.ToString("N") + "\n±" + item.PlayersIn2WeekVariance.ToString("N");

			TimeIn2Week.text = Minutes2String(item.AverageTimeIn2Weeks) + "\n(" + Minutes2String(item.MedianTimeIn2Weeks) + ")";
		}