ChatPlexSDK-BS 1.0.1-v6.2.0
C++ ChatPlex BeatSaber SDK
Loading...
Searching...
No Matches
MapVersion.hpp
1#pragma once
2
3#include "../../../CP_SDK/Utils/Json.hpp"
4#include "../../../CP_SDK/Utils/Delegate.hpp"
5#include "../../../CP_SDK/Utils/MonoPtr.hpp"
6#include "MapDifficulty.hpp"
7
8#include <System/Threading/CancellationToken.hpp>
9
11
12 namespace _u
13 {
14 using namespace System::Threading;
15 }
16 namespace _v
17 {
18 using namespace CP_SDK::Utils;
19 }
20
22 {
23 enum class E
24 {
25 UNK,
26 Uploaded,
27 Testplay,
28 Published,
29 Feedback
30 };
31
32 static constexpr std::array<std::u16string_view, 5> const S = {
33 u"UNK",
34 u"Uploaded",
35 u"Testplay",
36 u"Published",
37 u"Feedback"
38 };
39
40 CP_SDK_IL2CPP_ENUM_UTILS();
41 };
42
44 {
45 MapVersion() = default;
46 CP_SDK_NO_COPYMOVE_CTORS(MapVersion);
47
48 using Ptr = std::shared_ptr<MapVersion>;
49
50 std::u16string hash;
51 MapVersionStates::E state = MapVersionStates::E::UNK;
52 std::u16string createdAt;
53 int sageScore = 0;
54 std::vector<MapDifficulty::Ptr> diffs;
55 std::u16string downloadURL;
56 std::u16string coverURL;
57 std::u16string previewURL;
58
63 std::vector<MapDifficulty::Ptr> GetDifficultiesPerBeatmapCharacteristicSOSerializedName(std::u16string_view p_BeatmapCharacteristicSerializedName);
64
67 void CoverImageBytes(_v::Action<bool, _v::CMonoPtrRef<::Array<uint8_t>>> p_Callback);
73 void ZipBytes(_u::CancellationToken p_Token, _v::CActionRef<_v::CMonoPtrRef<::Array<uint8_t>>> p_Callback, bool p_DontRetry = true, _v::CActionRef<float> p_Progress = nullptr);
74
75 CP_SDK_JSON_OPERATORS_INLINE({
76 CP_SDK_JSON_SERIALIZE_STRING(hash);
77 CP_SDK_JSON_SERIALIZE_ENUM(state, MapVersionStates);
78 CP_SDK_JSON_SERIALIZE_STRING(createdAt);
79 CP_SDK_JSON_SERIALIZE_INT32(sageScore);
80 CP_SDK_JSON_SERIALIZE_OBJECT_ARRAY(diffs);
81 CP_SDK_JSON_SERIALIZE_STRING(downloadURL);
82 CP_SDK_JSON_SERIALIZE_STRING(coverURL);
83 CP_SDK_JSON_SERIALIZE_STRING(previewURL);
84 },
85 {
86 CP_SDK_JSON_UNSERIALIZE_STRING(hash);
87 CP_SDK_JSON_UNSERIALIZE_ENUM(state, MapVersionStates, MapVersionStates::E::UNK);
88 CP_SDK_JSON_UNSERIALIZE_STRING(createdAt);
89 CP_SDK_JSON_UNSERIALIZE_INT32(sageScore);
90 CP_SDK_JSON_UNSERIALIZE_OBJECT_ARRAY(diffs);
91 CP_SDK_JSON_UNSERIALIZE_STRING(downloadURL);
92 CP_SDK_JSON_UNSERIALIZE_STRING(coverURL);
93 CP_SDK_JSON_UNSERIALIZE_STRING(previewURL);
94 });
95 };
96
97}
Various platform utils like Delegate/Action/Function/Event system.
Definition Delegate.hpp:8
BeatMaps aka BeatSaver models.
Definition MapDetail.hpp:12
std::vector< MapDifficulty::Ptr > GetDifficultiesPerBeatmapCharacteristicSOSerializedName(std::u16string_view p_BeatmapCharacteristicSerializedName)
Get all difficulties for a specific BeatmapCharacteristicSO.
void ZipBytes(_u::CancellationToken p_Token, _v::CActionRef< _v::CMonoPtrRef<::Array< uint8_t > > > p_Callback, bool p_DontRetry=true, _v::CActionRef< float > p_Progress=nullptr)
Get Zip archive bytes.
void CoverImageBytes(_v::Action< bool, _v::CMonoPtrRef<::Array< uint8_t > > > p_Callback)
Get cover image bytes.
std::vector< std::u16string > GetBeatmapCharacteristicSOSerializedNamesInOrder()
Get distinct list of BeatmapCharacteristicSO serialized names in order.