1
0
mirror of https://github.com/ppy/osu.git synced 2026-05-27 16:50:08 +08:00

Add xmldocs and return score items.

Return for usage in later PR
This commit is contained in:
iiSaLMaN
2019-07-30 12:35:49 +03:00
Unverified
parent 4874746525
commit 32498d5d50
+17 -7
View File
@@ -40,20 +40,30 @@ namespace osu.Game.Screens.Play
LayoutEasing = Easing.OutQuint;
}
public void AddRealTimePlayer(BindableDouble currentScore, User user = null)
/// <summary>
/// Adds a real-time player score item whose score is updated via a <see cref="BindableDouble"/>.
/// </summary>
/// <param name="currentScore">The bindable current score of the player.</param>
/// <param name="user">The player user.</param>
/// <returns>Returns the drawable score item of that player.</returns>
public InGameScoreItem AddRealTimePlayer(BindableDouble currentScore, User user = null)
{
if (currentScore == null)
return;
return null;
var scoreItem = addScore(currentScore.Value, user);
currentScore.ValueChanged += s => scoreItem.TotalScore = s.NewValue;
return scoreItem;
}
public void AddScore(ScoreInfo score, int? position = null)
{
if (score != null)
addScore(score.TotalScore, score.User, position);
}
/// <summary>
/// Adds a score item based off a <see cref="ScoreInfo"/> with an initial position.
/// </summary>
/// <param name="score">The score info to use for this item.</param>
/// <param name="position">The initial position of this item.</param>
/// <returns>Returns the drawable score item of that player.</returns>
public InGameScoreItem AddScore(ScoreInfo score, int? position = null) => score != null ? addScore(score.TotalScore, score.User, position) : null;
private int maxPosition => this.Where(i => i.ScorePosition.HasValue).Max(i => i.ScorePosition) ?? 0;