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 128,
49 mValueResetPublisher;
50 ::ll::TypedStorage<
51 8,
52 8,
53 ::std::unique_ptr<
55 mLock;
56 ::ll::TypedStorage<8, 32, ::std::string> mSaveTag;
57 ::ll::TypedStorage<8, 32, ::std::string> mTelemetryProperty;
58 ::ll::TypedStorage<1, 1, ::Social::Events::PrivacyTagEnterprise> mTelemetryTag;
59 ::ll::TypedStorage<4, 4, ::OptionID const> mID;
60 ::ll::TypedStorage<4, 4, ::OptionOwnerType const> mOwnerType;
61 ::ll::TypedStorage<4, 4, ::OptionType> mOptionType;
62 ::ll::TypedStorage<8, 32, ::std::string const> mCaptionId;
63 ::ll::TypedStorage<8, 56, ::GameVersion> mDefaultVersion;
64 ::ll::TypedStorage<4, 4, ::OptionResetFlags const> mOptionResetFlags;
65 ::ll::TypedStorage<8, 8, ::Option*> mOverrideSource;
66 ::ll::TypedStorage<8, 16, ::Bedrock::PubSub::Subscription> mOverrideSourceValueChangedSubscription;
67 ::ll::TypedStorage<8, 16, ::Bedrock::PubSub::Subscription> mOverrideSourceInputModeChangedSubscription;
68 ::ll::TypedStorage<8, 64, ::std::function<void(bool)>> mRequestSaveCallback;
69 // NOLINTEND
70
71 public:
72 // prevent constructor by default
73 Impl();
74
75 public:
76 // member functions
77 // NOLINTBEGIN
78 MCAPI Impl(
79 ::OptionID id,
80 ::OptionOwnerType ownerType,
81 ::OptionResetFlags resetFlags,
82 ::std::string const& captionId,
83 ::std::string const& saveTag,
84 ::OptionType optionType,
85 ::GameVersion version
86 );
87
88 MCAPI ~Impl();
89 // NOLINTEND
90
91 public:
92 // constructor thunks
93 // NOLINTBEGIN
94 MCAPI void* $ctor(
95 ::OptionID id,
96 ::OptionOwnerType ownerType,
97 ::OptionResetFlags resetFlags,
98 ::std::string const& captionId,
99 ::std::string const& saveTag,
100 ::OptionType optionType,
101 ::GameVersion version
102 );
103 // NOLINTEND
104
105 public:
106 // destructor thunk
107 // NOLINTBEGIN
108 MCAPI void $dtor();
109 // NOLINTEND
110 };
111
112 using BoolFilter = ::std::function<bool(bool)>;
113
114 using SaveIntCallback = ::std::function<int(int)>;
115
116 using StringFilter = ::std::function<::std::string(::std::string const&)>;
117
118public:
119 // member variables
120 // NOLINTBEGIN
121 ::ll::TypedStorage<8, 8, ::std::unique_ptr<::Option::Impl>> mImpl;
122 // NOLINTEND
123
124public:
125 // prevent constructor by default
126 Option();
127
128public:
129 // virtual functions
130 // NOLINTBEGIN
131#ifdef LL_PLAT_S
132 virtual ~Option() = default;
133#else // LL_PLAT_C
134 virtual ~Option();
135#endif
136
137 virtual void save(::std::vector<::std::pair<::std::string, ::std::string>>& propertyVector) = 0;
138
139 virtual void load(::std::string const& valueString) = 0;
140
141 virtual void load(::std::map<::std::string, ::std::string>& propertyMap);
142
143 virtual void load(::Json::Value const& valueJson);
144 // NOLINTEND
145
146public:
147 // member functions
148 // NOLINTBEGIN
149 MCAPI Option(
150 ::OptionID id,
151 ::OptionOwnerType ownerType,
152 ::OptionResetFlags resetFlags,
153 ::std::string const& captionId,
154 ::std::string const& saveTag,
155 ::OptionType optionType,
156 ::GameVersion version
157 );
158
159#ifdef LL_PLAT_C
160 MCAPI void _resetOption(::InputMode inputMode, bool saveOptionChange);
161#endif
162
163 MCAPI void _updatePropertyVector(
164 ::std::vector<::std::pair<::std::string, ::std::string>>& propertyVector,
165 ::std::string const& value
166 );
167
168#ifdef LL_PLAT_C
169 MCAPI bool canModify() const;
170#endif
171
172 MCAPI bool getBool() const;
173
174#ifdef LL_PLAT_C
175 MCAPI bool getBool(::InputMode inputMode) const;
176
177 MCAPI float getFloat() const;
178
179 MCAPI float getFloat(::InputMode inputMode) const;
180
181 MCAPI float getFloatMax() const;
182
183 MCAPI float getFloatMin() const;
184
185 MCAPI int getInt() const;
186
187 MCAPI int64 getInt64() const;
188
189 MCAPI ::std::string const& getString() const;
190
191 MCAPI ::std::vector<::std::string> getStringList() const;
192
193 MCAPI uint64 getUInt64() const;
194
195 MCAPI ::std::unordered_map<int, ::std::string> const& getValueNameMap() const;
196
197 MCAPI ::std::vector<int> const& getValues() const;
198
199 MCAPI ::glm::vec3 getVec3() const;
200
201 MCAPI bool isDefaultValue(::InputMode inputMode) const;
202
203 MCAPI bool isNewVersion(::GameVersion currentVersion) const;
204#endif
205
206 MCAPI ::Bedrock::PubSub::Subscription registerLock(::std::function<void(bool&)> isModifiableCondition);
207
208#ifdef LL_PLAT_C
209 MCAPI ::Bedrock::PubSub::Subscription
210 registerObserver(::std::function<void(::Option const&, ::InputMode)> onInputModeChangedCallback);
211#endif
212
213 MCAPI ::Bedrock::PubSub::Subscription
214 registerObserver(::std::function<void(::Option const&)> onValueChangedCallback);
215
216#ifdef LL_PLAT_C
217 MCAPI ::Bedrock::PubSub::Subscription
218 registerResetObserver(::std::function<void(::Option const&)> onValueResetCallback);
219
220 MCAPI ::Option&
221 registerTelemetryProperty(::std::string const& propertyName, ::Social::Events::PrivacyTagEnterprise propertyTag);
222
223 MCAPI void set(int value);
224
225 MCAPI void setOverrideSource(::Option* overrideSource);
226
227 MCAPI void toggle();
228#endif
229 // NOLINTEND
230
231public:
232 // static functions
233 // NOLINTBEGIN
234#ifdef LL_PLAT_C
235 MCAPI static bool read(::std::string const& valueString, int& output);
236
237 MCAPI static bool read(::std::string const& valueString, float& output);
238
239 MCAPI static bool read(::std::string const& valueString, ::std::vector<::std::string>& output);
240#endif
241
242 MCAPI static bool read(::std::string const& valueString, bool& output);
243 // NOLINTEND
244
245public:
246 // constructor thunks
247 // NOLINTBEGIN
248 MCAPI void* $ctor(
249 ::OptionID id,
250 ::OptionOwnerType ownerType,
251 ::OptionResetFlags resetFlags,
252 ::std::string const& captionId,
253 ::std::string const& saveTag,
254 ::OptionType optionType,
255 ::GameVersion version
256 );
257 // NOLINTEND
258
259public:
260 // destructor thunk
261 // NOLINTBEGIN
262 MCFOLD void $dtor();
263 // NOLINTEND
264
265public:
266 // virtual function thunks
267 // NOLINTBEGIN
268 MCAPI void $load(::std::map<::std::string, ::std::string>& propertyMap);
269
270 MCAPI void $load(::Json::Value const& valueJson);
271
272
273 // NOLINTEND
274
275public:
276 // vftables
277 // NOLINTBEGIN
278 MCNAPI static void** $vftable();
279 // NOLINTEND
280};
Definition Publisher.h:8
Definition GameVersion.h:10
Definition Value.h:16
Definition Option.h:30
static MCAPI void ** $vftable()
Definition MultiThreaded.h:12