|
4 | 4 | using System.Linq; |
5 | 5 | using Newtonsoft.Json; |
6 | 6 | using Newtonsoft.Json.Linq; |
| 7 | +using Newtonsoft.Json.Serialization; |
7 | 8 | using SongCore.Utilities; |
8 | 9 | using UnityEngine; |
9 | 10 |
|
10 | 11 | namespace SongCore.Data |
11 | 12 | { |
| 13 | + internal class UnderscoreNamingStrategy : NamingStrategy |
| 14 | + { |
| 15 | + protected override string ResolvePropertyName(string name) |
| 16 | + { |
| 17 | + return string.Create(name.Length + 1, name, (span, src) => |
| 18 | + { |
| 19 | + span[0] = '_'; |
| 20 | + span[1] = char.ToLowerInvariant(src[0]); |
| 21 | + src.AsSpan(1).CopyTo(span[2..]); |
| 22 | + }); |
| 23 | + } |
| 24 | + } |
| 25 | + |
| 26 | + public class SongDataClean |
| 27 | + { |
| 28 | + public CustomSongData? CustomData { get; init; } |
| 29 | + |
| 30 | + public string? CustomEnvironment { get; init; } |
| 31 | + |
| 32 | + public string? CustomEnvironmentHash { get; init; } |
| 33 | + |
| 34 | + // [JsonAlias("_difficulties")] |
| 35 | + // public DifficultyData[] Difficulties { get; init; } |
| 36 | + |
| 37 | + public BeatmapLevelColorSchemeSaveData[]? ColorSchemes { get; init; } |
| 38 | + |
| 39 | + public string[]? EnvironmentNames { get; init; } |
| 40 | + |
| 41 | + public required DifficultyBeatmapSet[] DifficultyBeatmapSets { get; init; } |
| 42 | + |
| 43 | + public class DifficultyBeatmapSet |
| 44 | + { |
| 45 | + public required string BeatmapCharacteristicName { get; init; } |
| 46 | + |
| 47 | + public required DifficultyBeatmap[] DifficultyBeatmaps { get; init; } |
| 48 | + |
| 49 | + public CustomSongData? CustomData { get; init; } |
| 50 | + |
| 51 | + public class CustomSongData |
| 52 | + { |
| 53 | + public string? CharacteristicLabel { get; init; } |
| 54 | + |
| 55 | + public string? CharacteristicIconImageFilename { get; init; } |
| 56 | + } |
| 57 | + } |
| 58 | + |
| 59 | + public class DifficultyBeatmap |
| 60 | + { |
| 61 | + public CustomSongData? CustomData { get; init; } |
| 62 | + |
| 63 | + public class CustomSongData |
| 64 | + { |
| 65 | + public string[]? StyleTags { get; init; } |
| 66 | + |
| 67 | + public string[]? Requirements { get; init; } |
| 68 | + |
| 69 | + public string[]? Suggestions { get; init; } |
| 70 | + |
| 71 | + public string[]? Warnings { get; init; } |
| 72 | + |
| 73 | + public string[]? Information { get; init; } |
| 74 | + |
| 75 | + public string? DifficultyLabel { get; init; } |
| 76 | + |
| 77 | + public bool? OneSaber { get; init; } |
| 78 | + |
| 79 | + public bool? ShowRotationNoteSpawnLines { get; init; } |
| 80 | + |
| 81 | + public Color? ColorLeft { get; init; } |
| 82 | + |
| 83 | + public Color? ColorRight { get; init; } |
| 84 | + |
| 85 | + public Color? EnvColorLeft { get; init; } |
| 86 | + |
| 87 | + public Color? EnvColorRight { get; init; } |
| 88 | + |
| 89 | + public Color? EnvColorWhite { get; init; } |
| 90 | + |
| 91 | + public Color? EnvColorLeftBoost { get; init; } |
| 92 | + |
| 93 | + public Color? EnvColorRightBoost { get; init; } |
| 94 | + |
| 95 | + public Color? EnvColorWhiteBoost { get; init; } |
| 96 | + |
| 97 | + public Color? ObstacleColor { get; init; } |
| 98 | + } |
| 99 | + } |
| 100 | + |
| 101 | + public class CustomSongData |
| 102 | + { |
| 103 | + public string[]? GenreTags { get; init; } |
| 104 | + |
| 105 | + public Contributor[]? Contributors { get; init; } |
| 106 | + |
| 107 | + public string? DefaultCharacteristic { get; init; } |
| 108 | + } |
| 109 | + |
| 110 | + public class Contributor |
| 111 | + { |
| 112 | + public string? Role { get; init; } |
| 113 | + |
| 114 | + public string? Name { get; init; } |
| 115 | + |
| 116 | + public string? IconPath { get; init; } |
| 117 | + |
| 118 | + [JsonIgnore] |
| 119 | + public Sprite? Icon { get; init; } |
| 120 | + } |
| 121 | + |
| 122 | + // [Serializable] |
| 123 | + // public class DifficultyData |
| 124 | + // { |
| 125 | + // public string _beatmapCharacteristicName; |
| 126 | + // public BeatmapDifficulty _difficulty; |
| 127 | + // public string _difficultyLabel; |
| 128 | + // public RequirementData additionalDifficultyData; |
| 129 | + // public MapColor? _colorLeft; |
| 130 | + // public MapColor? _colorRight; |
| 131 | + // public MapColor? _envColorLeft; |
| 132 | + // public MapColor? _envColorRight; |
| 133 | + // public MapColor? _envColorWhite; |
| 134 | + // public MapColor? _envColorLeftBoost; |
| 135 | + // public MapColor? _envColorRightBoost; |
| 136 | + // public MapColor? _envColorWhiteBoost; |
| 137 | + // public MapColor? _obstacleColor; |
| 138 | + // public int? _beatmapColorSchemeIdx; |
| 139 | + // public int? _environmentNameIdx; |
| 140 | + // |
| 141 | + // //PinkCore Port |
| 142 | + // public bool? _oneSaber; |
| 143 | + // public bool? _showRotationNoteSpawnLines; |
| 144 | + // //Tags |
| 145 | + // public string[] _styleTags; |
| 146 | + // } |
| 147 | + } |
| 148 | + |
12 | 149 | [Serializable] |
13 | 150 | public class SongData |
14 | 151 | { |
|
0 commit comments