Documentation
¶
Overview ¶
Package comp is how a template of entities names one component and where its value comes from: the same for every entity made from it (Const), read from each entity's own row (Load), the tags of one family (Tagged), the markers of one (Marks), or a default of the store's roster left out (Without). Nothing here is implemented by a user; a store's binding spawns through a Comp's Fill, into the place it laid out.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Comp ¶
type Comp interface {
// Type is the component type the Comp stands for.
Type() reflect.Type
// Row is the row type a Load reads, nil for a component that reads none.
Row() reflect.Type
// Fill writes the component's value for the entity row describes into dst, a value of
// Type the store laid out.
Fill(dst unsafe.Pointer, row any)
}
Comp is one component of a kind's Spec — made with Const, Load, Tagged or Without, never implemented by a game. Its methods are the spawning store's way in.
type Template ¶
type Template[T any] struct { // contains filtered or unexported fields }
Template yields one component value per spawned entity.
func Marks ¶
Marks is a Spec component giving every entity of the kind the markers of family F for good, all off: states a plugin switches on and off by a bit.
func Tagged ¶
Tagged is a Spec component giving every entity of the kind these tags of one family; a Spec names each family once. The tags come from world.Kinds.DefineTag.
func (Template[T]) Fill ¶ added in v0.2.0
Fill writes the value for row into dst; nothing for a T of no size.