예제 #1
0
 internal static Group Create(SteamCommunityClient client, Model model)
 {
     return(new Group()
     {
         Id = model.GroupId64,
         Details = GroupDetails.Create(client, model.GroupId64, model.GroupDetails),
         MemberCount = model.MemberCount,
         TotalPages = model.TotalPages,
         CurrentPage = model.CurrentPage,
         StartingMember = model.StartingMember,
         NextPageLink = model.NextPageLink,
         Members = model.Members,
         Client = client
     });
 }
예제 #2
0
        internal static Profile Create(SteamCommunityClient client, Model model)
        {
            var games  = new List <IMostPlayedGame>();
            var groups = new List <IGroupDetails>();

            foreach (var item in model.MostPlayedGames)
            {
                games.Add(MostPlayedGame.Create(item));
            }
            foreach (var item in model.Groups)
            {
                groups.Add(GroupDetails.Create(client, item));
            }

            return(new Profile()
            {
                Id = model.SteamId64,
                Name = model.SteamId,
                State = (OnlineState)Enum.Parse(typeof(OnlineState), model.OnlineState.Replace("-", string.Empty), true),
                StateMessage = model.StateMessage,
                Privacy = (PrivacyState)Enum.Parse(typeof(PrivacyState), model.PrivacyState, true),
                VisibilityState = model.VisibilityState,
                AvatarIcon = model.AvatarIcon,
                AvatarMedium = model.AvatarMedium,
                AvatarFull = model.AvatarFull,
                IsVacBanned = model.VacBanned != 0,
                TradeBan = (TradeBanState)Enum.Parse(typeof(TradeBanState), model.TradeBanState, true),
                IsLimitedAccount = model.IsLimitedAccount != 0,
                CustomUrl = model.CustomUrl,
                MemberSince = model.MemberSince,
                HoursPlayedPastWeeks = (!string.IsNullOrEmpty(model.HoursPlayed2Wk))
                                        ? float.Parse(model.HoursPlayed2Wk)
                                        : 0f,
                Headline = model.Headline,
                Location = model.Location,
                Realname = model.Realname,
                Summary = model.Summary,
                MostPlayedGames = games,
                Groups = groups,
                Client = client
            });
        }