Store tick count locally, remove HoldNote TickCount.

This commit is contained in:
smoogipooo 2017-05-29 14:47:51 +09:00
parent f17b8acd13
commit 44f1d906ea
2 changed files with 6 additions and 7 deletions

View File

@ -61,11 +61,6 @@ public override void ApplyDefaults(ControlPointInfo controlPointInfo, BeatmapDif
tickSpacing = timingPoint.BeatLength / difficulty.SliderTickRate; tickSpacing = timingPoint.BeatLength / difficulty.SliderTickRate;
} }
/// <summary>
/// Total number of hold note ticks.
/// </summary>
public int TotalTicks => Ticks.Count();
/// <summary> /// <summary>
/// The scoring scoring ticks of the hold note. /// The scoring scoring ticks of the hold note.
/// </summary> /// </summary>

View File

@ -2,6 +2,7 @@
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
using System; using System;
using System.Linq;
using osu.Game.Beatmaps; using osu.Game.Beatmaps;
using osu.Game.Database; using osu.Game.Database;
using osu.Game.Rulesets.Mania.Judgements; using osu.Game.Rulesets.Mania.Judgements;
@ -170,6 +171,8 @@ protected override void ComputeTargets(Beatmap<ManiaHitObject> beatmap)
{ {
foreach (var obj in beatmap.HitObjects) foreach (var obj in beatmap.HitObjects)
{ {
var holdNote = obj as HoldNote;
if (obj is Note) if (obj is Note)
{ {
AddJudgement(new ManiaJudgement AddJudgement(new ManiaJudgement
@ -178,7 +181,7 @@ protected override void ComputeTargets(Beatmap<ManiaHitObject> beatmap)
ManiaResult = ManiaHitResult.Perfect ManiaResult = ManiaHitResult.Perfect
}); });
} }
else if (obj is HoldNote) else if (holdNote != null)
{ {
// Head // Head
AddJudgement(new ManiaJudgement AddJudgement(new ManiaJudgement
@ -188,7 +191,8 @@ protected override void ComputeTargets(Beatmap<ManiaHitObject> beatmap)
}); });
// Ticks // Ticks
for (int i = 0; i < ((HoldNote)obj).TotalTicks; i++) int tickCount = holdNote.Ticks.Count();
for (int i = 0; i < tickCount; i++)
{ {
AddJudgement(new HoldNoteTickJudgement AddJudgement(new HoldNoteTickJudgement
{ {