123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354 |
- using Bsm.Core.Loader;
- using System.Linq;
- using Xunit;
- namespace Bsm.Core.Tests
- {
- public class LoaderPoc
- {
- [Fact]
- public void LoadCustomLevelFromDirectoryPoc()
- {
- var dir = @"Z:\CustomLevel\da60 (Midnight Lady - Reaxt)";
- var ret = CustomLevelLoader.FromDirectory(dir);
- }
- [Fact]
- public void LoadCustomLevelFromZip()
- {
- var dir = @"Z:\SaverPack\da60 (Midnight Lady - Reaxt).zip";
- var ret = CustomLevelLoader.FromZip(dir);
- }
- [Fact]
- public void LoadPpListFromFilePoc()
- {
- var path = @"z:\v2-all.json"; //https://cdn.wes.cloud/beatstar/bssb/v2-all.json
- var dic = PpListLoader.FromFile(path);
- var ranked = dic
- .Where(p => p.Value.Diffs.Any(q => q.Pp > 0))
- .ToDictionary(p => p.Key, p => p.Value);
- }
- [Fact]
- public void GeneratePlaylistPoc()
- {
- var path = @"z:\v2-all.json"; //https://cdn.wes.cloud/beatstar/bssb/v2-all.json
- var dic = PpListLoader.FromFile(path);
- var bsc32 = new[] { "11c4c", "116c3", "765d", "12ad9", "d60c", "11c9c", "ae53" };
- var hash = dic.Where(p => bsc32.Contains(p.Value.Key)).Select(p => p.Key).ToArray();
- //{"hash":"6fcd3a8e4988ef8c0f07f178237d732ceb7d6952"}
- var output = hash.Select(p => "{\"hash\":\"" + p + "\"}").ToArray();
- var final = string.Join(",", output);
- }
- [Fact]
- public void LoadPpListFromWebPoc()
- {
- var dic = PpListLoader.FromWeb();
- var ranked = dic
- .Where(p => p.Value.Diffs.Any(q => q.Pp > 0))
- .ToDictionary(p => p.Key, p => p.Value);
- }
- }
- }
|