Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrComponentSchemaMismatch = errors.New("component schema does not match target schema")
Functions ¶
func IsComponentValid ¶
Types ¶
type ArchetypeID ¶
type ArchetypeID int
type Component ¶
type Component interface { // Name returns the name of the component. Name() string }
Component is the interface that the user needs to implement to create a new component type.
func ConvertComponentMetadatasToComponents ¶
func ConvertComponentMetadatasToComponents(comps []ComponentMetadata) []Component
ConvertComponentMetadatasToComponents Cast an array of ComponentMetadata into an array of Component
type ComponentID ¶
type ComponentID int
type ComponentMetadata ¶
type ComponentMetadata interface { // SetID sets the ArchetypeID of this component. It must only be set once SetID(ComponentID) error // ArchetypeID returns the ArchetypeID of the component. ID() ComponentID // New returns the marshaled bytes of the default value for the component struct. New() ([]byte, error) Encode(any) ([]byte, error) Decode([]byte) (Component, error) GetSchema() []byte ValidateAgainstSchema(targetSchema []byte) error Component }
ComponentMetadata wraps the user-defined Component struct and provides functionalities that is used internally in the engine.
type Message ¶
type Message interface { SetID(MessageID) error Name() string // Group returns the group of the message. Group() string ID() MessageID Encode(any) ([]byte, error) Decode([]byte) (any, error) // DecodeEVMBytes decodes ABI encoded bytes into the message's input type. DecodeEVMBytes([]byte) (any, error) // ABIEncode encodes the given type in ABI encoding, given that the input is the message type's input or output // type. ABIEncode(any) ([]byte, error) // IsEVMCompatible reports if this message can be sent from the EVM. IsEVMCompatible() bool }
Click to show internal directories.
Click to hide internal directories.