// Copyright (c) ppy Pty Ltd . Licensed under the MIT Licence. // See the LICENCE file in the repository root for full licence text. using System.Collections.Generic; using osu.Game.Rulesets.Taiko.Objects; namespace osu.Game.Rulesets.Taiko.Difficulty.Preprocessing.Colour.Data { /// /// Encodes a list of s. /// s with the same are grouped together. /// public class ColourEncoding { /// /// s that are grouped together within this . /// public List Payload { get; private set; } = new List(); public CoupledColourEncoding? Parent; /// /// Index of this encoding within it's parent encoding /// public int Index; /// /// Determine if this is a repetition of another . This /// is a strict comparison and is true if and only if the colour sequence is exactly the same. /// This does not require the s to have the same amount of s. /// public bool IsRepetitionOf(ColourEncoding other) { return HasIdenticalMonoLength(other) && other.Payload.Count == Payload.Count && (other.Payload[0].EncodedData[0].BaseObject as Hit)?.Type == (Payload[0].EncodedData[0].BaseObject as Hit)?.Type; } /// /// Determine if this has the same mono length of another . /// public bool HasIdenticalMonoLength(ColourEncoding other) { return other.Payload[0].RunLength == Payload[0].RunLength; } } }