API Reference › Shared
IInterfaceManager
InterfaceNamespace: SwiftlyS2.Shared · Assembly: SwiftlyS2.CS2.dll
public interface IInterfaceManagerMethods
Add a keyed shared interface for other plugin to use. The interface must be defined in the contracts dll.
void AddSharedInterface<TInterface, TImpl>(string key, TImpl implInstance) where TInterface : class where TImpl : class, TInterfaceParameters
- keystringThe key of the interface.
- implInstanceTImplThe implementation of the interface.
Get a shared interface.
TInterface GetSharedInterface<TInterface>(string key) where TInterface : classParameters
- keystringThe key of the interface.
Returns
TInterface
The implementation of the interface.
Check if a shared interface exists.
bool HasSharedInterface(string key)Parameters
- keystringThe key of the interface.
Attempts to get a shared interface implementation by key.
bool TryGetSharedInterface<TInterface>(string key, out TInterface? instance) where TInterface : classParameters
- keystringThe key of the interface implementation.
- instanceTInterface?The implementation of the interface, or null if the implementation wasn't found.