using Cryville.Common; using Cryville.Crtr.Extension; using System; using System.Collections.Generic; using UnityEngine; namespace Cryville.Crtr.Browsing.Legacy { public class LegacyChartDetail : IChartDetail, IResourceMeta { public AsyncDelivery Cover { get; set; } public ChartMeta Meta { get; set; } public string RulesetId { get { return Meta.ruleset; } } public string Name { get { return Meta.name; } } public string SongName { get { return Meta.song.name; } } public TimeSpan Length { get { return TimeSpan.FromSeconds(Meta.length); } } public IEnumerable Properties { get { if (Meta == null) yield break; yield return new MetaProperty("Name", new Dictionary { { "", string.Format("{0} - {1}", SongName, Name) }, { "short", Name }, { "distinct-primary", SongName }, { "distinct-secondary", Name }, }); yield return new MetaProperty("Image", Cover); yield return new MetaProperty("Song.Author", Meta.song.author); yield return new MetaProperty("Author", Meta.author); yield return new MetaProperty("Length", Length); yield return new MetaProperty("NoteCount", Meta.note_count); } } } }