Table of Contents

Class ArchetypeAttribute

Namespace
Typhon.Schema.Definition
Assembly
Typhon.Schema.Definition.dll

Marks a class as an ECS archetype. The archetype's durable identity is its Name (defaulting to the declaring CLR type's simple name); the engine assigns the per-process catalog id and the per-DB routing id automatically, and re-matches persisted archetypes by Name — then PreviousName — on reopen (feature #514 D1/D4 — no author-set id).

[AttributeUsage(AttributeTargets.Class, Inherited = false)]
public sealed class ArchetypeAttribute : Attribute
Inheritance
ArchetypeAttribute
Inherited Members

Constructors

ArchetypeAttribute(int, string)

Declares an archetype. Its durable identity is Name (defaulting to the declaring CLR type's simple name): the engine assigns the per-process catalog id and the per-DB routing id automatically, and re-matches persisted archetypes by Name then PreviousName on reopen.

public ArchetypeAttribute(int revision = 1, string alias = null)

Parameters

revision int

Schema revision (see Revision). Defaults to 1.

alias string

Optional human-readable label used by the Workbench (see Alias). Falls back to the declaring type name when null.

Properties

Alias

Optional human-readable label used by the Workbench (Data Flow Timeline, Access Matrix, System DAG side panel). Falls back to the declaring type name when null. Has no effect on persisted EntityIds.

public string Alias { get; }

Property Value

string

Name

Registered archetype name — the stable schema identity persisted with the data and matched by name when the database is reopened. Optional: defaults to the declaring CLR type's simple name when null, so simple cases need no override. Set it to keep the durable identity stable across a class rename (the routing id embedded in every existing EntityId is keyed to this name), or to give the archetype a name that differs from its C# type.

public string Name { get; set; }

Property Value

string

PreviousName

Former Name of this archetype, set when it is renamed so the persisted archetype can be matched to the new name on reopen and its routing id carried forward. After the first reopen the engine re-stamps the persisted name, so this hint can be dropped in a later release. null when never renamed.

public string PreviousName { get; set; }

Property Value

string

Revision

Schema revision. Increment when the component set changes (add/remove components).

public int Revision { get; }

Property Value

int