ComponentCodec class abstract

Translates between a serialized ComponentSpec and a live Component of one type.

Codecs are registered in a FsceneComponentRegistry; the realizer and serializer dispatch through it. This is the seam that lets the format carry component types the core does not know about.

Constructors

ComponentCodec()

Properties

hashCode int
The hash code for this object.
no setterinherited
propertySchema List<ComponentPropertyDef>
The component's editable properties, in display order. Drives the inspector, agent discovery, default-filling on realize, and the derived serialize. Empty for codecs that do not declare a schema.
no setter
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
type String
The serialized component type name this codec handles (for example directionalLight).
no setter

Methods

boolDefault(String name) bool
The declared default for a ComponentPropertyKind.boolean property.
claims(Component component) bool
Whether component is an instance this codec serializes. Used by the derived serialize; a codec that overrides serialize need not implement this.
defaultOf(String name) PropertyValue?
The declared default for property name, or null when the property has no default (throws when name is undeclared).
intDefault(String name) int
The declared default for an ComponentPropertyKind.integer property.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
numberDefault(String name) double
The declared default for a ComponentPropertyKind.number (or integer) property name, as a double.
realize(ComponentSpec spec, RealizeContext context) Component?
Builds a live component from spec, or returns null when it cannot be realized in the given context (for example a mesh with no resource realizer).
serialize(Component component, SerializeContext context) ComponentSpec?
Serializes component to a ComponentSpec, or returns null if this codec does not handle that component instance.
stringDefault(String name) String
The declared default for a ComponentPropertyKind.string property.
toString() String
A string representation of this object.
inherited
vec3Default(String name) → Vector3
The declared default for a ComponentPropertyKind.vec3 property (cloned).

Operators

operator ==(Object other) bool
The equality operator.
inherited