![]() |
VR-Forces Developer's Guide
|
Central registry mapping wire-type strings to async DtCommandSpecParamBuilder factories.
Both DtCatalogParamSpecBuilder and DtScriptedTaskParamSpecBuilder hold a const reference to one shared instance owned by DtCommandSpecBuilder.
To register a new custom parameter type:
Wire types currently registered:
"Weapon" — DtWeaponListCommandSpecParamBuilder (async) Public Member Functions | |
| DtCustomParamBuilderRegistry (DtScenarioManager &scnMgr) | |
| ~DtCustomParamBuilderRegistry ()=default | |
| DtCustomParamBuilderRegistry (const DtCustomParamBuilderRegistry &)=delete | |
| DtCustomParamBuilderRegistry & | operator= (const DtCustomParamBuilderRegistry &)=delete |
| bool | hasBuilder (const std::string &wireType) const |
| std::unique_ptr < DtCommandSpecParamBuilder > | build (const std::string &wireType, const Json::Value ¶mJson, const std::string &objectName, const Json::Value &typeModifiers) const |
| const std::unordered_map < std::string, DtScriptedTaskCustomMapping > & | scriptedTaskMappings () const |
Private Types | |
| using | BuilderPtr = std::unique_ptr< DtCommandSpecParamBuilder > |
| using | Factory = std::function< BuilderPtr(const Json::Value &, const std::string &, const Json::Value &)> |
Private Member Functions | |
| void | registerBuilders (DtScenarioManager &scnMgr) |
| template<typename TParam , typename... ExtraArgs> | |
| Factory | makeFactory (DtScenarioManager &scnMgr, ExtraArgs &&...extraArgs) |
| Factory | makeResourceFactory (DtScenarioManager &scnMgr, DtResourceListCommandSpecParamBuilder::RequestType type) |
Static Private Member Functions | |
| template<typename TParam , typename Tuple , std::size_t... I> | |
| static BuilderPtr | makeWithTuple (DtScenarioManager &scnMgr, const Json::Value ¶mJson, const std::string &objectName, const Json::Value &typeModifiers, const Tuple &extras, std::index_sequence< I...>) |
Private Attributes | |
| std::unordered_map < std::string, Factory > | myFactories |
| std::unordered_map < std::string, DtScriptedTaskCustomMapping > | myScriptedTaskMappings |
|
private |
|
private |
Factory signature: (paramJson, objectName, typeModifiers) → builder.
|
explicit |
|
default |
|
delete |
|
delete |
| bool DtCustomParamBuilderRegistry::hasBuilder | ( | const std::string & | wireType | ) | const |
Returns true if an async builder is registered for wireType.
| std::unique_ptr<DtCommandSpecParamBuilder> DtCustomParamBuilderRegistry::build | ( | const std::string & | wireType, |
| const Json::Value & | paramJson, | ||
| const std::string & | objectName, | ||
| const Json::Value & | typeModifiers | ||
| ) | const |
Constructs and returns an async builder for wireType, or nullptr if no builder is registered for that type. typeModifiers carries the TypeModifiers object from the catalog entry, or an empty object when the parameter originates from a scripted task variable.
| const std::unordered_map<std::string, DtScriptedTaskCustomMapping>& DtCustomParamBuilderRegistry::scriptedTaskMappings | ( | ) | const |
Returns the map from VRF scripted task variable type string to custom mapping info. DtScriptedTaskParamSpecBuilder iterates this to auto-register all custom builders without needing to enumerate them explicitly.
|
private |
|
inlinestaticprivate |
|
inlineprivate |
{@ Factory maker templates. These generate the lambda functions that construct builders Overloaded for parameter parsing into the different types of builders we have
References ImGui::Value().
|
inlineprivate |
References ImGui::Value().
|
private |
|
private |