Class Module
For internal use only, please use Module<T>.
public abstract class Module : PluginFeature, IDisposable
- Inheritance
-
objectCorePropertyChangedModule
- Implements
- Derived
-
Module<T>
- Inherited Members
Constructors
Module()
The base constructor of the Module class.
protected Module()
Fields
HiddenPropertiesList
Gets a list of all properties ignored at runtime using IgnoreProperty(x => x.y)
protected readonly List<PropertyInfo> HiddenPropertiesList
Field Value
Properties
ActivationRequirementMode
Gets or sets the activation requirement mode, defaults to Any
public ActivationRequirementType ActivationRequirementMode { get; set; }
Property Value
ActivationRequirements
A list of activation requirements
If this list is not null and not empty IsAlwaysAvailable becomes false and the data of this module is only available to profiles specifically targeting it.
public abstract List<IModuleActivationRequirement>? ActivationRequirements { get; }
Property Value
DefaultProfilePaths
Gets a read only collection of default profile paths
public IReadOnlyCollection<(DefaultCategoryName, string)> DefaultProfilePaths { get; }
Property Value
HiddenProperties
Gets a list of all properties ignored at runtime using IgnoreProperty(x => x.y)
public ReadOnlyCollection<PropertyInfo> HiddenProperties { get; }
Property Value
IsActivated
Gets whether this module is activated. A module can only be active while its ActivationRequirements are met
public bool IsActivated { get; }
Property Value
IsActivatedOverride
Gets whether this module's activation was due to an override, can only be true if IsActivated is true
public bool IsActivatedOverride { get; }
Property Value
IsAlwaysAvailable
Gets a boolean indicating whether this module is always available to profiles or only to profiles that specifically target this module.
Note: true if there are any ActivationRequirements; otherwise false
public bool IsAlwaysAvailable { get; }
Property Value
IsUpdateAllowed
Gets whether updating this module is currently allowed
public bool IsUpdateAllowed { get; }
Property Value
UpdateDuringActivationOverride
Gets whether this module should update while IsActivatedOverride is true. When set to false Update(double) and any timed updates will not get called during an activation override.
Defaults to false
public bool UpdateDuringActivationOverride { get; protected set; }
Property Value
Methods
AddDefaultProfile(DefaultCategoryName, string)
Adds a default profile by reading it from the file found at the provided path
protected bool AddDefaultProfile(DefaultCategoryName category, string file)
Parameters
categoryDefaultCategoryNameThe category in which to place the default profile
filestringA path pointing towards a profile file. May be relative to the plugin directory.
Returns
EvaluateActivationRequirements()
Evaluates the activation requirements following the ActivationRequirementMode and returns the result
public bool EvaluateActivationRequirements()
Returns
- bool
The evaluated result of the activation requirements
GetDataModelDescription()
Override to provide your own data model description. By default this returns a description matching your plugin name and description
public virtual DataModelPropertyAttribute GetDataModelDescription()
Returns
ModuleActivated(bool)
Called when the ActivationRequirements are met or during an override
public virtual void ModuleActivated(bool isOverride)
Parameters
isOverrideboolIf true, the activation was due to an override. This usually means the module was activated by the profile editor
ModuleDeactivated(bool)
Called when the ActivationRequirements are no longer met or during an override
public virtual void ModuleDeactivated(bool isOverride)
Parameters
isOverrideboolIf true, the deactivation was due to an override. This usually means the module was deactivated by the profile editor
Update(double)
Called each frame when the module should update
public abstract void Update(double deltaTime)
Parameters
deltaTimedoubleTime in seconds since the last update