More xmldocs to hitobject/drawablehitobject

This commit is contained in:
smoogipoo 2018-08-06 10:55:38 +09:00
parent 5fd4ed2f4e
commit b35817c877
4 changed files with 32 additions and 8 deletions

View File

@ -1,10 +1,14 @@
// Copyright (c) 2007-2018 ppy Pty Ltd <contact@ppy.sh>.
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
using osu.Game.Rulesets.Objects;
using osu.Game.Rulesets.Scoring;
namespace osu.Game.Rulesets.Judgements
{
/// <summary>
/// The scoring information provided by a <see cref="HitObject"/>.
/// </summary>
public class Judgement
{
/// <summary>

View File

@ -1,10 +1,14 @@
// Copyright (c) 2007-2018 ppy Pty Ltd <contact@ppy.sh>.
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
using osu.Game.Rulesets.Objects.Drawables;
using osu.Game.Rulesets.Scoring;
namespace osu.Game.Rulesets.Judgements
{
/// <summary>
/// The scoring result of a <see cref="DrawableHitObject"/>.
/// </summary>
public class JudgementResult
{
/// <summary>
@ -19,22 +23,22 @@ namespace osu.Game.Rulesets.Judgements
/// <summary>
/// The offset from a perfect hit at which this <see cref="JudgementResult"/> occurred.
/// Populated when added via <see cref="DrawableHitObject.ApplyJudgement"/>.
/// Populated when this <see cref="JudgementResult"/> is applied via <see cref="DrawableHitObject.ApplyResult"/>.
/// </summary>
public double TimeOffset { get; internal set; }
/// <summary>
/// The combo prior to this judgement occurring.
/// The combo prior to this <see cref="JudgementResult"/> occurring.
/// </summary>
public int ComboAtJudgement { get; internal set; }
/// <summary>
/// The highest combo achieved prior to this judgement occurring.
/// The highest combo achieved prior to this <see cref="JudgementResult"/> occurring.
/// </summary>
public int HighestComboAtJudgement { get; internal set; }
/// <summary>
/// Whether this <see cref="Judgement"/> has a result.
/// Whether a miss or hit occurred.
/// </summary>
public bool HasResult => Type > HitResult.None;
@ -43,6 +47,10 @@ namespace osu.Game.Rulesets.Judgements
/// </summary>
public bool IsHit => Type > HitResult.Miss;
/// <summary>
/// Creates a new <see cref="JudgementResult"/>.
/// </summary>
/// <param name="judgement">The <see cref="Judgement"/> to refer to for scoring information.</param>
public JudgementResult(Judgement judgement)
{
Judgement = judgement;

View File

@ -67,6 +67,9 @@ namespace osu.Game.Rulesets.Objects.Drawables
/// </summary>
public bool Judged => Result?.HasResult ?? true;
/// <summary>
/// The scoring result of this <see cref="DrawableHitObject"/>.
/// </summary>
public readonly JudgementResult Result;
private bool judgementOccurred;
@ -177,9 +180,10 @@ namespace osu.Game.Rulesets.Objects.Drawables
}
/// <summary>
/// Notifies that a new judgement has occurred for this <see cref="DrawableHitObject"/>.
/// Applies the <see cref="Result"/> of this <see cref="DrawableHitObject"/>, notifying responders such as
/// the <see cref="ScoreProcessor"/> of the <see cref="JudgementResult"/>.
/// </summary>
/// <param name="judgement">The <see cref="Judgement"/>.</param>
/// <param name="application">The callback that applies changes to the <see cref="JudgementResult"/>.</param>
protected void ApplyResult(Action<JudgementResult> application)
{
application?.Invoke(Result);
@ -240,6 +244,10 @@ namespace osu.Game.Rulesets.Objects.Drawables
{
}
/// <summary>
/// Creates the <see cref="JudgementResult"/> that represents the scoring result for this <see cref="DrawableHitObject"/>.
/// </summary>
/// <param name="judgement">The <see cref="Judgement"/> that provides the scoring information.</param>
protected virtual JudgementResult CreateJudgementResult(Judgement judgement) => new JudgementResult(judgement);
}

View File

@ -108,10 +108,14 @@ namespace osu.Game.Rulesets.Objects
{
}
protected virtual Judgement CreateJudgement() => null;
protected void AddNested(HitObject hitObject) => nestedHitObjects.Value.Add(hitObject);
/// <summary>
/// Creates the <see cref="Judgement"/> that represents the scoring information for this <see cref="HitObject"/>.
/// May be null.
/// </summary>
protected virtual Judgement CreateJudgement() => null;
/// <summary>
/// Creates the <see cref="HitWindows"/> for this <see cref="HitObject"/>.
/// This can be null to indicate that the <see cref="HitObject"/> has no <see cref="HitWindows"/>.