Class StateTransitionTransaction
A class to represent a transaction for changing the state of loaded mods.
Implements
Inherited Members
Namespace: IPA.Loader
Assembly: IPA.Loader.dll
Syntax
public sealed class StateTransitionTransaction : IDisposable
Properties
| Improve this Doc View SourceDisabledPlugins
Gets a list of plugins that are disabled according to this transaction's current state.
Declaration
public IEnumerable<PluginMetadata> DisabledPlugins { get; }
Property Value
Type | Description |
---|---|
IEnumerable<PluginMetadata> |
EnabledPlugins
Gets a list of plugins that are enabled according to this transaction's current state.
Declaration
public IEnumerable<PluginMetadata> EnabledPlugins { get; }
Property Value
Type | Description |
---|---|
IEnumerable<PluginMetadata> |
WillNeedRestart
Gets whether or not a game restart will be necessary to fully apply this transaction.
Declaration
public bool WillNeedRestart { get; }
Property Value
Type | Description |
---|---|
Boolean | true if any mod who's state is changed cannot be changed at runtime, false otherwise |
Methods
| Improve this Doc View SourceCommit()
Commits this transaction to actual state, enabling and disabling plugins as necessary.
Declaration
public Task Commit()
Returns
Type | Description |
---|---|
Task | a Task which completes whenever all disables complete |
Disable(PluginMetadata)
Disables a plugin in this transaction.
Declaration
public bool Disable(PluginMetadata meta)
Parameters
Type | Name | Description |
---|---|---|
PluginMetadata | meta | the plugin to disable |
Returns
Type | Description |
---|---|
Boolean | true if the transaction's state was changed, false otherwise |
Dispose()
Disposes and discards this transaction without committing it.
Declaration
public void Dispose()
Enable(PluginMetadata)
Enables a plugin in this transaction.
Declaration
public bool Enable(PluginMetadata meta)
Parameters
Type | Name | Description |
---|---|---|
PluginMetadata | meta | the plugin to enable |
Returns
Type | Description |
---|---|
Boolean | true if the transaction's state was changed, false otherwise |
IsDisabled(PluginMetadata)
Checks if a plugin is disabled according to this transaction's current state.
Declaration
public bool IsDisabled(PluginMetadata meta)
Parameters
Type | Name | Description |
---|---|---|
PluginMetadata | meta | the plugin to check |
Returns
Type | Description |
---|---|
Boolean | true if the plugin is disabled, false otherwise |
Remarks
This should be roughly equivalent to DisabledPlugins.Contains(meta)
, but more performant.
This should also always return the inverse of IsEnabled(PluginMetadata) for valid plugins.
See Also
| Improve this Doc View SourceIsEnabled(PluginMetadata)
Checks if a plugin is enabled according to this transaction's current state.
Declaration
public bool IsEnabled(PluginMetadata meta)
Parameters
Type | Name | Description |
---|---|---|
PluginMetadata | meta | the plugin to check |
Returns
Type | Description |
---|---|
Boolean | true if the plugin is enabled, false otherwise |
Remarks
This should be roughly equivalent to EnabledPlugins.Contains(meta)
, but more performant.
This should also always return the inverse of IsDisabled(PluginMetadata) for valid plugins.