mirror of
https://github.com/osukey/osukey.git
synced 2025-08-06 16:13:57 +09:00
Rename method
This commit is contained in:
@ -76,28 +76,28 @@ namespace osu.Game.Overlays.Comments
|
|||||||
var orphaned = new List<Comment>();
|
var orphaned = new List<Comment>();
|
||||||
|
|
||||||
foreach (var topLevel in bundle.Comments)
|
foreach (var topLevel in bundle.Comments)
|
||||||
add(topLevel);
|
addNewComment(topLevel);
|
||||||
|
|
||||||
foreach (var child in bundle.IncludedComments)
|
foreach (var child in bundle.IncludedComments)
|
||||||
add(child);
|
|
||||||
{
|
{
|
||||||
// Included comments can contain the parent comment, which already exists in the hierarchy.
|
// Included comments can contain the parent comment, which already exists in the hierarchy.
|
||||||
if (commentDictionary.ContainsKey(child.Id))
|
if (commentDictionary.ContainsKey(child.Id))
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
|
addNewComment(child);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Comments whose parents did not previously have corresponding drawables, are now guaranteed that their parents have corresponding drawables.
|
// Comments whose parents did not previously have corresponding drawables, are now guaranteed that their parents have corresponding drawables.
|
||||||
foreach (var o in orphaned)
|
foreach (var o in orphaned)
|
||||||
add(o);
|
addNewComment(o);
|
||||||
|
|
||||||
void add(Comment comment)
|
void addNewComment(Comment comment)
|
||||||
{
|
{
|
||||||
var drawableComment = getDrawableComment(comment);
|
var drawableComment = getDrawableComment(comment);
|
||||||
|
|
||||||
if (comment.ParentId == null)
|
if (comment.ParentId == null)
|
||||||
{
|
{
|
||||||
// Comment that has no parent is added as a top-level comment to the flow.
|
// Comments that have no parent are added as top-level comments to the flow.
|
||||||
flow.Add(drawableComment);
|
flow.Add(drawableComment);
|
||||||
}
|
}
|
||||||
else if (commentDictionary.TryGetValue(comment.ParentId.Value, out var parentDrawable))
|
else if (commentDictionary.TryGetValue(comment.ParentId.Value, out var parentDrawable))
|
||||||
|
Reference in New Issue
Block a user