Create API request and reponse model.

This commit is contained in:
naoey
2018-02-25 19:18:39 +05:30
parent c701b8eae5
commit e3a1b07172
5 changed files with 165 additions and 3 deletions

View File

@ -0,0 +1,63 @@
using osu.Framework.Configuration;
using osu.Game.Online.API.Requests;
using osu.Game.Users;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace osu.Game.Overlays.Profile.Sections
{
class PaginatedRecentActivityContainer : PaginatedContainer
{
public PaginatedRecentActivityContainer(Bindable<User> user, string header, string missing)
: base(user, header, missing)
{
ItemsPerPage = 5;
}
//protected override void ShowMore()
//{
// base.ShowMore();
// var req = new GetUserRecentActivitiesRequest(User.Value.Id, VisiblePages++ * ItemsPerPage);
// req.Success += scores =>
// {
// foreach (var s in scores)
// s.ApplyRuleset(Rulesets.GetRuleset(s.OnlineRulesetID));
// ShowMoreButton.FadeTo(scores.Count == ItemsPerPage ? 1 : 0);
// ShowMoreLoading.Hide();
// if (!scores.Any() && VisiblePages == 1)
// {
// MissingText.Show();
// return;
// }
// MissingText.Hide();
// foreach (OnlineScore score in scores)
// {
// DrawableProfileScore drawableScore;
// switch (type)
// {
// default:
// drawableScore = new DrawablePerformanceScore(score, includeWeight ? Math.Pow(0.95, ItemsContainer.Count) : (double?)null);
// break;
// case ScoreType.Recent:
// drawableScore = new DrawableTotalScore(score);
// break;
// }
// ItemsContainer.Add(drawableScore);
// }
// };
// Api.Queue(req);
//}
}
}