Core registers a Component Schema from a description (#75) #76
Labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
crowmaki/cinnabar#76
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Parent
#75
What to build
An engine developer can register a Component Schema from a plain description rather than from an Odin type, and can do so after startup. The description is a Boundary Type: a name, an array of field descriptions, and optional
on_addandon_removeHooks. A field description is a name and aComponent_Field_Kind; the Kind enum covers onlyF64,BoolandGameObject_Reference. Odin-derived Schemas keep theirtypeidinside Core and report no Kind, respecting ADR-0022's deferral.The new boundary proc,
engine_register_component_schema, maps each Kind to the Odin type Core already serializes, computes layout, and opens storage. It becomes the boundary route the Scene ABI test currently records as missing. A Schema registered this way is a first-class Schema: the serializer, both Scene Encodings and Play Mode capture see it exactly as they see an Odin Component.The Odin-type route and the description route should share their tail (name ownership, Schema append, storage open); factor that out first so the two cannot drift. The debug-only "called after startup" panic must apply only to Odin-type registration.
Acceptance criteria
Component_Schema_Desc,Component_Field_DescandComponent_Field_Kindare declared in the ABI Surface and closed over Boundary Typesengine_register_component_schemaregisters a Schema from a description duringregister/initand returns a usableComponent_Type.Framephase) succeeds; Odin-type registration after startup still panics underODIN_DEBUGGameObject_Referencefields carry the.Referenceflag and work withcomponent_reference/component_set_referenceengine_register_componentis retiredBlocked by