2019-02-18 05:46:32 +00:00
|
|
|
// 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 System;
|
2022-05-22 15:26:22 +00:00
|
|
|
using System.Collections.Generic;
|
2019-02-18 05:46:32 +00:00
|
|
|
using osu.Game.Rulesets.Catch.Objects;
|
|
|
|
using osu.Game.Rulesets.Difficulty.Preprocessing;
|
|
|
|
using osu.Game.Rulesets.Objects;
|
|
|
|
|
|
|
|
namespace osu.Game.Rulesets.Catch.Difficulty.Preprocessing
|
|
|
|
{
|
|
|
|
public class CatchDifficultyHitObject : DifficultyHitObject
|
|
|
|
{
|
|
|
|
private const float normalized_hitobject_radius = 41.0f;
|
|
|
|
|
2020-11-24 10:57:37 +00:00
|
|
|
public new PalpableCatchHitObject BaseObject => (PalpableCatchHitObject)base.BaseObject;
|
2019-02-18 05:46:32 +00:00
|
|
|
|
2020-11-24 10:57:37 +00:00
|
|
|
public new PalpableCatchHitObject LastObject => (PalpableCatchHitObject)base.LastObject;
|
2019-02-16 02:11:31 +00:00
|
|
|
|
|
|
|
public readonly float NormalizedPosition;
|
2019-02-20 05:13:54 +00:00
|
|
|
public readonly float LastNormalizedPosition;
|
2019-02-16 02:11:31 +00:00
|
|
|
|
2019-02-18 05:46:32 +00:00
|
|
|
/// <summary>
|
2019-03-06 05:36:30 +00:00
|
|
|
/// Milliseconds elapsed since the start time of the previous <see cref="CatchDifficultyHitObject"/>, with a minimum of 40ms.
|
2019-02-18 05:46:32 +00:00
|
|
|
/// </summary>
|
|
|
|
public readonly double StrainTime;
|
2020-04-08 03:19:09 +00:00
|
|
|
|
2022-05-22 15:26:22 +00:00
|
|
|
public CatchDifficultyHitObject(HitObject hitObject, HitObject lastObject, double clockRate, float halfCatcherWidth, List<DifficultyHitObject> objects, int position)
|
|
|
|
: base(hitObject, lastObject, clockRate, objects, position)
|
2019-02-18 05:46:32 +00:00
|
|
|
{
|
|
|
|
// We will scale everything by this factor, so we can assume a uniform CircleSize among beatmaps.
|
2021-10-27 04:04:41 +00:00
|
|
|
float scalingFactor = normalized_hitobject_radius / halfCatcherWidth;
|
2019-02-18 05:46:32 +00:00
|
|
|
|
2020-12-09 08:58:53 +00:00
|
|
|
NormalizedPosition = BaseObject.EffectiveX * scalingFactor;
|
|
|
|
LastNormalizedPosition = LastObject.EffectiveX * scalingFactor;
|
2019-02-18 05:46:32 +00:00
|
|
|
|
2019-03-06 05:36:30 +00:00
|
|
|
// Every strain interval is hard capped at the equivalent of 375 BPM streaming speed as a safety measure
|
|
|
|
StrainTime = Math.Max(40, DeltaTime);
|
2019-02-18 05:46:32 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|