Table of Contents

Interface IManager

Namespace
RisingV.Shared.Managers
Assembly
RisingV.Shared.dll

Interface for a manager that handles manageable objects.

public interface IManager : IManageable
Extension Methods

Properties

IsInitialized

Indicates whether the manager is initialized.

bool IsInitialized { get; }

Property Value

bool

IsLoaded

Indicates whether the manager is finished loading.

bool IsLoaded { get; }

Property Value

bool

IsReady

Indicates whether the manager is ready to be used.

bool IsReady { get; }

Property Value

bool

UnsubscribeEventsOnRemoval

Indicates whether the manager should unsubscribe from events when manageable objects are removed.

bool UnsubscribeEventsOnRemoval { get; }

Property Value

bool

Methods

Add<TX>(IPlugin, Type, bool)

Get a manageable object of the given type.

void Add<TX>(IPlugin plugin, Type type, bool failIfExists = true) where TX : IManageable

Parameters

plugin IPlugin

The plugin that is requesting the manageable object.

type Type

The type of the manageable object to get.

failIfExists bool

If true, will throw an exception if the manageable object already exists.

Type Parameters

TX

Type of the manageable object to get, must implement IManageable.

AssignDependentPlugins(Type, List<IPlugin>)

Assign a list of dependent plugins to the given type.

void AssignDependentPlugins(Type type, List<IPlugin> dependentPlugins)

Parameters

type Type
dependentPlugins List<IPlugin>

Count()

Count the number of manageable objects that are managed by this manager.

int Count()

Returns

int

GetDependentPlugins(Type, params IPlugin[]?)

Get a list of plugins that depend on the given type.

List<IPlugin> GetDependentPlugins(Type type, params IPlugin[]? additionalPlugins)

Parameters

type Type
additionalPlugins IPlugin[]

Returns

List<IPlugin>

GetManagedInfo()

Get a formatted string of all manageable objects that are managed by this manager.

string GetManagedInfo()

Returns

string

Has(string, bool, bool)

Check if the manager has a manageable object of the given type by its name.

bool Has(string typeName, bool checkAssignable = true, bool checkEnabled = true)

Parameters

typeName string
checkAssignable bool
checkEnabled bool

Returns

bool

Has(Type, bool, bool)

Check if the manager has a manageable object of the given type.

bool Has(Type type, bool checkAssignable = true, bool checkEnabled = true)

Parameters

type Type
checkAssignable bool
checkEnabled bool

Returns

bool

Initialize(IPlugin)

Initialize the manager with the given plugin including its manageable objects.

void Initialize(IPlugin plugin)

Parameters

plugin IPlugin

IsEnabled(IManageable?)

Check if the manageable object is enabled.

bool IsEnabled(IManageable? manageable)

Parameters

manageable IManageable

Returns

bool

Load(IPlugin)

Load the manager with the given plugin including its manageable objects. This should be called after all other Managers have been initialized.

void Load(IPlugin plugin)

Parameters

plugin IPlugin

OnReload(IPlugin, ReloadReason)

Called when a reload is requested, can be used to perform custom actions before the reload and override the default reload behavior.

bool OnReload(IPlugin plugin, ReloadReason reason)

Parameters

plugin IPlugin
reason ReloadReason

Returns

bool

true to allow default reload behaviour, false to stop

Ready(IPlugin)

Ready the manager with the given plugin including its manageable objects. This should be called after all other Managers have been loaded.

void Ready(IPlugin plugin)

Parameters

plugin IPlugin

Reload(IPlugin, ReloadReason)

Reload the manager with the given plugin including its manageable objects. The manageable objects should be unloaded before calling their Reload method and should then be loaded after.

void Reload(IPlugin plugin, ReloadReason reason)

Parameters

plugin IPlugin
reason ReloadReason

RequiredType()

Type of the object that is required.

Type RequiredType()

Returns

Type

Returns the type of the required manageable object.

RequiredTypeName()

Type name of the object that is required.

string RequiredTypeName()

Returns

string

Returns the name of the required manageable object type.

Terminate(IPlugin)

Terminate the manager with the given plugin including its manageable objects. This should be called when the plugin is being unloaded or the manager is being disposed.

void Terminate(IPlugin plugin)

Parameters

plugin IPlugin

TryInitialize(IManageable, IPlugin)

Try to initialize the manageable object with the given plugin.

bool TryInitialize(IManageable manageable, IPlugin plugin)

Parameters

manageable IManageable
plugin IPlugin

Returns

bool

TryLoad(IManageable, IPlugin)

Try to load the manageable object with the given plugin.

bool TryLoad(IManageable manageable, IPlugin plugin)

Parameters

manageable IManageable
plugin IPlugin

Returns

bool

TryReload(IManageable, IPlugin, ReloadReason)

Try to reload the manageable object with the given plugin.

bool TryReload(IManageable manageable, IPlugin plugin, ReloadReason reason)

Parameters

manageable IManageable
plugin IPlugin
reason ReloadReason

Returns

bool

TryTerminate(IManageable, IPlugin)

Try to unload the manageable object with the given plugin.

bool TryTerminate(IManageable manageable, IPlugin plugin)

Parameters

manageable IManageable
plugin IPlugin

Returns

bool

TryUnload(IManageable, IPlugin)

Try to ready the manageable object with the given plugin.

bool TryUnload(IManageable manageable, IPlugin plugin)

Parameters

manageable IManageable
plugin IPlugin

Returns

bool

Unload(IPlugin)

Unload the manager with the given plugin including its manageable objects. This should be called before the manager is terminated.

void Unload(IPlugin plugin)

Parameters

plugin IPlugin