LoaderPoc.cs 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. using Bsm.Core.Loader;
  2. using System.Linq;
  3. using Xunit;
  4. namespace Bsm.Core.Tests
  5. {
  6. public class LoaderPoc
  7. {
  8. [Fact]
  9. public void LoadCustomLevelFromDirectoryPoc()
  10. {
  11. var dir = @"Z:\CustomLevel\da60 (Midnight Lady - Reaxt)";
  12. var ret = CustomLevelLoader.FromDirectory(dir);
  13. }
  14. [Fact]
  15. public void LoadCustomLevelFromZip()
  16. {
  17. var dir = @"Z:\SaverPack\da60 (Midnight Lady - Reaxt).zip";
  18. var ret = CustomLevelLoader.FromZip(dir);
  19. }
  20. [Fact]
  21. public void LoadPpListFromFilePoc()
  22. {
  23. var path = @"z:\v2-all.json"; //https://cdn.wes.cloud/beatstar/bssb/v2-all.json
  24. var dic = PpListLoader.FromFile(path);
  25. var ranked = dic
  26. .Where(p => p.Value.Diffs.Any(q => q.Pp > 0))
  27. .ToDictionary(p => p.Key, p => p.Value);
  28. }
  29. [Fact]
  30. public void GeneratePlaylistPoc()
  31. {
  32. var path = @"z:\v2-all.json"; //https://cdn.wes.cloud/beatstar/bssb/v2-all.json
  33. var dic = PpListLoader.FromFile(path);
  34. var bsc32 = new[] { "11c4c", "116c3", "765d", "12ad9", "d60c", "11c9c", "ae53" };
  35. var hash = dic.Where(p => bsc32.Contains(p.Value.Key)).Select(p => p.Key).ToArray();
  36. //{"hash":"6fcd3a8e4988ef8c0f07f178237d732ceb7d6952"}
  37. var output = hash.Select(p => "{\"hash\":\"" + p + "\"}").ToArray();
  38. var final = string.Join(",", output);
  39. }
  40. [Fact]
  41. public void LoadPpListFromWebPoc()
  42. {
  43. var dic = PpListLoader.FromWeb();
  44. var ranked = dic
  45. .Where(p => p.Value.Diffs.Any(q => q.Pp > 0))
  46. .ToDictionary(p => p.Key, p => p.Value);
  47. }
  48. }
  49. }