95 lines
2.1 KiB
C#
95 lines
2.1 KiB
C#
using System;
|
|
using System.Collections.Generic;
|
|
using JD.Collections.Extensions;
|
|
using JD.Serialization;
|
|
|
|
namespace JDSongConverter
|
|
{
|
|
/// <summary>
|
|
/// A Just Dance version
|
|
/// </summary>
|
|
public enum JDSongVersion
|
|
{
|
|
Unknown,
|
|
JD1,
|
|
JD2,
|
|
JD3,
|
|
JD4,
|
|
JD5,
|
|
JD2015,
|
|
JD2016
|
|
}
|
|
|
|
/// <summary>
|
|
/// A folder layout
|
|
/// </summary>
|
|
public enum JDFolderLayout
|
|
{
|
|
CatalogProd,
|
|
Engine,
|
|
Unknown
|
|
}
|
|
|
|
|
|
public static class JDSongTypeExtensions
|
|
{
|
|
public static string WithoutJdPrefix(this JDSongVersion version)
|
|
{
|
|
return version.ToString().Replace("JD", "");
|
|
}
|
|
|
|
public static int WithoutJdPrefixNumeric(this JDSongVersion version)
|
|
{
|
|
return int.Parse(version.ToString().Replace("JD", ""));
|
|
}
|
|
}
|
|
|
|
/// <summary>
|
|
/// A class reprensenting a Just Dance song from any version
|
|
/// </summary>
|
|
public class JDSong
|
|
{
|
|
/// <summary>
|
|
/// The root absolute path of the song
|
|
/// </summary>
|
|
public string RootPath { get; set; }
|
|
|
|
/// <summary>
|
|
/// The name of the song
|
|
/// </summary>
|
|
public string Name { get; set; }
|
|
|
|
/// <summary>
|
|
/// The version of the song
|
|
/// </summary>
|
|
public JDSongVersion Version { get; set; }
|
|
|
|
/// <summary>
|
|
/// The number of players
|
|
/// </summary>
|
|
public int PlayerCount { get; set; }
|
|
|
|
/// <summary>
|
|
/// The folder layout of the song (engine, catalog...)
|
|
/// </summary>
|
|
public JDFolderLayout FolderLayout { get; set; }
|
|
|
|
public override string ToString()
|
|
{
|
|
return String.Format("{0} [{1}]", Name, Version);
|
|
}
|
|
}
|
|
|
|
/// <summary>
|
|
/// A collection of songs
|
|
/// </summary>
|
|
public class JDSongCollection : UAFList<JDSong>
|
|
{
|
|
public JDSongCollection(){}
|
|
|
|
public JDSongCollection(IEnumerable<JDSong> songs)
|
|
{
|
|
this.AddRange(songs);
|
|
}
|
|
}
|
|
}
|