Table of Contents

Class Module

Namespace
Artemis.Core.Modules
Assembly
Artemis.Core.dll

For internal use only, please use Module<T>.

public abstract class Module : PluginFeature, IDisposable
Inheritance
object
CorePropertyChanged
Module
Implements
Derived
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

List<PropertyInfo>

Properties

ActivationRequirementMode

Gets or sets the activation requirement mode, defaults to Any

public ActivationRequirementType ActivationRequirementMode { get; set; }

Property Value

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.

public abstract List<IModuleActivationRequirement>? ActivationRequirements { get; }

Property Value

List<IModuleActivationRequirement>

DefaultProfilePaths

Gets a read only collection of default profile paths

public IReadOnlyCollection<(DefaultCategoryName, string)> DefaultProfilePaths { get; }

Property Value

IReadOnlyCollection<(DefaultCategoryName, string)>

HiddenProperties

Gets a list of all properties ignored at runtime using IgnoreProperty(x => x.y)

public ReadOnlyCollection<PropertyInfo> HiddenProperties { get; }

Property Value

ReadOnlyCollection<PropertyInfo>

IsActivated

Gets whether this module is activated. A module can only be active while its ActivationRequirements are met

public bool IsActivated { get; }

Property Value

bool

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

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

public bool IsAlwaysAvailable { get; }

Property Value

bool

IsUpdateAllowed

Gets whether updating this module is currently allowed

public bool IsUpdateAllowed { get; }

Property Value

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

public bool UpdateDuringActivationOverride { get; protected set; }

Property Value

bool

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

category DefaultCategoryName

The category in which to place the default profile

file string

A path pointing towards a profile file. May be relative to the plugin directory.

Returns

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

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

DataModelPropertyAttribute

ModuleActivated(bool)

Called when the ActivationRequirements are met or during an override

public virtual void ModuleActivated(bool isOverride)

Parameters

isOverride bool

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

public virtual void ModuleDeactivated(bool isOverride)

Parameters

isOverride bool

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

public abstract void Update(double deltaTime)

Parameters

deltaTime double

Time in seconds since the last update