MBSubModuleBaseWrapper
Wraps a MBSubModuleBase and gives the ability to easy call the protected internal methods like OnSubModuleLoad().
MBSubModuleBaseListWrapper
The same as previous, wraps multiple MBSubModuleBase instead of one.
Usage
MBSubModuleBaseListWrapper could be used if you need to dynamically load specific SubModules based on some condition.
You need to create a MBSubModuleBase class that derives from MBSubModuleBaseListWrapper, in which you decide what assemblies to load.
MBSubModuleBaseListWrapper will check the SubModules property for the SubModules and proxy any game call to them.
Dont forget to include the new SubModule in SubModule.xml!
<SubModule>
<Name value="Dynamic SubModule Loader" />
<DLLName value="Module.dll" />
<SubModuleClassType value="Module.DynamicSubModuleLoader" />
<Tags/>
</SubModule>
public sealed class DynamicSubModuleLoader : MBSubModuleBaseListWrapper
{
protected override void OnSubModuleLoad()
{
// Add any MBSubModuleBase instance that should be handled.
SubModules.AddRange(...);
base.OnSubModuleLoad();
}
}
See ImplementationLoaderSubModule for an example.
This page was last modified at 05/14/2024 20:48:29 +03:00 (UTC).
Commit Message
Author: Alexey Chernyshov
Commit: d76fb0604f29fb7028974b2ac3dd16ea20a8a450
Fixed a buch of refs in docs