Class Module
For internal use only, please use Module<T>.
Implements
Inherited Members
Namespace: Artemis.Core.Modules
Assembly: Artemis.Core.dll
Syntax
public abstract class Module : PluginFeature, IDisposable
Constructors
Module()
The base constructor of the Module class.
Declaration
protected Module()
Fields
HiddenPropertiesList
Gets a list of all properties ignored at runtime using IgnoreProperty(x => x.y)
Declaration
protected readonly List<PropertyInfo> HiddenPropertiesList
Field Value
Type | Description |
---|---|
List<PropertyInfo> |
Properties
ActivationRequirementMode
Gets or sets the activation requirement mode, defaults to Any
Declaration
public ActivationRequirementType ActivationRequirementMode { get; set; }
Property Value
Type | Description |
---|---|
ActivationRequirementType |
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.
Declaration
public abstract List<IModuleActivationRequirement>? ActivationRequirements { get; }
Property Value
Type | Description |
---|---|
List<IModuleActivationRequirement> |
DefaultProfilePaths
Gets a read only collection of default profile paths
Declaration
public IReadOnlyCollection<(DefaultCategoryName, string)> DefaultProfilePaths { get; }
Property Value
Type | Description |
---|---|
IReadOnlyCollection<(DefaultCategoryName, string)> |
HiddenProperties
Gets a list of all properties ignored at runtime using IgnoreProperty(x => x.y)
Declaration
public ReadOnlyCollection<PropertyInfo> HiddenProperties { get; }
Property Value
Type | Description |
---|---|
ReadOnlyCollection<PropertyInfo> |
IsActivated
Gets whether this module is activated. A module can only be active while its ActivationRequirements are met
Declaration
public bool IsActivated { get; }
Property Value
Type | Description |
---|---|
bool |
IsActivatedOverride
Gets whether this module's activation was due to an override, can only be true if IsActivated is true
Declaration
public bool IsActivatedOverride { get; }
Property Value
Type | Description |
---|---|
bool |
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
Declaration
public bool IsAlwaysAvailable { get; }
Property Value
Type | Description |
---|---|
bool |
IsUpdateAllowed
Gets whether updating this module is currently allowed
Declaration
public bool IsUpdateAllowed { get; }
Property Value
Type | Description |
---|---|
bool |
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
Declaration
public bool UpdateDuringActivationOverride { get; protected set; }
Property Value
Type | Description |
---|---|
bool |
Methods
AddDefaultProfile(DefaultCategoryName, string)
Adds a default profile by reading it from the file found at the provided path
Declaration
protected bool AddDefaultProfile(DefaultCategoryName category, string file)
Parameters
Type | Name | Description |
---|---|---|
DefaultCategoryName | category | The category in which to place the default profile |
string | file | A path pointing towards a profile file. May be relative to the plugin directory. |
Returns
Type | Description |
---|---|
bool | true if the default profile was added; false if it was not because it is already in the list. |
EvaluateActivationRequirements()
Evaluates the activation requirements following the ActivationRequirementMode and returns the result
Declaration
public bool EvaluateActivationRequirements()
Returns
Type | Description |
---|---|
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
Declaration
public virtual DataModelPropertyAttribute GetDataModelDescription()
Returns
Type | Description |
---|---|
DataModelPropertyAttribute |
ModuleActivated(bool)
Called when the ActivationRequirements are met or during an override
Declaration
public virtual void ModuleActivated(bool isOverride)
Parameters
Type | Name | Description |
---|---|---|
bool | isOverride | If 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
Declaration
public virtual void ModuleDeactivated(bool isOverride)
Parameters
Type | Name | Description |
---|---|---|
bool | isOverride | If 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
Declaration
public abstract void Update(double deltaTime)
Parameters
Type | Name | Description |
---|---|---|
double | deltaTime | Time in seconds since the last update |