General refactorings

This commit is contained in:
smoogipoo
2020-09-07 21:08:48 +09:00
parent c1d255a04c
commit 98e9c4dc25
10 changed files with 95 additions and 40 deletions

View File

@ -21,7 +21,7 @@ namespace osu.Game.Collections
public class BeatmapCollectionManager : CompositeDrawable
{
/// <summary>
/// Database version in YYYYMMDD format (matching stable).
/// Database version in stable-compatible YYYYMMDD format.
/// </summary>
private const int database_version = 30000000;
@ -213,29 +213,4 @@ namespace osu.Game.Collections
save();
}
}
public class BeatmapCollection
{
/// <summary>
/// Invoked whenever any change occurs on this <see cref="BeatmapCollection"/>.
/// </summary>
public event Action Changed;
public readonly Bindable<string> Name = new Bindable<string>();
public readonly BindableList<BeatmapInfo> Beatmaps = new BindableList<BeatmapInfo>();
public DateTimeOffset LastModifyTime { get; private set; }
public BeatmapCollection()
{
LastModifyTime = DateTimeOffset.UtcNow;
Beatmaps.CollectionChanged += (_, __) =>
{
LastModifyTime = DateTimeOffset.Now;
Changed?.Invoke();
};
}
}
}