mirror of
https://github.com/osukey/osukey.git
synced 2025-08-05 07:33:55 +09:00
+BeatmapOnlineInfo, +OnlineWorkingBeatmap, minor cleanups, panel beatmap backgrounds
This commit is contained in:
@ -43,6 +43,9 @@ namespace osu.Game.Database
|
||||
[Ignore]
|
||||
public BeatmapMetrics Metrics { get; set; }
|
||||
|
||||
[Ignore]
|
||||
public BeatmapOnlineInfo OnlineInfo { get; set; }
|
||||
|
||||
public string Path { get; set; }
|
||||
|
||||
[JsonProperty("file_md5")]
|
||||
|
38
osu.Game/Database/BeatmapOnlineInfo.cs
Normal file
38
osu.Game/Database/BeatmapOnlineInfo.cs
Normal file
@ -0,0 +1,38 @@
|
||||
// Copyright (c) 2007-2017 ppy Pty Ltd <contact@ppy.sh>.
|
||||
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
|
||||
|
||||
using Newtonsoft.Json;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace osu.Game.Database
|
||||
{
|
||||
/// <summary>
|
||||
/// Beatmap info retrieved for non-local viewing.
|
||||
/// </summary>
|
||||
public class BeatmapOnlineInfo
|
||||
{
|
||||
/// <summary>
|
||||
/// The different sizes of cover art for this beatmap: cover, cover@2x, card, card@2x, list, list@2x.
|
||||
/// </summary>
|
||||
[JsonProperty(@"covers")]
|
||||
public IEnumerable<string> Covers { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// A small sample clip of this beatmap's song.
|
||||
/// </summary>
|
||||
[JsonProperty(@"previewUrl")]
|
||||
public string Preview { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// The amount of plays this beatmap has.
|
||||
/// </summary>
|
||||
[JsonProperty(@"play_count")]
|
||||
public int PlayCount { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// The amount of people who have favourited this map.
|
||||
/// </summary>
|
||||
[JsonProperty(@"favourite_count")]
|
||||
public int FavouriteCount { get; set; }
|
||||
}
|
||||
}
|
37
osu.Game/Database/OnlineWorkingBeatmap.cs
Normal file
37
osu.Game/Database/OnlineWorkingBeatmap.cs
Normal file
@ -0,0 +1,37 @@
|
||||
// Copyright (c) 2007-2017 ppy Pty Ltd <contact@ppy.sh>.
|
||||
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
|
||||
|
||||
using System.Linq;
|
||||
using osu.Framework.Audio.Track;
|
||||
using osu.Framework.Graphics.Textures;
|
||||
using osu.Game.Beatmaps;
|
||||
|
||||
namespace osu.Game.Database
|
||||
{
|
||||
internal class OnlineWorkingBeatmap : WorkingBeatmap
|
||||
{
|
||||
private TextureStore textures;
|
||||
private TrackManager tracks;
|
||||
|
||||
public OnlineWorkingBeatmap(BeatmapInfo beatmapInfo, TextureStore textures, TrackManager tracks) : base(beatmapInfo)
|
||||
{
|
||||
this.textures = textures;
|
||||
this.tracks = tracks;
|
||||
}
|
||||
|
||||
protected override Beatmap GetBeatmap()
|
||||
{
|
||||
return new Beatmap();
|
||||
}
|
||||
|
||||
protected override Texture GetBackground()
|
||||
{
|
||||
return textures.Get(BeatmapInfo.OnlineInfo.Covers.FirstOrDefault());
|
||||
}
|
||||
|
||||
protected override Track GetTrack()
|
||||
{
|
||||
return tracks.Get(BeatmapInfo.OnlineInfo.Preview);
|
||||
}
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user