Table of Contents

Interface ISchemaRegistrar

Namespace
Typhon.Engine
Assembly
Typhon.Engine.dll

Allows callers to register component types and migrations for dry-run validation.

public interface ISchemaRegistrar

Methods

RegisterByteMigration(string, int, int, int, int, ByteMigrationFunc)

Registers a byte-level migration for a component whose old struct type is no longer available in code.

void RegisterByteMigration(string name, int fromRev, int toRev, int oldSize, int newSize, ByteMigrationFunc func)

Parameters

name string

Component (schema) name.

fromRev int

Source revision.

toRev int

Target revision.

oldSize int

Byte size of the old component layout.

newSize int

Byte size of the new component layout.

func ByteMigrationFunc

Delegate that transforms the raw old bytes into the raw new bytes.

RegisterComponent<T>()

Registers component type T for validation against the persisted schema.

void RegisterComponent<T>() where T : unmanaged

Type Parameters

T

The component struct type.

RegisterMigration<TOld, TNew>(MigrationFunc<TOld, TNew>)

Registers a strongly-typed migration between two revisions of the same component.

void RegisterMigration<TOld, TNew>(MigrationFunc<TOld, TNew> func) where TOld : unmanaged where TNew : unmanaged

Parameters

func MigrationFunc<TOld, TNew>

Delegate that transforms an old-revision value into a new-revision value.

Type Parameters

TOld

The source revision's struct type.

TNew

The target revision's struct type.