mirror of
https://github.com/ppy/osu.git
synced 2024-11-11 12:17:26 +08:00
Add a way to determine the type of a Hit.
This commit is contained in:
parent
99b9623671
commit
730051520e
@ -44,7 +44,10 @@ namespace osu.Game.Modes.Taiko.Beatmaps
|
||||
IHasRepeats repeatsData = original as IHasRepeats;
|
||||
IHasEndTime endTimeData = original as IHasEndTime;
|
||||
|
||||
bool accented = ((original.Sample?.Type ?? SampleType.None) & SampleType.Finish) > 0;
|
||||
// Old osu! used hit sounding to determine hits
|
||||
SampleType sample = original.Sample?.Type ?? SampleType.None;
|
||||
|
||||
bool accented = (sample & SampleType.Finish) > 0;
|
||||
|
||||
if (distanceData != null)
|
||||
{
|
||||
@ -71,11 +74,14 @@ namespace osu.Game.Modes.Taiko.Beatmaps
|
||||
};
|
||||
}
|
||||
|
||||
HitType type = (sample & ~(SampleType.Finish | SampleType.Normal)) == 0 ? HitType.Centre : HitType.Rim;
|
||||
|
||||
return new Hit
|
||||
{
|
||||
StartTime = original.StartTime,
|
||||
Sample = original.Sample,
|
||||
Accented = accented
|
||||
Accented = accented,
|
||||
Type = type
|
||||
};
|
||||
}
|
||||
}
|
||||
|
@ -8,6 +8,11 @@ namespace osu.Game.Modes.Taiko.Objects
|
||||
{
|
||||
public class Hit : TaikoHitObject
|
||||
{
|
||||
/// <summary>
|
||||
/// Whether this hit is a centre-hit or a rim-hit.
|
||||
/// </summary>
|
||||
public HitType Type;
|
||||
|
||||
/// <summary>
|
||||
/// The hit window that results in a "GREAT" hit.
|
||||
/// </summary>
|
||||
|
14
osu.Game.Modes.Taiko/Objects/HitType.cs
Normal file
14
osu.Game.Modes.Taiko/Objects/HitType.cs
Normal file
@ -0,0 +1,14 @@
|
||||
// Copyright (c) 2007-2017 ppy Pty Ltd <contact@ppy.sh>.
|
||||
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
|
||||
|
||||
namespace osu.Game.Modes.Taiko.Objects
|
||||
{
|
||||
/// <summary>
|
||||
/// Describes whether a hit is a centre-hit or a rim-hit.
|
||||
/// </summary>
|
||||
public enum HitType
|
||||
{
|
||||
Centre,
|
||||
Rim
|
||||
}
|
||||
}
|
@ -58,6 +58,7 @@
|
||||
<Compile Include="Objects\DrumRoll.cs" />
|
||||
<Compile Include="Objects\DrumRollTick.cs" />
|
||||
<Compile Include="Objects\Hit.cs" />
|
||||
<Compile Include="Objects\HitType.cs" />
|
||||
<Compile Include="TaikoDifficultyCalculator.cs" />
|
||||
<Compile Include="Objects\TaikoHitObject.cs" />
|
||||
<Compile Include="Properties\AssemblyInfo.cs" />
|
||||
|
Loading…
Reference in New Issue
Block a user