Table of Contents

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 10/13/2020 15:35:52 +03:00 (UTC).

Commit Message
Author:    aragas
Commit:    f25a1264d096d9287b99c5d2b04bd6032ad81546
Actually fixed the shit