Files
crtr/Assets/Cryville/Crtr/Browsing/ChartDetail.cs

31 lines
1.0 KiB
C#

using Cryville.Common;
using Cryville.Crtr.Browsing.UI;
using Cryville.Crtr.Extension;
using System;
using System.Collections.Generic;
using UnityEngine;
namespace Cryville.Crtr.Browsing {
public struct ChartDetail : IBrowserItemMeta {
public AsyncDelivery<Texture2D> Cover { get; set; }
public ChartMeta Meta { get; set; }
public IEnumerable<MetaProperty> Properties {
get {
if (Meta == null) yield break;
yield return new MetaProperty("Name", new Dictionary<string, object> {
{ "", string.Format("{0} - {1}", Meta.song.name, Meta.name) },
{ "short", Meta.name },
{ "distinct-primary", Meta.song.name },
{ "distinct-secondary", Meta.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", TimeSpan.FromSeconds(Meta.length));
yield return new MetaProperty("NoteCount", Meta.note_count);
}
}
}
}