Table of Contents

Interface ITypeSource<T>

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

Interface for a type source that manages objects of a specific type T.

public interface ITypeSource<T> : ITypeSource where T : class

Type Parameters

T
Inherited Members
Extension Methods

Methods

Add<TX>(IPlugin, bool)

Add an object to the source of the type TX.

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.

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

Parameters

plugin IPlugin
obj TX
failIfExists bool

Type Parameters

TX

ForEach(Action<T>)

Get an object from the source.

void ForEach(Action<T> action)

Parameters

action Action<T>

Get(Type, bool)

Get an object from the source.

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

Parameters

type Type
required bool

Returns

T

GetList()

Get all objects from the source.

List<T> GetList()

Returns

List<T>

GetOrCreate<TX>(IPlugin)

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

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.

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

Parameters

required bool

Returns

TX

Type Parameters

TX

Has<TX>(out TX?)

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

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.

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

Parameters

plugin IPlugin

Type Parameters

TX

Remove<TX>(IPlugin, TX)

Remove an object from the source.

void Remove<TX>(IPlugin plugin, TX obj) where TX : T

Parameters

plugin IPlugin
obj TX

Type Parameters

TX

RequiredType()

Get the type of the object that is required.

Type RequiredType()

Returns

Type

RequiredTypeName()

Get the name of the type that is required.

string RequiredTypeName()

Returns

string

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

Select an enumerable of objects from the source.

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

Parameters

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

Returns

IEnumerable<T>