26 struct FeatureToggle {
30 ::ll::TypedStorage<4, 4, ::FeatureOptionID> featureID;
31 ::ll::TypedStorage<4, 4, ::FeatureOptionID> dependencyFeatureID;
32 ::ll::TypedStorage<8, 8, ::std::unique_ptr<::Option>> option;
33 ::ll::TypedStorage<8, 64, ::std::function<void(
::Option&)>> setup;
34 ::ll::TypedStorage<8, 64, ::std::function<void(
bool&)>> lock;
35 ::ll::TypedStorage<4, 4, ::FeatureOptionTabID> tabID;
40 FeatureToggle& operator=(FeatureToggle
const&);
41 FeatureToggle(FeatureToggle
const&);
51 MCAPI ~FeatureToggle();
67 using ExpectedDisabled = ::std::vector<::FeatureOptionID>;
69 using ExpectedEnabled = ::std::vector<::FeatureOptionID>;
71 using FeatureTogglesArray = ::std::vector<::FeatureToggles::FeatureToggle>;
73 using LockFunction = ::std::function<void(
bool&)>;
75 using SetupFunction = ::std::function<void(
::Option&)>;
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;
95 MCAPI ::std::function<void(
::Option&)>
96 _getDisableIfOtherOptionDisabledSetupCallback(::FeatureOptionID optionIdToCheck)
const;
98 MCAPI ::std::function<void(
::Option&)> _getDisabledIfOptionExpectationsNotMetSetupCallback(
99 ::std::vector<::FeatureOptionID> expectedDisabledOptions,
100 ::std::vector<::FeatureOptionID> expectedEnabledOptions
103 MCAPI ::std::function<void(
bool&)> _getLockIfInGameOrOptionExpectationsNotMetLockCallback(
104 ::std::vector<::FeatureOptionID> expectedDisabledOptions,
105 ::std::vector<::FeatureOptionID> expectedEnabledOptions
108 MCAPI ::std::function<void(
bool&)>
109 _getLockIfOtherOptionDisabledLockCallback(::FeatureOptionID optionIdToCheck)
const;
113 MCAPI
void _registerFeature(
114 ::FeatureOptionTabID tabID,
115 ::FeatureOptionID featureID,
116 ::std::string
const& locName,
117 ::std::string
const& saveName,
119 ::FeatureOptionID dependencyFeatureID,
120 ::std::function<
void(
::Option&)> setup,
121 ::std::function<
void(
bool&)> lock
124 MCAPI
void _registerFeatures();
126 MCAPI
void _setupDependencies();
128 MCAPI_C ::Option* get(::FeatureOptionID featureID);
130 MCAPI
bool isEnabled(::FeatureOptionID featureID)
const;
136 MCAPI static ::std::unique_ptr<::FeatureToggles>& mFeatureToggles();