// Copyright (c) ppy Pty Ltd . Licensed under the MIT Licence. // See the LICENCE file in the repository root for full licence text. using System; using osu.Game.Rulesets.Mania.UI; namespace osu.Game.Rulesets.Mania.Beatmaps { /// /// Defines properties for each stage in a . /// public struct StageDefinition { /// /// The number of s which this stage contains. /// public int Columns; /// /// Whether the column index is a special column for this stage. /// /// The 0-based column index. /// Whether the column is a special column. public readonly bool IsSpecialColumn(int column) => Columns % 2 == 1 && column == Columns / 2; /// /// Get the type of column given a column index. /// /// The 0-based column index. /// The type of the column. public readonly ColumnType GetTypeOfColumn(int column) { if (IsSpecialColumn(column)) return ColumnType.Special; int distanceToEdge = Math.Min(column, (Columns - 1) - column); return distanceToEdge % 2 == 0 ? ColumnType.Odd : ColumnType.Even; } } }