/// <summary> /// Does some sorting of the Qua /// </summary> public void Sort() { HitObjects = HitObjects.OrderBy(x => x.StartTime).ToList(); TimingPoints = TimingPoints.OrderBy(x => x.StartTime).ToList(); SliderVelocities = SliderVelocities.OrderBy(x => x.StartTime).ToList(); SoundEffects = SoundEffects.OrderBy(x => x.StartTime).ToList(); }
/// <summary> /// Returns true if the two maps are equal by value. /// </summary> /// <param name="other">the Qua to compare to</param> /// <returns></returns> public bool EqualByValue(Qua other) { return(AudioFile == other.AudioFile && SongPreviewTime == other.SongPreviewTime && BackgroundFile == other.BackgroundFile && BannerFile == other.BannerFile && MapId == other.MapId && MapSetId == other.MapSetId && Mode == other.Mode && Title == other.Title && Artist == other.Artist && Source == other.Source && Tags == other.Tags && Creator == other.Creator && DifficultyName == other.DifficultyName && Description == other.Description && Genre == other.Genre && TimingPoints.SequenceEqual(other.TimingPoints, TimingPointInfo.ByValueComparer) && SliderVelocities.SequenceEqual(other.SliderVelocities, SliderVelocityInfo.ByValueComparer) && HitObjects.SequenceEqual(other.HitObjects, HitObjectInfo.ByValueComparer) && CustomAudioSamples.SequenceEqual(other.CustomAudioSamples, CustomAudioSampleInfo.ByValueComparer) && SoundEffects.SequenceEqual(other.SoundEffects, SoundEffectInfo.ByValueComparer) && EditorLayers.SequenceEqual(other.EditorLayers, EditorLayerInfo.ByValueComparer) && RandomizeModifierSeed == other.RandomizeModifierSeed); }
/// <summary> /// Returns true if the two maps are equal by value. /// </summary> /// <param name="other">the Qua to compare to</param> /// <returns></returns> public bool EqualByValue(Qua other) { return(AudioFile == other.AudioFile && SongPreviewTime == other.SongPreviewTime && BackgroundFile == other.BackgroundFile && BannerFile == other.BannerFile && MapId == other.MapId && MapSetId == other.MapSetId && Mode == other.Mode && Title == other.Title && Artist == other.Artist && Source == other.Source && Tags == other.Tags && Creator == other.Creator && DifficultyName == other.DifficultyName && Description == other.Description && Genre == other.Genre && TimingPoints.SequenceEqual(other.TimingPoints, TimingPointInfo.ByValueComparer) && SliderVelocities.SequenceEqual(other.SliderVelocities, SliderVelocityInfo.ByValueComparer) // ReSharper disable once CompareOfFloatsByEqualityOperator && InitialScrollVelocity == other.InitialScrollVelocity && BPMDoesNotAffectScrollVelocity == other.BPMDoesNotAffectScrollVelocity && HasScratchKey == other.HasScratchKey && HitObjects.SequenceEqual(other.HitObjects, HitObjectInfo.ByValueComparer) && CustomAudioSamples.SequenceEqual(other.CustomAudioSamples, CustomAudioSampleInfo.ByValueComparer) && SoundEffects.SequenceEqual(other.SoundEffects, SoundEffectInfo.ByValueComparer) && EditorLayers.SequenceEqual(other.EditorLayers, EditorLayerInfo.ByValueComparer) && RandomizeModifierSeed == other.RandomizeModifierSeed); }
/// <summary> /// Gets a scroll velocity at a particular time in the map /// </summary> /// <param name="time"></param> /// <returns></returns> public SliderVelocityInfo GetScrollVelocityAt(double time) { var index = SliderVelocities.FindLastIndex(x => x.StartTime <= time); if (index == -1) { return(SliderVelocities.Count == 0 ? null : SliderVelocities.First()); } return(SliderVelocities[index]); }
/// <summary> /// </summary> public void SortSliderVelocities() => SliderVelocities = SliderVelocities.OrderBy(x => x.StartTime).ToList();