示例#1
0
        public Group(JObject j)
        {
            Detail = new GroupDetail(j["detail"].Value<JObject>());
            FounderMembershipId = j["founderMembershipId"].Value<int>();
            Founder = new User(j["founder"].Value<JObject>());
            FollowerCount = j["followerCount"].Value<int>();

            CurrentUserStatus = new GroupMembershipStatus(
                j["currentUserStatus"]["membershipStatus"]["Response"].Value<JObject>()
            );

            AlliedIds = new List<int>();
            j["alliedIds"].ForEach(i => AlliedIds.Add(i.Value<int>()));

            Attributes = new List<Attribute>();
            j["attributes"].ForEach(a => Attributes.Add(new Attribute(
                a["attributeId"].Value<int>(),
                a["minValue"].Value<int>(),
                a["maxValue"].Value<int>()
            )));

            MembershipIds = new List<int>();
            j["membershipIds"].ForEach(i => MembershipIds.Add(i.Value<int>()));

            GroupJoinRequestCount = j["groupJoinRequestCount"].Value<int>();
            GroupJoinInviteCount = j["groupJoinInviteCount"].Value<int>();
            ClanJoinRequestCount = j["clanJoinRequestCount"].Value<int>();
            ClanJoinInviteCount = j["clanJoinInviteCount"].Value<int>();
        }
示例#2
0
        public BungieAccount(JObject j)
        {
            DestinyAccounts = new List<DestinyAccount>();

            DestinyAccountResult = j["destinyAccountResult"].Value<int>();

            j["destinyAccounts"].Cast<JObject>().ForEach(p => DestinyAccounts.Add(new DestinyAccount(p)));

            if (j["bungieNetUser"] != null)
            {
                BungieNetUser = new User(j["bungieNetUser"].Value<JObject>());
            }
        }
示例#3
0
        public Notification(JObject j)
        {
            NotifySelf = j["NotifySelf"].Value<bool>();
            CreationDate = j["createdDate"].Value<DateTime>().ToUniversalTime();
            IsNew = j["isNew"].Value<bool>();

            MemberInitiated = j["memberInitiated"] != null
                ? new User(j["memberInitiated"].Value<JObject>())
                : null;

            MemberInitiatedId = j["memberInitiatedId"].Value<int>();
            MembershipId = j["membershipId"].Value<int>();
            NotificationDetail = j["notificationDetail"].Value<string>();
            NotificationType = (NotificationType)j["notificationType"].Value<int>();
            RelatedChildItemId = j["relatedChildItemId"].Value<int>();
            RelatedItemDetail = j["relatedItemDetail"].Value<string>();
            RelatedItemId = j["relatedItemId"].Value<int>();
        }
示例#4
0
		public UserResponse(JObject j) : base(j) {

			if(j["Response"] != null) {
				User = new User(j["Response"].Value<JObject>());
			}
		}