// Copyright (c) 2007-2017 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using osu.Game.Rulesets.Mania.Objects; using System.Collections.Generic; using System.Linq; namespace osu.Game.Rulesets.Mania.Beatmaps { internal class ObjectRow { private readonly List hitObjects = new List(); public IEnumerable HitObjects => hitObjects; /// /// Whether a column of this row has been taken. /// /// The column index. /// Whether the column already contains a hit object. public bool IsTaken(int column) => hitObjects.Exists(h => h.Column == column); /// /// Amount of columns taken up by hit objects in this row. /// public int Columns => HitObjects.GroupBy(h => h.Column).Count(); /// /// Adds a hit object to this row. /// /// The hit object to add. public void Add(ManiaHitObject hitObject) => hitObjects.Add(hitObject); /// /// Clears this row. /// public void Clear() => hitObjects.Clear(); /// /// Removes a hit object from this row. /// /// The hit object to remove. public bool Remove(ManiaHitObject hitObject) => hitObjects.Remove(hitObject); } }