Pull up IChartDetail
.
This commit is contained in:
34
Assets/Cryville/Crtr/Browsing/Legacy/LegacyChartDetail.cs
Normal file
34
Assets/Cryville/Crtr/Browsing/Legacy/LegacyChartDetail.cs
Normal file
@@ -0,0 +1,34 @@
|
||||
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<Texture2D> 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<MetaProperty> Properties {
|
||||
get {
|
||||
if (Meta == null) yield break;
|
||||
yield return new MetaProperty("Name", new Dictionary<string, object> {
|
||||
{ "", 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);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user