mirror of
https://github.com/osukey/osukey.git
synced 2025-08-02 22:26:41 +09:00
Resharper is too smart.
This commit is contained in:
@ -8,6 +8,7 @@ using System;
|
||||
using osu.Game.Rulesets.Objects.Types;
|
||||
using osu.Game.Rulesets.Beatmaps;
|
||||
using osu.Game.Rulesets.Objects;
|
||||
using OpenTK;
|
||||
|
||||
namespace osu.Game.Rulesets.Mania.Beatmaps
|
||||
{
|
||||
@ -17,12 +18,12 @@ namespace osu.Game.Rulesets.Mania.Beatmaps
|
||||
|
||||
protected override IEnumerable<ManiaHitObject> ConvertHitObject(HitObject original, Beatmap beatmap)
|
||||
{
|
||||
int columns = (int)Math.Round(beatmap.BeatmapInfo.Difficulty.CircleSize);
|
||||
int availableColumns = (int)Math.Round(beatmap.BeatmapInfo.Difficulty.CircleSize);
|
||||
|
||||
var positionData = original as IHasXPosition;
|
||||
|
||||
float localWDivisor = 512.0f / columns;
|
||||
int column = Math.Min((int)Math.Floor(positionData.X / localWDivisor), columns - 1);
|
||||
float localWDivisor = 512.0f / availableColumns;
|
||||
int column = MathHelper.Clamp((int)Math.Floor((positionData?.X ?? 1) / localWDivisor), 0, availableColumns - 1);
|
||||
|
||||
yield return new Note
|
||||
{
|
||||
|
@ -36,7 +36,11 @@ namespace osu.Game.Rulesets.Mania.UI
|
||||
var timingSections = new List<TimingSection>();
|
||||
|
||||
// Construct all the relevant timing sections
|
||||
ControlPoint lastTimingChange = null;
|
||||
ControlPoint lastTimingChange = Beatmap.TimingInfo.ControlPoints.FirstOrDefault(t => t.TimingChange);
|
||||
|
||||
if (lastTimingChange == null)
|
||||
throw new Exception("The Beatmap contains no timing points!");
|
||||
|
||||
foreach (ControlPoint point in Beatmap.TimingInfo.ControlPoints)
|
||||
{
|
||||
if (point.TimingChange)
|
||||
@ -92,10 +96,6 @@ namespace osu.Game.Rulesets.Mania.UI
|
||||
if (note != null)
|
||||
return new DrawableNote(note);
|
||||
|
||||
var holdNote = h as HoldNote;
|
||||
if (holdNote != null)
|
||||
return new DrawableHoldNote(holdNote);
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user