Add ability to load long comment trees in CommentsContainer

This commit is contained in:
Andrei Zavatski
2020-02-10 15:43:11 +03:00
parent 6a38f4d13d
commit 26afe0f31e
9 changed files with 420 additions and 213 deletions

View File

@ -9,31 +9,8 @@ namespace osu.Game.Online.API.Requests.Responses
{
public class CommentBundle
{
private List<Comment> comments;
[JsonProperty(@"comments")]
public List<Comment> Comments
{
get => comments;
set
{
comments = value;
comments.ForEach(child =>
{
if (child.ParentId != null)
{
comments.ForEach(parent =>
{
if (parent.Id == child.ParentId)
{
parent.ChildComments.Add(child);
child.ParentComment = parent;
}
});
}
});
}
}
public List<Comment> Comments { get; set; }
[JsonProperty(@"has_more")]
public bool HasMore { get; set; }