mirror of
https://github.com/osukey/osukey.git
synced 2025-08-02 22:26:41 +09:00
Add method to get stage from column index
This commit is contained in:
@ -3,6 +3,7 @@
|
||||
|
||||
#nullable disable
|
||||
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using osu.Game.Beatmaps;
|
||||
@ -60,5 +61,18 @@ namespace osu.Game.Rulesets.Mania.Beatmaps
|
||||
},
|
||||
};
|
||||
}
|
||||
|
||||
public StageDefinition GetStageForColumnIndex(int column)
|
||||
{
|
||||
foreach (var stage in Stages)
|
||||
{
|
||||
if (column < stage.Columns)
|
||||
return stage;
|
||||
|
||||
column -= stage.Columns;
|
||||
}
|
||||
|
||||
throw new ArgumentOutOfRangeException(nameof(column), "Provided index exceeds all available stages");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user