Beispiel #1
0
        /// <summary>
        /// Gets ids of all friends of local user and displays their records.
        /// This also includes local user.
        /// </summary>
        public async void ShowFriendsLeaderboards(string cursor)
        {
            var friends = await FriendsManager.LoadFriendsAsync(Client, Session);

            if (friends == null)
            {
                return;
            }
            IApiLeaderboardRecordList records = await LeaderboardManager.GetFriendsLeaderboarsAsync(Client, Session, friends.Friends, _recordsPerPage, cursor);

            if (records != null)
            {
                SetLeaderboardsCursor(records, ShowFriendsLeaderboards);
                FillLeaderboard(records.OwnerRecords);

                _showFriends.interactable = false;
                _showClan.interactable    = true;
                _showGlobal.interactable  = true;
            }
        }
Beispiel #2
0
        /// <summary>
        /// Fills <see cref="_userList"/> with records of all members of the clan local user belongs to.
        /// </summary>
        public async void ShowClanLeaderboards(string cursor)
        {
            IUserGroupListUserGroup clan = await ClanManager.GetUserClanAsync(Client, Session);

            if (clan == null)
            {
                return;
            }
            IApiLeaderboardRecordList records = await LeaderboardManager.GetClanLeaderboarsAsync(Client, Session, clan.Group, _recordsPerPage, cursor);

            if (records != null)
            {
                SetLeaderboardsCursor(records, ShowClanLeaderboards);
                FillLeaderboard(records.OwnerRecords);

                _showFriends.interactable = true;
                _showClan.interactable    = false;
                _showGlobal.interactable  = true;
            }
        }