// Copyright (c) ppy Pty Ltd . Licensed under the MIT Licence. // See the LICENCE file in the repository root for full licence text. using JetBrains.Annotations; using osu.Game.Rulesets.Objects; using osuTK; namespace osu.Game.Rulesets.Scoring { /// /// A generated by the containing extra statistics around a . /// public readonly struct HitEvent { /// /// The time offset from the end of at which the event occurred. /// public readonly double TimeOffset; /// /// The hit result. /// public readonly HitResult Result; /// /// The on which the result occurred. /// public readonly HitObject HitObject; /// /// The occurring prior to . /// [CanBeNull] public readonly HitObject LastHitObject; /// /// A position, if available, at the time of the event. /// [CanBeNull] public readonly Vector2? Position; /// /// Creates a new . /// /// The time offset from the end of at which the event occurs. /// The . /// The that triggered the event. /// The previous . /// A position corresponding to the event. public HitEvent(double timeOffset, HitResult result, HitObject hitObject, [CanBeNull] HitObject lastHitObject, [CanBeNull] Vector2? position) { TimeOffset = timeOffset; Result = result; HitObject = hitObject; LastHitObject = lastHitObject; Position = position; } /// /// Creates a new with an optional positional offset. /// /// The positional offset. /// The new . public HitEvent With(Vector2? positionOffset) => new HitEvent(TimeOffset, Result, HitObject, LastHitObject, positionOffset); } }