mirror of
https://github.com/ppy/osu.git
synced 2025-01-26 19:32:55 +08:00
Inline percentage calculation
This commit is contained in:
parent
80f24a0791
commit
a3f3dcf853
@ -23,7 +23,7 @@ namespace osu.Game.Rulesets.Edit.Checks
|
|||||||
double mappedLength = context.Beatmap.HitObjects.Last().GetEndTime();
|
double mappedLength = context.Beatmap.HitObjects.Last().GetEndTime();
|
||||||
double trackLength = context.WorkingBeatmap.Track.Length;
|
double trackLength = context.WorkingBeatmap.Track.Length;
|
||||||
|
|
||||||
double mappedPercentage = calculatePercentage(mappedLength, trackLength);
|
double mappedPercentage = Math.Round(mappedLength / trackLength * 100);
|
||||||
|
|
||||||
if (mappedPercentage < 80)
|
if (mappedPercentage < 80)
|
||||||
{
|
{
|
||||||
@ -31,11 +31,6 @@ namespace osu.Game.Rulesets.Edit.Checks
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private double calculatePercentage(double mappedLenght, double trackLenght)
|
|
||||||
{
|
|
||||||
return Math.Round(mappedLenght / trackLenght * 100);
|
|
||||||
}
|
|
||||||
|
|
||||||
public class IssueTemplateUnusedAudioAtEnd : IssueTemplate
|
public class IssueTemplateUnusedAudioAtEnd : IssueTemplate
|
||||||
{
|
{
|
||||||
public IssueTemplateUnusedAudioAtEnd(ICheck check)
|
public IssueTemplateUnusedAudioAtEnd(ICheck check)
|
||||||
|
Loading…
Reference in New Issue
Block a user