Table of Contents

Class StoreDefinitionRegistry

Namespace
Shard.Stores
Assembly
Shard.Stores.dll

Thread-safe collector for the Store definitions shared by every gameplay world.

public sealed class StoreDefinitionRegistry : IStoreDefinitionRegistry
Inheritance
StoreDefinitionRegistry
Implements
Inherited Members

Remarks

Freezing is idempotent and captures one immutable, registration-ordered definition set without invoking its recipes. Every later registration fails. When a captured recipe fails during Store composition, application stops at that recipe, reports its owning module identifier, and leaves disposal of the unpublished candidate Store to the composition owner.

Properties

IsFrozen

Gets whether registration has closed and the immutable definition set has been captured.

public bool IsFrozen { get; }

Property Value

bool

Methods

Register(string, StoreDefinitionRecipe)

Registers synchronous Store definitions owned by the specified server module.

public void Register(string moduleId, StoreDefinitionRecipe define)

Parameters

moduleId string

The stable, ordinally compared identifier of the server module that owns the definition.

define StoreDefinitionRecipe

The synchronous definition recipe applied to each created Store after freezing.

Remarks

Recipes run in registration order. Registration does not invoke define or validate its Store effects.

Exceptions

ArgumentException

Thrown when moduleId is empty or contains only whitespace.

ArgumentNullException

Thrown when moduleId or define is null.

InvalidOperationException

Thrown when the registry is frozen or the exact module identifier is already registered.

Register<TModule>(string)

Registers one root Flecs module owned by the specified server module.

public void Register<TModule>(string moduleId) where TModule : IFlecsModule, new()

Parameters

moduleId string

The stable, ordinally compared identifier of the server module that owns the definition.

Type Parameters

TModule

Remarks

The Flecs module is imported into each created Store after the registry freezes.

Exceptions

ArgumentException

Thrown when moduleId is empty or contains only whitespace.

ArgumentNullException

Thrown when moduleId is null.

InvalidOperationException

Thrown when the registry is frozen or the exact module identifier is already registered.