Exemplo n.º 1
0
        public bool AddRatingList(TypeOfSport game, PlayerRating[] ratings)
        {
            RatingNode node = new RatingNode();

            node.Game = game;
            node.Ratings.Clear();
            node.Ratings.AddRange(ratings);
            Ratings.Add(node);
            return(true);
        }
Exemplo n.º 2
0
        private string RatingToXml(RatingNode node)
        {
            StringBuilder str         = new StringBuilder();
            string        rating_date = "";

            foreach (PlayerRating rating in node.Ratings)
            {
                if (rating.LastRatingDate == DateTime.MinValue)
                {
                    rating_date = "";
                }
                else
                {
                    rating_date = rating.LastRatingDate.ToString("yyyyMMdd");
                }
                str.Append(String.Format("<PLAYER_RATING guid='{0}' name='{1}' date='{2}' start='{3}' current='{4}'/>", rating.Guid, rating.Name, rating_date, rating.RatingBegin, rating.Rating));
            }
            return(String.Format("<RATING id='{0}' name='{1}'> {2} </RATING>", node.Game.Id, node.Game.Name, str.ToString()));
        }