1
0
mirror of https://github.com/ppy/osu.git synced 2024-12-15 13:22:55 +08:00

Make TaikoHitObject store whether the hit object is a finisher.

This commit is contained in:
smoogipooo 2017-03-23 19:14:21 +09:00
parent 7d3846692a
commit 768bc2bb5f
2 changed files with 11 additions and 0 deletions

View File

@ -3,6 +3,7 @@
using osu.Game.Beatmaps;
using osu.Game.Beatmaps.Legacy;
using osu.Game.Beatmaps.Samples;
using osu.Game.Modes.Objects;
using osu.Game.Modes.Objects.Types;
using osu.Game.Modes.Taiko.Objects;
@ -43,12 +44,15 @@ namespace osu.Game.Modes.Taiko.Beatmaps
IHasRepeats repeatsData = original as IHasRepeats;
IHasEndTime endTimeData = original as IHasEndTime;
bool isFinisher = (original.Sample.Type & SampleType.Finish) > 0;
if (distanceData != null)
{
return new DrumRoll
{
StartTime = original.StartTime,
Sample = original.Sample,
IsFinisher = isFinisher,
Distance = distanceData.Distance * (repeatsData?.RepeatCount ?? 1)
};
@ -61,6 +65,7 @@ namespace osu.Game.Modes.Taiko.Beatmaps
{
StartTime = original.StartTime,
Sample = original.Sample,
IsFinisher = isFinisher,
EndTime = original.StartTime + endTimeData.Duration * bash_convert_factor
};
@ -70,6 +75,7 @@ namespace osu.Game.Modes.Taiko.Beatmaps
{
StartTime = original.StartTime,
Sample = original.Sample,
IsFinisher = isFinisher
};
}
}

View File

@ -19,6 +19,11 @@ namespace osu.Game.Modes.Taiko.Objects
/// </summary>
public double PreEmpt;
/// <summary>
/// Whether this HitObject is a finisher.
/// </summary>
public bool IsFinisher;
/// <summary>
/// Whether this HitObject is in Kiai time.
/// </summary>