// Copyright (c) ppy Pty Ltd . Licensed under the MIT Licence. // See the LICENCE file in the repository root for full licence text. #nullable disable using System; using osu.Framework.Bindables; using osu.Game.Beatmaps; namespace osu.Game.Collections { /// /// A collection of beatmaps grouped by a name. /// public class BeatmapCollection { /// /// Invoked whenever any change occurs on this . /// public event Action Changed; /// /// The collection's name. /// public readonly Bindable Name = new Bindable(); /// /// The es of beatmaps contained by the collection. /// public readonly BindableList BeatmapHashes = new BindableList(); /// /// The date when this collection was last modified. /// public DateTimeOffset LastModifyDate { get; private set; } = DateTimeOffset.UtcNow; public BeatmapCollection() { BeatmapHashes.CollectionChanged += (_, _) => onChange(); Name.ValueChanged += _ => onChange(); } private void onChange() { LastModifyDate = DateTimeOffset.Now; Changed?.Invoke(); } } }