osu/osu.Game/Rulesets/Difficulty/Preprocessing/DifficultyHitObject.cs

42 lines
1.7 KiB
C#
Raw Normal View History

// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.
// See the LICENCE file in the repository root for full licence text.
using osu.Game.Rulesets.Objects;
namespace osu.Game.Rulesets.Difficulty.Preprocessing
{
2019-02-19 05:30:59 +00:00
/// <summary>
/// Wraps a <see cref="HitObject"/> and provides additional information to be used for difficulty calculation.
/// </summary>
public class DifficultyHitObject
{
/// <summary>
2019-02-19 05:30:59 +00:00
/// The <see cref="HitObject"/> this <see cref="DifficultyHitObject"/> wraps.
/// </summary>
2019-02-19 05:30:59 +00:00
public readonly HitObject BaseObject;
/// <summary>
2019-02-19 05:30:59 +00:00
/// The last <see cref="HitObject"/> which occurs before <see cref="BaseObject"/>.
/// </summary>
2019-02-19 05:30:59 +00:00
public readonly HitObject LastObject;
/// <summary>
2019-02-19 05:30:59 +00:00
/// Amount of time elapsed between <see cref="BaseObject"/> and <see cref="LastObject"/>.
/// </summary>
2019-02-19 05:30:59 +00:00
public readonly double DeltaTime;
2019-02-19 05:30:59 +00:00
/// <summary>
/// Creates a new <see cref="DifficultyHitObject"/>.
/// </summary>
/// <param name="hitObject">The <see cref="HitObject"/> which this <see cref="DifficultyHitObject"/> wraps.</param>
/// <param name="lastObject">The last <see cref="HitObject"/> which occurs before <paramref name="hitObject"/> in the beatmap.</param>
/// <param name="clockRate">The rate at which the gameplay clock is run at.</param>
2019-02-19 05:29:23 +00:00
public DifficultyHitObject(HitObject hitObject, HitObject lastObject, double clockRate)
{
BaseObject = hitObject;
LastObject = lastObject;
2019-02-19 05:29:23 +00:00
DeltaTime = (hitObject.StartTime - lastObject.StartTime) / clockRate;
}
}
}