mirror of
https://github.com/muskit/MercuryConverter.git
synced 2026-06-02 20:24:26 -07:00
add data reading & selection table population
This commit is contained in:
@@ -1,25 +0,0 @@
|
||||
using System;
|
||||
|
||||
namespace MercuryConverter.Data;
|
||||
|
||||
|
||||
public class Chart
|
||||
{
|
||||
public required string audioId;
|
||||
public required string audioOffset;
|
||||
public required string audioPreviewTime;
|
||||
public required string audioPreviewDuration;
|
||||
public required string video;
|
||||
public required string designer;
|
||||
public required string clearRequirement;
|
||||
public required string diffLevel;
|
||||
public string diffString
|
||||
{
|
||||
get
|
||||
{
|
||||
var d = Convert.ToDouble(diffLevel);
|
||||
var i = (int)d;
|
||||
return $"{(int)d}{(d > i ? "+" : "")}";
|
||||
}
|
||||
}
|
||||
}
|
||||
+31
-3
@@ -1,6 +1,7 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using SaturnData.Notation.Core;
|
||||
|
||||
namespace MercuryConverter.Data;
|
||||
|
||||
@@ -20,7 +21,7 @@ public static class Consts
|
||||
};
|
||||
public static readonly IReadOnlyDictionary<int, string> CATEGORY_INDEX = _CATEGORY_INDEX;
|
||||
|
||||
private static Dictionary<int, string> _NUM_SOURCE = new()
|
||||
private static Dictionary<uint, string> _NUM_SOURCE = new()
|
||||
{
|
||||
{ 1, string.Concat(new int[] {87, 65, 67, 67, 65}.Select(i => Convert.ToChar(i))) },
|
||||
{ 2, string.Concat(new int[] {87, 65, 67, 67, 65, 32, 83}.Select(i => Convert.ToChar(i))) },
|
||||
@@ -28,11 +29,38 @@ public static class Consts
|
||||
{ 4, string.Concat(new int[] {87, 65, 67, 67, 65, 32, 76, 73, 76, 89, 32, 82}.Select(i => Convert.ToChar(i))) },
|
||||
{ 5, string.Concat(new int[] {87, 65, 67, 67, 65, 32, 82, 101, 118, 101, 114, 115, 101}.Select(i => Convert.ToChar(i))) }
|
||||
};
|
||||
public static readonly IReadOnlyDictionary<int, string> NUM_SOURCE = _NUM_SOURCE;
|
||||
public static readonly IReadOnlyDictionary<string, int> SOURCE_NUM = _NUM_SOURCE.ToDictionary(p => p.Value, p=>p.Key);
|
||||
public static readonly IReadOnlyDictionary<uint, string> NUM_SOURCE = _NUM_SOURCE;
|
||||
public static readonly IReadOnlyDictionary<string, uint> SOURCE_NUM = _NUM_SOURCE.ToDictionary(p => p.Value, p => p.Key);
|
||||
|
||||
private static string[] _DIFFICULTIES = {
|
||||
"Normal", "Hard", "Expert", "Inferno"
|
||||
};
|
||||
public static readonly IReadOnlyList<string> DIFFICULTIES = _DIFFICULTIES;
|
||||
|
||||
private static readonly Dictionary<Difficulty, string> _DIFF_LVL_KEY = new()
|
||||
{
|
||||
{Difficulty.Normal, "DifficultyNormalLv"},
|
||||
{Difficulty.Hard, "DifficultyHardLv"},
|
||||
{Difficulty.Expert, "DifficultyExtremeLv"},
|
||||
{Difficulty.Inferno, "DifficultyInfernoLv"},
|
||||
};
|
||||
public static readonly IReadOnlyDictionary<Difficulty, string> DIFF_LVL_KEY = _DIFF_LVL_KEY;
|
||||
|
||||
private static readonly Dictionary<Difficulty, string> _DIFF_FILENAME_PREPEND = new()
|
||||
{
|
||||
{Difficulty.Normal, "00"},
|
||||
{Difficulty.Hard, "01"},
|
||||
{Difficulty.Expert, "02"},
|
||||
{Difficulty.Inferno, "03"},
|
||||
};
|
||||
public static readonly IReadOnlyDictionary<Difficulty, string> DIFF_FILENAME_PREPEND = _DIFF_FILENAME_PREPEND;
|
||||
|
||||
private static readonly Dictionary<Difficulty, string> _DIFF_CLEAR_KEY = new()
|
||||
{
|
||||
{Difficulty.Normal, "ClearNormaRateNormal"},
|
||||
{Difficulty.Hard, "ClearNormaRateHard"},
|
||||
{Difficulty.Expert, "ClearNormaRateExtreme"},
|
||||
{Difficulty.Inferno, "ClearNormaRateInferno"},
|
||||
};
|
||||
public static readonly IReadOnlyDictionary<Difficulty, string> DIFF_CLEAR_KEY = _DIFF_CLEAR_KEY;
|
||||
}
|
||||
+18
-11
@@ -1,22 +1,29 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using Avalonia.Media;
|
||||
using SaturnData.Notation.Core;
|
||||
|
||||
namespace MercuryConverter.Data;
|
||||
|
||||
/// <summary>
|
||||
/// Combining SaturnData's Entry & Chart.
|
||||
/// </summary>
|
||||
public class Song
|
||||
{
|
||||
/// <summary>
|
||||
/// Format: `Snn-nnn` where `n` is a digit.
|
||||
/// </summary>
|
||||
public required string Id { get; set;}
|
||||
public required string Id { get; set; } // Snn-nnn
|
||||
public required string Name { get; set; }
|
||||
public required string Artist { get; set; }
|
||||
public required string Source { get; set; }
|
||||
public string rubi;
|
||||
public string copyright;
|
||||
public string tempo;
|
||||
public int genreId;
|
||||
public string jacket;
|
||||
public Chart?[] charts = { null, null, null, null };
|
||||
public required uint Source { get; set; }
|
||||
public required string Rubi { get; set; }
|
||||
public string? Copyright { get; set; } // May have never been used?
|
||||
public required int Genre { get; set; }
|
||||
public required string? Jacket { get; set; }
|
||||
public required float PreviewTime { get; set; }
|
||||
public required float PreviewLen { get; set; }
|
||||
public string SourceName => Consts.NUM_SOURCE[Source];
|
||||
|
||||
|
||||
// TODO: For SaturnData.Entry instances, use this Guid format:
|
||||
// MERCURY_[SONGID]_[DIFF] (each var is int)
|
||||
public List<(Difficulty, Entry, Chart)> charts = new();
|
||||
}
|
||||
Reference in New Issue
Block a user