using System; using System.Collections.Generic; using osu.Game.Rulesets.Difficulty.Preprocessing; using osu.Game.Rulesets.Taiko.Difficulty.Evaluators; namespace osu.Game.Rulesets.Taiko.Difficulty.Preprocessing.Colour { /// /// Stores colour compression information for a . This is only present for the /// first in a chunk. /// public class TaikoDifficultyHitObjectColour { public CoupledColourEncoding Encoding { get; private set; } public double EvaluatedDifficulty = 0; private TaikoDifficultyHitObjectColour(CoupledColourEncoding encoding) { Encoding = encoding; } // TODO: Might wanna move this somewhere else as it is introducing circular references public static List EncodeAndAssign(List hitObjects) { List colours = new List(); List encodings = CoupledColourEncoding.Encode(hitObjects); // Assign colour to objects encodings.ForEach(coupledEncoding => { coupledEncoding.Payload.ForEach(encoding => { encoding.Payload.ForEach(mono => { mono.EncodedData.ForEach(hitObject => { hitObject.Colour = new TaikoDifficultyHitObjectColour(coupledEncoding); }); }); }); // Preevaluate and assign difficulty values ColourEvaluator.PreEvaluateDifficulties(coupledEncoding); }); return colours; } } }