2019-02-18 05:54:21 +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 osu.Game.Rulesets.Difficulty.Preprocessing;
|
|
|
|
using osu.Game.Rulesets.Objects;
|
|
|
|
using osu.Game.Rulesets.Taiko.Objects;
|
|
|
|
|
|
|
|
namespace osu.Game.Rulesets.Taiko.Difficulty.Preprocessing
|
|
|
|
{
|
|
|
|
public class TaikoDifficultyHitObject : DifficultyHitObject
|
|
|
|
{
|
|
|
|
public readonly bool HasTypeChange;
|
2020-05-11 05:50:02 +00:00
|
|
|
public readonly bool HasTimingChange;
|
|
|
|
public readonly TaikoDifficultyHitObjectRhythm Rhythm;
|
|
|
|
public readonly bool IsKat;
|
2019-02-18 05:54:21 +00:00
|
|
|
|
2020-05-11 05:50:02 +00:00
|
|
|
public bool StaminaCheese = false;
|
|
|
|
|
|
|
|
public readonly int RhythmID;
|
|
|
|
|
|
|
|
public readonly double NoteLength;
|
|
|
|
|
|
|
|
public readonly int n;
|
|
|
|
private int counter = 0;
|
|
|
|
|
2020-05-11 05:57:47 +00:00
|
|
|
public TaikoDifficultyHitObject(HitObject hitObject, HitObject lastObject, HitObject lastLastObject, double clockRate, TaikoDifficultyHitObjectRhythm rhythm)
|
2019-02-19 08:45:16 +00:00
|
|
|
: base(hitObject, lastObject, clockRate)
|
2019-02-18 05:54:21 +00:00
|
|
|
{
|
2020-05-11 05:53:42 +00:00
|
|
|
var lastHit = lastObject as Hit;
|
|
|
|
var currentHit = hitObject as Hit;
|
|
|
|
|
2020-05-11 05:50:02 +00:00
|
|
|
NoteLength = DeltaTime;
|
|
|
|
double prevLength = (lastObject.StartTime - lastLastObject.StartTime) / clockRate;
|
2020-05-11 05:57:47 +00:00
|
|
|
Rhythm = rhythm.GetClosest(NoteLength / prevLength);
|
2020-05-11 05:50:02 +00:00
|
|
|
RhythmID = Rhythm.ID;
|
2020-05-11 05:53:42 +00:00
|
|
|
HasTypeChange = lastHit?.Type != currentHit?.Type;
|
|
|
|
IsKat = lastHit?.Type == HitType.Rim;
|
2020-05-11 05:57:47 +00:00
|
|
|
HasTimingChange = !rhythm.IsRepeat(RhythmID);
|
2020-05-11 05:50:02 +00:00
|
|
|
|
|
|
|
n = counter;
|
|
|
|
counter++;
|
2019-02-18 05:54:21 +00:00
|
|
|
}
|
2020-05-11 05:50:02 +00:00
|
|
|
|
|
|
|
public const int CONST_RHYTHM_ID = 0;
|
2019-02-18 05:54:21 +00:00
|
|
|
}
|
|
|
|
}
|