LeviLamina
Loading...
Searching...
No Matches
Option.h
1#pragma once
2
3#include "mc/_HeaderOutputPredefine.h"
4
5// auto generated inclusion list
6#include "mc/common/GameVersion.h"
7#include "mc/deps/core/utility/pub_sub/Publisher.h"
8#include "mc/deps/core/utility/pub_sub/Subscription.h"
9#include "mc/deps/input/InputMode.h"
10#include "mc/events/PrivacyTagEnterprise.h"
11#include "mc/options/option_types/OptionID.h"
12#include "mc/options/option_types/OptionOwnerType.h"
13#include "mc/options/option_types/OptionResetFlags.h"
14#include "mc/options/option_types/OptionType.h"
15
16// auto generated forward declare list
17// clang-format off
18namespace Bedrock::PubSub::ThreadModel { struct MultiThreaded; }
19namespace Json { class Value; }
20// clang-format on
21
22class Option {
23public:
24 // Option inner types declare
25 // clang-format off
26 class Impl;
27 // clang-format on
28
29 // Option inner types define
30 class Impl {
31 public:
32 // member variables
33 // NOLINTBEGIN
34 ::ll::TypedStorage<
35 8,
36 128,
38 mValueChangedPublisher;
39 ::ll::TypedStorage<
40 8,
41 128,
42 ::Bedrock::PubSub::
43 Publisher<void(::Option const&, ::InputMode), ::Bedrock::PubSub::ThreadModel::MultiThreaded, 0>>
44 mInputModeChangedPublisher;
45 ::ll::TypedStorage<
46 8,
47 8,
48 ::std::unique_ptr<
50 mLock;
51 ::ll::TypedStorage<8, 32, ::std::string> mSaveTag;
52 ::ll::TypedStorage<8, 32, ::std::string> mTelemetryProperty;
53 ::ll::TypedStorage<1, 1, ::Social::Events::PrivacyTagEnterprise> mTelemetryTag;
54 ::ll::TypedStorage<4, 4, ::OptionID const> mID;
55 ::ll::TypedStorage<4, 4, ::OptionOwnerType const> mOwnerType;
56 ::ll::TypedStorage<4, 4, ::OptionType> mOptionType;
57 ::ll::TypedStorage<8, 32, ::std::string const> mCaptionId;
58 ::ll::TypedStorage<8, 56, ::GameVersion> mDefaultVersion;
59 ::ll::TypedStorage<4, 4, ::OptionResetFlags const> mOptionResetFlags;
60 ::ll::TypedStorage<8, 8, ::Option*> mOverrideSource;
61 ::ll::TypedStorage<8, 16, ::Bedrock::PubSub::Subscription> mOverrideSourceValueChangedSubscription;
62 ::ll::TypedStorage<8, 16, ::Bedrock::PubSub::Subscription> mOverrideSourceInputModeChangedSubscription;
63 ::ll::TypedStorage<8, 64, ::std::function<void(bool)>> mRequestSaveCallback;
64 // NOLINTEND
65
66 public:
67 // prevent constructor by default
68 Impl();
69
70 public:
71 // member functions
72 // NOLINTBEGIN
73 MCAPI Impl(
74 ::OptionID id,
75 ::OptionOwnerType ownerType,
76 ::OptionResetFlags resetFlags,
77 ::std::string const& captionId,
78 ::std::string const& saveTag,
79 ::OptionType optionType,
80 ::GameVersion version
81 );
82
83 MCAPI ~Impl();
84 // NOLINTEND
85
86 public:
87 // constructor thunks
88 // NOLINTBEGIN
89 MCAPI void* $ctor(
90 ::OptionID id,
91 ::OptionOwnerType ownerType,
92 ::OptionResetFlags resetFlags,
93 ::std::string const& captionId,
94 ::std::string const& saveTag,
95 ::OptionType optionType,
96 ::GameVersion version
97 );
98 // NOLINTEND
99
100 public:
101 // destructor thunk
102 // NOLINTBEGIN
103 MCAPI void $dtor();
104 // NOLINTEND
105 };
106
107 using BoolFilter = ::std::function<bool(bool)>;
108
109 using SaveIntCallback = ::std::function<int(int)>;
110
111 using StringFilter = ::std::function<::std::string(::std::string const&)>;
112
113public:
114 // member variables
115 // NOLINTBEGIN
116 ::ll::TypedStorage<8, 8, ::std::unique_ptr<::Option::Impl>> mImpl;
117 // NOLINTEND
118
119public:
120 // prevent constructor by default
121 Option();
122
123public:
124 // virtual functions
125 // NOLINTBEGIN
126#ifdef LL_PLAT_S
127 virtual ~Option() = default;
128#else // LL_PLAT_C
129 virtual ~Option();
130#endif
131
132 virtual void save(::std::vector<::std::pair<::std::string, ::std::string>>&) = 0;
133
134 virtual void load(::std::string const&) = 0;
135
136 virtual void load(::std::map<::std::string, ::std::string>& propertyMap);
137
138 virtual void load(::Json::Value const& valueJson);
139 // NOLINTEND
140
141public:
142 // member functions
143 // NOLINTBEGIN
144 MCAPI Option(
145 ::OptionID id,
146 ::OptionOwnerType ownerType,
147 ::OptionResetFlags resetFlags,
148 ::std::string const& captionId,
149 ::std::string const& saveTag,
150 ::OptionType optionType,
151 ::GameVersion version
152 );
153
154 MCAPI_C void _resetOption(::InputMode inputMode, bool saveOptionChange);
155
156 MCAPI void _updatePropertyVector(
157 ::std::vector<::std::pair<::std::string, ::std::string>>& propertyVector,
158 ::std::string const& value
159 );
160
161 MCAPI_C bool canModify() const;
162
163 MCAPI bool getBool() const;
164
165 MCAPI_C bool getBool(::InputMode inputMode) const;
166
167 MCAPI_C float getFloat() const;
168
169 MCAPI_C float getFloat(::InputMode inputMode) const;
170
171 MCAPI_C float getFloatMax() const;
172
173 MCAPI_C float getFloatMin() const;
174
175 MCAPI_C int getInt() const;
176
177 MCAPI_C int64 getInt64() const;
178
179 MCAPI_C ::std::string const& getString() const;
180
181 MCAPI_C ::std::vector<::std::string> getStringList() const;
182
183 MCAPI_C uint64 getUInt64() const;
184
185 MCAPI_C ::std::unordered_map<int, ::std::string> const& getValueNameMap() const;
186
187 MCAPI_C ::std::vector<int> const& getValues() const;
188
189 MCAPI_C ::glm::vec3 getVec3() const;
190
191 MCAPI_C bool isDefaultValue(::InputMode inputMode) const;
192
193 MCAPI_C bool isNewVersion(::GameVersion currentVersion) const;
194
195 MCAPI ::Bedrock::PubSub::Subscription registerLock(::std::function<void(bool&)> isModifiableCondition);
196
197 MCAPI_C ::Bedrock::PubSub::Subscription
198 registerObserver(::std::function<void(::Option const&, ::InputMode)> onInputModeChangedCallback);
199
200 MCAPI ::Bedrock::PubSub::Subscription
201 registerObserver(::std::function<void(::Option const&)> onValueChangedCallback);
202
203 MCAPI_C ::Option&
204 registerTelemetryProperty(::std::string const& propertyName, ::Social::Events::PrivacyTagEnterprise propertyTag);
205
206 MCAPI_C void set(int value);
207
208 MCAPI_C void setOverrideSource(::Option* overrideSource);
209
210 MCAPI_C void toggle();
211 // NOLINTEND
212
213public:
214 // static functions
215 // NOLINTBEGIN
216 MCAPI_C static bool read(::std::string const& valueString, int& output);
217
218 MCAPI_C static bool read(::std::string const& valueString, float& output);
219
220 MCAPI_C static bool read(::std::string const& valueString, ::std::vector<::std::string>& output);
221
222 MCAPI static bool read(::std::string const& valueString, bool& output);
223 // NOLINTEND
224
225public:
226 // constructor thunks
227 // NOLINTBEGIN
228 MCAPI void* $ctor(
229 ::OptionID id,
230 ::OptionOwnerType ownerType,
231 ::OptionResetFlags resetFlags,
232 ::std::string const& captionId,
233 ::std::string const& saveTag,
234 ::OptionType optionType,
235 ::GameVersion version
236 );
237 // NOLINTEND
238
239public:
240 // destructor thunk
241 // NOLINTBEGIN
242 MCFOLD void $dtor();
243 // NOLINTEND
244
245public:
246 // virtual function thunks
247 // NOLINTBEGIN
248 MCAPI void $load(::std::map<::std::string, ::std::string>& propertyMap);
249
250 MCAPI void $load(::Json::Value const& valueJson);
251
252
253 // NOLINTEND
254
255public:
256 // vftables
257 // NOLINTBEGIN
258 MCNAPI static void** $vftable();
259 // NOLINTEND
260};
Definition Publisher.h:8
Definition GameVersion.h:10
Definition Value.h:16
Definition Option.h:30
static MCAPI void ** $vftable()