LeviLamina
Loading...
Searching...
No Matches
FeatureToggles.h
1#pragma once
2
3#include "mc/_HeaderOutputPredefine.h"
4
5// auto generated inclusion list
6#include "mc/deps/core/file/PathBuffer.h"
7#include "mc/deps/core/utility/EnableNonOwnerReferences.h"
8#include "mc/options/FeatureOptionID.h"
9#include "mc/options/FeatureOptionTabID.h"
10
11// auto generated forward declare list
12// clang-format off
13class AppPlatform;
14class Option;
15namespace Bedrock::PubSub { class Subscription; }
16// clang-format on
17
19public:
20 // FeatureToggles inner types declare
21 // clang-format off
22 struct FeatureToggle;
23 // clang-format on
24
25 // FeatureToggles inner types define
26 using SetupFunction = ::std::function<void(::Option&)>;
27
28 using LockFunction = ::std::function<void(bool&)>;
29
30 using ExpectedDisabled = ::std::vector<::FeatureOptionID>;
31
32 using ExpectedEnabled = ::std::vector<::FeatureOptionID>;
33
35 public:
36 // member variables
37 // NOLINTBEGIN
38 ::ll::TypedStorage<4, 4, ::FeatureOptionID> featureID;
39 ::ll::TypedStorage<4, 4, ::FeatureOptionID> dependencyFeatureID;
40 ::ll::TypedStorage<8, 8, ::std::unique_ptr<::Option>> option;
41 ::ll::TypedStorage<8, 64, ::std::function<void(::Option&)>> setup;
42 ::ll::TypedStorage<8, 64, ::std::function<void(bool&)>> lock;
43 ::ll::TypedStorage<4, 4, ::FeatureOptionTabID> tabID;
44 // NOLINTEND
45
46 public:
47 // prevent constructor by default
48 FeatureToggle& operator=(FeatureToggle const&);
51
52 public:
53 // member functions
54 // NOLINTBEGIN
56
57 MCAPI ::FeatureToggles::FeatureToggle& operator=(::FeatureToggles::FeatureToggle&&);
58
59 MCAPI ~FeatureToggle();
60 // NOLINTEND
61
62 public:
63 // constructor thunks
64 // NOLINTBEGIN
65 MCAPI void* $ctor(::FeatureToggles::FeatureToggle&&);
66 // NOLINTEND
67
68 public:
69 // destructor thunk
70 // NOLINTBEGIN
71 MCAPI void $dtor();
72 // NOLINTEND
73 };
74
75 using FeatureTogglesArray = ::std::vector<::FeatureToggles::FeatureToggle>;
76
77public:
78 // member variables
79 // NOLINTBEGIN
80 ::ll::TypedStorage<8, 24, ::std::vector<::FeatureToggles::FeatureToggle>> mFeatures;
81 ::ll::TypedStorage<8, 24, ::std::vector<::Bedrock::PubSub::Subscription>> mOptionLockSubscriptions;
82 ::ll::TypedStorage<8, 32, ::Core::PathBuffer<::std::string>> mFilePath;
83 ::ll::TypedStorage<1, 1, bool> mIsInGame;
84 // NOLINTEND
85
86public:
87 // virtual functions
88 // NOLINTBEGIN
89 // vIndex: 0
90 virtual ~FeatureToggles() /*override*/;
91 // NOLINTEND
92
93public:
94 // member functions
95 // NOLINTBEGIN
96 MCAPI ::std::function<void(::Option&)>
97 _getDisableIfOtherOptionDisabledSetupCallback(::FeatureOptionID optionIdToCheck) const;
98
99 MCAPI ::std::function<void(::Option&)> _getDisabledIfOptionExpectationsNotMetSetupCallback(
100 ::std::vector<::FeatureOptionID> expectedDisabledOptions,
101 ::std::vector<::FeatureOptionID> expectedEnabledOptions
102 );
103
104 MCAPI ::std::function<void(bool&)> _getLockIfInGameOrOptionExpectationsNotMetLockCallback(
105 ::std::vector<::FeatureOptionID> expectedDisabledOptions,
106 ::std::vector<::FeatureOptionID> expectedEnabledOptions
107 );
108
109 MCAPI ::std::function<void(bool&)>
110 _getLockIfOtherOptionDisabledLockCallback(::FeatureOptionID optionIdToCheck) const;
111
112 MCAPI void _initialize(::AppPlatform& appPlatform);
113
114 MCAPI void _registerFeature(
115 ::FeatureOptionTabID tabID,
116 ::FeatureOptionID featureID,
117 ::std::string const& locName,
118 ::std::string const& saveName,
119 bool defaultValue,
120 ::FeatureOptionID dependencyFeatureID,
121 ::std::function<void(::Option&)> setup,
122 ::std::function<void(bool&)> lock
123 );
124
125 MCAPI void _registerFeatures();
126
127 MCAPI void _setupDependencies();
128
129 MCAPI bool isEnabled(::FeatureOptionID featureID) const;
130 // NOLINTEND
131
132public:
133 // static variables
134 // NOLINTBEGIN
135 MCAPI static ::std::unique_ptr<::FeatureToggles>& mFeatureToggles();
136 // NOLINTEND
137
138public:
139 // destructor thunk
140 // NOLINTBEGIN
141 MCAPI void $dtor();
142 // NOLINTEND
143
144public:
145 // vftables
146 // NOLINTBEGIN
147 MCNAPI static void** $vftable();
148 // NOLINTEND
149};
Definition AppPlatform.h:50
Definition EnableNonOwnerReferences.h:7
Definition FeatureToggles.h:18
static MCAPI void ** $vftable()
Definition Option.h:18
Definition FeatureToggles.h:34