Table of Contents

Interface IServerComponentRegistry<TNetworkManager, TConnection, TServerComponent>

Namespace
FishMMO.Server.Core
Assembly
FishMMO.Server.dll

Generic interface for server component registries. Defines the contract for registering, retrieving, and managing server components (behaviours, data containers, etc.).

public interface IServerComponentRegistry<TNetworkManager, TConnection, TServerComponent> where TServerComponent : IServerComponent

Type Parameters

TNetworkManager

The network manager type.

TConnection

The connection type.

TServerComponent

The base component type being managed.

Methods

DeinitializeAll()

Deinitializes and cleans up all registered components.

void DeinitializeAll()

Get<T>()

Gets a registered component instance, or null if not found.

T Get<T>() where T : class, TServerComponent

Returns

T

The component instance if found, otherwise null.

Type Parameters

T

The type of the component to retrieve.

InitializeAll(IServer)

Initializes all registered components with the provided server context.

void InitializeAll(IServer server)

Parameters

server IServer

The server instance that owns this registry.

Register<T>(T)

Registers a component instance for global access. The component will be registered under every interface it implements that derives from TServerComponent, as well as under its concrete type.

void Register<T>(T component) where T : class, TServerComponent

Parameters

component T

The component instance to register.

Type Parameters

T

The concrete type of the component.

TryGet<T>(out T)

Attempts to get a registered component instance.

bool TryGet<T>(out T component) where T : class, TServerComponent

Parameters

component T

The output component instance if found.

Returns

bool

True if the component was found, otherwise false.

Type Parameters

T

The type of the component to retrieve.

Unregister<T>(T)

Unregisters a component instance from global access. Removes any entries keyed by the concrete type and by any interfaces it implemented.

void Unregister<T>(T component) where T : class, TServerComponent

Parameters

component T

The component instance to unregister.

Type Parameters

T

The concrete type of the component.