Table of Contents

Class TypeMapManagerSource<T, TM>

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

A manager source that uses a type map to manage instances of IManageable<T>.

public class TypeMapManagerSource<T, TM> : ManagerSource<T, TM>, IManagerSource<T, TM>, IManagerSource, ITypeSource<T>, ITypeSource where T : class, IManageable<TM> where TM : class, IManager

Type Parameters

T

The type of manageable objects, which must implement IManageable<T>.

TM

The type of manager, which must implement IManager.

Inheritance
TypeMapManagerSource<T, TM>
Implements
Inherited Members
Extension Methods

Properties

Log

protected override Logger Log { get; }

Property Value

Logger

Methods

Add<TX>(IPlugin, bool)

Add an object to the source of the type TX.

public override TX? Add<TX>(IPlugin plugin, bool failIfExists = true) where TX : T

Parameters

plugin IPlugin
failIfExists bool

Returns

TX

Type Parameters

TX

Add<TX>(IPlugin, TX, bool)

Add an object to the source.

public override void Add<TX>(IPlugin plugin, TX obj, bool failIfExists = true) where TX : T

Parameters

plugin IPlugin
obj TX
failIfExists bool

Type Parameters

TX

Count()

Get the count of objects in the source.

public override int Count()

Returns

int

ForEach(Action<T>)

Get an object from the source.

public override void ForEach(Action<T> action)

Parameters

action Action<T>

Get(Type, bool)

Get an object from the source.

public override T? Get(Type type, bool required = true)

Parameters

type Type
required bool

Returns

T

GetList()

Get all objects from the source.

public override List<T> GetList()

Returns

List<T>

GetManagedInfo()

Get information about the managed instances.

public override string GetManagedInfo()

Returns

string

GetOrCreate<TX>(IPlugin)

Get an object from the source or create and add if not.

public override TX GetOrCreate<TX>(IPlugin plugin) where TX : T

Parameters

plugin IPlugin

Returns

TX

Type Parameters

TX

Get<TX>(bool)

Get an object from the source.

public override TX? Get<TX>(bool required = true) where TX : T

Parameters

required bool

Returns

TX

Type Parameters

TX

Has(string, out IManageable?, bool)

Do we have a manageable of a type name.

public override bool Has(string typeName, out IManageable? manageable, bool checkAssignable = true)

Parameters

typeName string
manageable IManageable
checkAssignable bool

Returns

bool

Has(Type, out IManageable, bool)

Do we have an object of the type TX in the source.

public override bool Has(Type type, out IManageable manageable, bool checkAssignable = true)

Parameters

type Type
manageable IManageable
checkAssignable bool

Returns

bool

Has<TX>(out TX)

Do we have an object of the type TX in the source.

public override bool Has<TX>(out TX manageable) where TX : T

Parameters

manageable TX

Returns

bool

Type Parameters

TX

Remove<TX>(IPlugin)

Remove an object from the source.

public override void Remove<TX>(IPlugin plugin) where TX : T

Parameters

plugin IPlugin

Type Parameters

TX

Select(Func<KeyValuePair<Type, T>, T>)

Select an enumerable of objects from the source.

public override IEnumerable<T> Select(Func<KeyValuePair<Type, T>, T> selector)

Parameters

selector Func<KeyValuePair<Type, T>, T>

Returns

IEnumerable<T>