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; the store spawns through a Comp's Spawner.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Comp ¶
type Comp interface {
Spawner() Spawner
LoadToken() goke.CompToken
// contains filtered or unexported methods
}
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 world's way in.
type Spawner ¶
type Spawner interface {
Columns() []goke.Addable
Write(cursor *goke.Cursor, i int, row any, id uid.UID64)
}
Spawner writes one component onto the entities a world spawns — what a world asks a Comp for.
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.