Table of Contents

Interface IRuntimeDataContainerFactory

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

Engine-agnostic factory for creating RuntimeDataContainer instances. Enables testability and decouples container creation from discovery.

public interface IRuntimeDataContainerFactory

Methods

CreateContainer(Type)

Creates an instance of the specified RuntimeDataContainer type.

IRuntimeDataContainer CreateContainer(Type containerType)

Parameters

containerType Type

The concrete container type to instantiate.

Returns

IRuntimeDataContainer

The created container instance.

Exceptions

InvalidOperationException

Thrown if the type is not a valid container type.

IsValidContainerType(Type)

Validates that a type is a valid concrete RuntimeDataContainer. A valid container type must be:

  • Non-null
  • Not abstract
  • Not an interface
  • Assignable to IRuntimeDataContainer
  • Have a parameterless constructor
bool IsValidContainerType(Type type)

Parameters

type Type

The type to validate.

Returns

bool

True if the type is a valid container type, false otherwise.