1
0
mirror of https://github.com/ppy/osu.git synced 2024-11-11 17:07:38 +08:00
osu-lazer/osu.Game/Beatmaps/BeatmapSetInfo.cs
2017-10-04 22:52:12 +03:00

40 lines
1.2 KiB
C#

// 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.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
using System.Linq;
namespace osu.Game.Beatmaps
{
public class BeatmapSetInfo
{
[Key, DatabaseGenerated(DatabaseGeneratedOption.Identity)]
public int Id { get; set; }
public int? BeatmapSetOnlineInfoId { get; set; }
[ForeignKey(nameof(BeatmapMetadata))]
public int BeatmapMetadataId { get; set; }
public BeatmapMetadata BeatmapMetadata { get; set; }
public List<BeatmapInfo> Beatmaps { get; set; }
[NotMapped]
public BeatmapSetOnlineInfo OnlineInfo { get; set; }
public double MaxStarDifficulty => Beatmaps.Max(b => b.StarDifficulty);
public bool DeletePending { get; set; }
public string Hash { get; set; }
public string StoryboardFile => Files.FirstOrDefault(f => f.Filename.EndsWith(".osb"))?.Filename;
public List<BeatmapSetFileInfo> Files { get; set; }
public bool Protected { get; set; }
}
}