ecs

package
v0.2.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 4, 2024 License: Unlicense Imports: 11 Imported by: 0

Documentation

Index

Constants

View Source
const (
	EntityIndexBits   = 20
	EntityIndexMask   = 1<<EntityIndexBits - 1
	EntityVersionBits = 32 - EntityIndexBits
	EntityVersionMask = math.MaxUint32 ^ EntityIndexMask
	DeadEntityID      = EntityIndexMask
)
View Source
const (
	EnumDirectionUnknown = 0
	EnumDirectionNorth   = 1
	EnumDirectionSouth   = 2
	EnumDirectionEast    = 4
	EnumDirectionWest    = 8
)

Variables

View Source
var (
	ErrEntityVersionMismatch = errors.New("entity version mismatch")
)

Functions

func EntitiesToU32s added in v0.2.0

func EntitiesToU32s(entities ...Entity) []uint32

func MergeWorldWriteAheadLogs added in v0.2.0

func MergeWorldWriteAheadLogs(patchs ...*ecspb.WorldPatch) *ecspb.WorldPatch

func NewWorldPatch added in v0.2.0

func NewWorldPatch() *ecspb.WorldPatch

func ResetWorldPatch added in v0.2.0

func ResetWorldPatch(patch *ecspb.WorldPatch) *ecspb.WorldPatch

Types

type AlliedWith

type AlliedWith []Entity

func AlliedWithFromEntities

func AlliedWithFromEntities(e ...Entity) AlliedWith

func AlliedWithFromEntity

func AlliedWithFromEntity(c []Entity) AlliedWith

func (AlliedWith) ToEntities

func (c AlliedWith) ToEntities() []Entity

func (AlliedWith) ToEntity

func (c AlliedWith) ToEntity() []Entity

func (AlliedWith) ToPB added in v0.2.0

func (AlliedWith) ToU32s added in v0.2.0

func (c AlliedWith) ToU32s() []uint32

type AlliedWithReadIterator

type AlliedWithReadIterator struct {
	// contains filtered or unexported fields
}

func (*AlliedWithReadIterator) HasNext

func (iter *AlliedWithReadIterator) HasNext() bool

func (*AlliedWithReadIterator) NextAlliedWith

func (iter *AlliedWithReadIterator) NextAlliedWith() (Entity, AlliedWith)

func (*AlliedWithReadIterator) NextEntity

func (iter *AlliedWithReadIterator) NextEntity() Entity

func (*AlliedWithReadIterator) Reset

func (iter *AlliedWithReadIterator) Reset()

type AlliedWithWriteIterator

type AlliedWithWriteIterator struct {
	// contains filtered or unexported fields
}

func (*AlliedWithWriteIterator) HasNext

func (iter *AlliedWithWriteIterator) HasNext() bool

func (*AlliedWithWriteIterator) NextAlliedWith

func (iter *AlliedWithWriteIterator) NextAlliedWith() (Entity, *AlliedWith)

func (*AlliedWithWriteIterator) NextEntity

func (iter *AlliedWithWriteIterator) NextEntity() Entity

func (*AlliedWithWriteIterator) Reset

func (iter *AlliedWithWriteIterator) Reset()

type ChildOf

type ChildOf Entity

func ChildOfFromEntity

func ChildOfFromEntity(c Entity) ChildOf

func (ChildOf) FromEntity

func (c ChildOf) FromEntity(e Entity) ChildOf

func (ChildOf) ToEntity

func (c ChildOf) ToEntity() Entity

func (ChildOf) ToPB added in v0.2.0

func (c ChildOf) ToPB() *ecspb.ChildOfComponent

type ChildOfReadIterator

type ChildOfReadIterator struct {
	// contains filtered or unexported fields
}

func (*ChildOfReadIterator) HasNext

func (iter *ChildOfReadIterator) HasNext() bool

func (*ChildOfReadIterator) NextChildOf

func (iter *ChildOfReadIterator) NextChildOf() (Entity, ChildOf)

func (*ChildOfReadIterator) NextEntity

func (iter *ChildOfReadIterator) NextEntity() Entity

func (*ChildOfReadIterator) Reset

func (iter *ChildOfReadIterator) Reset()

type ChildOfWriteIterator

type ChildOfWriteIterator struct {
	// contains filtered or unexported fields
}

func (*ChildOfWriteIterator) HasNext

func (iter *ChildOfWriteIterator) HasNext() bool

func (*ChildOfWriteIterator) NextChildOf

func (iter *ChildOfWriteIterator) NextChildOf() (Entity, *ChildOf)

func (*ChildOfWriteIterator) NextEntity

func (iter *ChildOfWriteIterator) NextEntity() Entity

func (*ChildOfWriteIterator) Reset

func (iter *ChildOfWriteIterator) Reset()

type Direction added in v0.2.0

type Direction EnumDirection

func DirectionFromEnumDirection added in v0.2.0

func DirectionFromEnumDirection(c EnumDirection) Direction

func (Direction) ToEnumDirection added in v0.2.0

func (c Direction) ToEnumDirection() EnumDirection

func (Direction) ToPB added in v0.2.0

type DirectionReadIterator added in v0.2.0

type DirectionReadIterator struct {
	// contains filtered or unexported fields
}

func (*DirectionReadIterator) HasNext added in v0.2.0

func (iter *DirectionReadIterator) HasNext() bool

func (*DirectionReadIterator) NextDirection added in v0.2.0

func (iter *DirectionReadIterator) NextDirection() (Entity, Direction)

func (*DirectionReadIterator) NextEntity added in v0.2.0

func (iter *DirectionReadIterator) NextEntity() Entity

func (*DirectionReadIterator) Reset added in v0.2.0

func (iter *DirectionReadIterator) Reset()

type DirectionWriteIterator added in v0.2.0

type DirectionWriteIterator struct {
	// contains filtered or unexported fields
}

func (*DirectionWriteIterator) HasNext added in v0.2.0

func (iter *DirectionWriteIterator) HasNext() bool

func (*DirectionWriteIterator) NextDirection added in v0.2.0

func (iter *DirectionWriteIterator) NextDirection() (Entity, *Direction)

func (*DirectionWriteIterator) NextEntity added in v0.2.0

func (iter *DirectionWriteIterator) NextEntity() Entity

func (*DirectionWriteIterator) Reset added in v0.2.0

func (iter *DirectionWriteIterator) Reset()

type DockedTo

type DockedTo Entity

func DockedToFromEntity

func DockedToFromEntity(c Entity) DockedTo

func (DockedTo) FromEntity

func (c DockedTo) FromEntity(e Entity) DockedTo

func (DockedTo) ToEntity

func (c DockedTo) ToEntity() Entity

func (DockedTo) ToPB added in v0.2.0

func (c DockedTo) ToPB() *ecspb.DockedToComponent

type DockedToReadIterator

type DockedToReadIterator struct {
	// contains filtered or unexported fields
}

func (*DockedToReadIterator) HasNext

func (iter *DockedToReadIterator) HasNext() bool

func (*DockedToReadIterator) NextDockedTo

func (iter *DockedToReadIterator) NextDockedTo() (Entity, DockedTo)

func (*DockedToReadIterator) NextEntity

func (iter *DockedToReadIterator) NextEntity() Entity

func (*DockedToReadIterator) Reset

func (iter *DockedToReadIterator) Reset()

type DockedToWriteIterator

type DockedToWriteIterator struct {
	// contains filtered or unexported fields
}

func (*DockedToWriteIterator) HasNext

func (iter *DockedToWriteIterator) HasNext() bool

func (*DockedToWriteIterator) NextDockedTo

func (iter *DockedToWriteIterator) NextDockedTo() (Entity, *DockedTo)

func (*DockedToWriteIterator) NextEntity

func (iter *DockedToWriteIterator) NextEntity() Entity

func (*DockedToWriteIterator) Reset

func (iter *DockedToWriteIterator) Reset()

type Eats

type Eats struct {
	Entities []Entity `json:"entities"`
	Amounts  []uint8  `json:"amounts"`
}

func (Eats) ToPB added in v0.2.0

func (c Eats) ToPB() *ecspb.EatsComponent

type EatsReadIterator

type EatsReadIterator struct {
	// contains filtered or unexported fields
}

func (*EatsReadIterator) HasNext

func (iter *EatsReadIterator) HasNext() bool

func (*EatsReadIterator) NextEats

func (iter *EatsReadIterator) NextEats() (Entity, Eats)

func (*EatsReadIterator) NextEntity

func (iter *EatsReadIterator) NextEntity() Entity

func (*EatsReadIterator) Reset

func (iter *EatsReadIterator) Reset()

type EatsWriteIterator

type EatsWriteIterator struct {
	// contains filtered or unexported fields
}

func (*EatsWriteIterator) HasNext

func (iter *EatsWriteIterator) HasNext() bool

func (*EatsWriteIterator) NextEats

func (iter *EatsWriteIterator) NextEats() (Entity, *Eats)

func (*EatsWriteIterator) NextEntity

func (iter *EatsWriteIterator) NextEntity() Entity

func (*EatsWriteIterator) Reset

func (iter *EatsWriteIterator) Reset()

type Enemy

type Enemy struct{}

type EnemyReadIterator

type EnemyReadIterator struct {
	// contains filtered or unexported fields
}

func (*EnemyReadIterator) HasNext

func (iter *EnemyReadIterator) HasNext() bool

func (*EnemyReadIterator) NextEntity

func (iter *EnemyReadIterator) NextEntity() Entity

func (*EnemyReadIterator) Reset

func (iter *EnemyReadIterator) Reset()

type EnemyWriteIterator

type EnemyWriteIterator struct {
	// contains filtered or unexported fields
}

func (*EnemyWriteIterator) HasNext

func (iter *EnemyWriteIterator) HasNext() bool

func (*EnemyWriteIterator) NextEntity

func (iter *EnemyWriteIterator) NextEntity() Entity

func (*EnemyWriteIterator) Reset

func (iter *EnemyWriteIterator) Reset()

type Entity

type Entity struct {
	// contains filtered or unexported fields
}

func (Entity) AlliedWithContains

func (e Entity) AlliedWithContains(other Entity) bool

func (Entity) Destroy

func (e Entity) Destroy()

func (Entity) GrowsContains

func (e Entity) GrowsContains(other Entity) bool

func (Entity) HasAlliedWith

func (e Entity) HasAlliedWith() bool

func (Entity) HasChildOf

func (e Entity) HasChildOf() bool

func (Entity) HasDirection added in v0.2.0

func (e Entity) HasDirection() bool

func (Entity) HasDockedTo

func (e Entity) HasDockedTo() bool

func (Entity) HasEats

func (e Entity) HasEats() bool

func (Entity) HasEnemyTag

func (e Entity) HasEnemyTag() bool

func (Entity) HasFaction

func (e Entity) HasFaction() bool

func (Entity) HasGravity

func (e Entity) HasGravity() bool

func (Entity) HasGrows

func (e Entity) HasGrows() bool

func (Entity) HasIsA

func (e Entity) HasIsA() bool

func (Entity) HasLikes

func (e Entity) HasLikes() bool

func (Entity) HasName

func (e Entity) HasName() bool

func (Entity) HasPlanetTag

func (e Entity) HasPlanetTag() bool

func (Entity) HasPosition

func (e Entity) HasPosition() bool

func (Entity) HasRotation

func (e Entity) HasRotation() bool

func (Entity) HasRuledBy

func (e Entity) HasRuledBy() bool

func (Entity) HasSpaceshipTag

func (e Entity) HasSpaceshipTag() bool

func (Entity) HasSpacestationTag

func (e Entity) HasSpacestationTag() bool

func (Entity) HasVelocity

func (e Entity) HasVelocity() bool

func (Entity) Index

func (e Entity) Index() int

func (Entity) IndexU32

func (e Entity) IndexU32() uint32

func (Entity) IsAlive

func (e Entity) IsAlive() bool

func (Entity) IsResourceEntity

func (e Entity) IsResourceEntity() bool

func (Entity) LikesContains

func (e Entity) LikesContains(other Entity) bool

func (Entity) Raw

func (e Entity) Raw() uint32

func (Entity) ReadAlliedWith

func (e Entity) ReadAlliedWith() ([]Entity, bool)

func (Entity) ReadChildOf

func (e Entity) ReadChildOf() (Entity, bool)

func (Entity) ReadDirection added in v0.2.0

func (e Entity) ReadDirection() (Direction, bool)

func (Entity) ReadDockedTo

func (e Entity) ReadDockedTo() (Entity, bool)

func (Entity) ReadEats

func (e Entity) ReadEats() (Eats, bool)

func (Entity) ReadFaction

func (e Entity) ReadFaction() (Entity, bool)

func (Entity) ReadGravity

func (e Entity) ReadGravity() (Gravity, bool)

func (Entity) ReadGrows

func (e Entity) ReadGrows() ([]Entity, bool)

func (Entity) ReadIsA

func (e Entity) ReadIsA() (Entity, bool)

func (Entity) ReadLikes

func (e Entity) ReadLikes() ([]Entity, bool)

func (Entity) ReadName

func (e Entity) ReadName() (Name, bool)

func (Entity) ReadPosition

func (e Entity) ReadPosition() (Position, bool)

func (Entity) ReadRotation

func (e Entity) ReadRotation() (Rotation, bool)

func (Entity) ReadRuledBy

func (e Entity) ReadRuledBy() (Entity, bool)

func (Entity) ReadVelocity

func (e Entity) ReadVelocity() (Velocity, bool)

func (Entity) RemoveAllAlliedWith

func (e Entity) RemoveAllAlliedWith() Entity

func (Entity) RemoveAllGrows

func (e Entity) RemoveAllGrows() Entity

func (Entity) RemoveAllLikes

func (e Entity) RemoveAllLikes() Entity

func (Entity) RemoveAlliedWith

func (e Entity) RemoveAlliedWith(toRemove ...Entity) Entity

func (Entity) RemoveChildOf

func (e Entity) RemoveChildOf() Entity

func (Entity) RemoveDirection added in v0.2.0

func (e Entity) RemoveDirection() Entity

func (Entity) RemoveDockedTo

func (e Entity) RemoveDockedTo() Entity

func (Entity) RemoveEats

func (e Entity) RemoveEats() Entity

func (Entity) RemoveEnemyTag

func (e Entity) RemoveEnemyTag() Entity

func (Entity) RemoveFaction

func (e Entity) RemoveFaction() Entity

func (Entity) RemoveGravity

func (e Entity) RemoveGravity() Entity

func (Entity) RemoveGrows

func (e Entity) RemoveGrows(toRemove ...Entity) Entity

func (Entity) RemoveIsA

func (e Entity) RemoveIsA() Entity

func (Entity) RemoveLikes

func (e Entity) RemoveLikes(toRemove ...Entity) Entity

func (Entity) RemoveName

func (e Entity) RemoveName() Entity

func (Entity) RemovePlanetTag

func (e Entity) RemovePlanetTag() Entity

func (Entity) RemovePosition

func (e Entity) RemovePosition() Entity

func (Entity) RemoveRotation

func (e Entity) RemoveRotation() Entity

func (Entity) RemoveRuledBy

func (e Entity) RemoveRuledBy() Entity

func (Entity) RemoveSpaceshipTag

func (e Entity) RemoveSpaceshipTag() Entity

func (Entity) RemoveSpacestationTag

func (e Entity) RemoveSpacestationTag() Entity

func (Entity) RemoveVelocity

func (e Entity) RemoveVelocity() Entity

func (Entity) SetAlliedWith

func (e Entity) SetAlliedWith(other ...Entity) Entity

func (Entity) SetChildOf

func (e Entity) SetChildOf(other Entity) Entity

func (Entity) SetDirection added in v0.2.0

func (e Entity) SetDirection(other Direction) Entity

func (Entity) SetDockedTo

func (e Entity) SetDockedTo(other Entity) Entity

func (Entity) SetEats

func (e Entity) SetEats(other Eats) Entity

func (Entity) SetEatsValues added in v0.2.0

func (e Entity) SetEatsValues(
	entities0 []Entity,
	amounts1 []uint8,
) Entity

func (Entity) SetFaction

func (e Entity) SetFaction(other Entity) Entity

func (Entity) SetGravity

func (e Entity) SetGravity(other Gravity) Entity

func (Entity) SetGrows

func (e Entity) SetGrows(other ...Entity) Entity

func (Entity) SetIsA

func (e Entity) SetIsA(other Entity) Entity

func (Entity) SetLikes

func (e Entity) SetLikes(other ...Entity) Entity

func (Entity) SetName

func (e Entity) SetName(other Name) Entity

func (Entity) SetPosition

func (e Entity) SetPosition(other Position) Entity

func (Entity) SetPositionValues added in v0.2.0

func (e Entity) SetPositionValues(
	x0 float32,
	y1 float32,
	z2 float32,
) Entity

func (Entity) SetRotation

func (e Entity) SetRotation(other Rotation) Entity

func (Entity) SetRotationValues added in v0.2.0

func (e Entity) SetRotationValues(
	x0 float32,
	y1 float32,
	z2 float32,
	w3 float32,
) Entity

func (Entity) SetRuledBy

func (e Entity) SetRuledBy(other Entity) Entity

func (Entity) SetVelocity

func (e Entity) SetVelocity(other Velocity) Entity

func (Entity) SetVelocityValues added in v0.2.0

func (e Entity) SetVelocityValues(
	x0 float32,
	y1 float32,
	z2 float32,
) Entity

func (Entity) TagWithEnemy

func (e Entity) TagWithEnemy() Entity

func (Entity) TagWithPlanet

func (e Entity) TagWithPlanet() Entity

func (Entity) TagWithSpaceship

func (e Entity) TagWithSpaceship() Entity

func (Entity) TagWithSpacestation

func (e Entity) TagWithSpacestation() Entity

func (Entity) UpdateVersion

func (e Entity) UpdateVersion() Entity

func (Entity) Version

func (e Entity) Version() uint32

func (Entity) World

func (e Entity) World() *World

func (Entity) WritableAlliedWith

func (e Entity) WritableAlliedWith() (*AlliedWith, bool)

func (Entity) WritableChildOf

func (e Entity) WritableChildOf() (*ChildOf, bool)

func (Entity) WritableDirection added in v0.2.0

func (e Entity) WritableDirection() (*Direction, bool)

func (Entity) WritableDockedTo

func (e Entity) WritableDockedTo() (*DockedTo, bool)

func (Entity) WritableEats

func (e Entity) WritableEats() (*Eats, bool)

func (Entity) WritableFaction

func (e Entity) WritableFaction() (*Faction, bool)

func (Entity) WritableGravity

func (e Entity) WritableGravity() (*Gravity, bool)

func (Entity) WritableGrows

func (e Entity) WritableGrows() (*Grows, bool)

func (Entity) WritableIsA

func (e Entity) WritableIsA() (*IsA, bool)

func (Entity) WritableLikes

func (e Entity) WritableLikes() (*Likes, bool)

func (Entity) WritableName

func (e Entity) WritableName() (*Name, bool)

func (Entity) WritablePosition

func (e Entity) WritablePosition() (*Position, bool)

func (Entity) WritableRotation

func (e Entity) WritableRotation() (*Rotation, bool)

func (Entity) WritableRuledBy

func (e Entity) WritableRuledBy() (*RuledBy, bool)

func (Entity) WritableVelocity

func (e Entity) WritableVelocity() (*Velocity, bool)

type EntityCreatedEvent

type EntityCreatedEvent struct {
	Entity Entity
}

type EntityDestroyedEvent

type EntityDestroyedEvent struct {
	Entity Entity
}

type EnumDirection added in v0.2.0

type EnumDirection int

func EnumDirectionFromInt added in v0.2.0

func EnumDirectionFromInt(i int) EnumDirection

func EnumDirectionSet added in v0.2.0

func EnumDirectionSet(flags ...EnumDirection) EnumDirection

func (EnumDirection) AllSet added in v0.2.0

func (e EnumDirection) AllSet() (flags []EnumDirection)

func (EnumDirection) Clear added in v0.2.0

func (e EnumDirection) Clear(flags ...EnumDirection) EnumDirection

func (EnumDirection) Has added in v0.2.0

func (e EnumDirection) Has(flags ...EnumDirection) bool

func (EnumDirection) Set added in v0.2.0

func (e EnumDirection) Set(flags ...EnumDirection) EnumDirection

func (EnumDirection) String added in v0.2.0

func (e EnumDirection) String() (string, bool)

func (EnumDirection) ToInt added in v0.2.0

func (e EnumDirection) ToInt() int

func (EnumDirection) Toggle added in v0.2.0

func (e EnumDirection) Toggle(flags ...EnumDirection) EnumDirection

func (EnumDirection) ToggleAll added in v0.2.0

func (e EnumDirection) ToggleAll() EnumDirection

type Faction

type Faction Entity

func FactionFromEntity

func FactionFromEntity(c Entity) Faction

func (Faction) FromEntity

func (c Faction) FromEntity(e Entity) Faction

func (Faction) ToEntity

func (c Faction) ToEntity() Entity

func (Faction) ToPB added in v0.2.0

func (c Faction) ToPB() *ecspb.FactionComponent

type FactionReadIterator

type FactionReadIterator struct {
	// contains filtered or unexported fields
}

func (*FactionReadIterator) HasNext

func (iter *FactionReadIterator) HasNext() bool

func (*FactionReadIterator) NextEntity

func (iter *FactionReadIterator) NextEntity() Entity

func (*FactionReadIterator) NextFaction

func (iter *FactionReadIterator) NextFaction() (Entity, Faction)

func (*FactionReadIterator) Reset

func (iter *FactionReadIterator) Reset()

type FactionWriteIterator

type FactionWriteIterator struct {
	// contains filtered or unexported fields
}

func (*FactionWriteIterator) HasNext

func (iter *FactionWriteIterator) HasNext() bool

func (*FactionWriteIterator) NextEntity

func (iter *FactionWriteIterator) NextEntity() Entity

func (*FactionWriteIterator) NextFaction

func (iter *FactionWriteIterator) NextFaction() (Entity, *Faction)

func (*FactionWriteIterator) Reset

func (iter *FactionWriteIterator) Reset()

type Gravity

type Gravity float32

func GravityFromFloat32

func GravityFromFloat32(c float32) Gravity

func (Gravity) ToFloat32

func (c Gravity) ToFloat32() float32

func (Gravity) ToPB added in v0.2.0

func (c Gravity) ToPB() *ecspb.GravityComponent

type GravityReadIterator

type GravityReadIterator struct {
	// contains filtered or unexported fields
}

func (*GravityReadIterator) HasNext

func (iter *GravityReadIterator) HasNext() bool

func (*GravityReadIterator) NextEntity

func (iter *GravityReadIterator) NextEntity() Entity

func (*GravityReadIterator) NextGravity

func (iter *GravityReadIterator) NextGravity() (Entity, Gravity)

func (*GravityReadIterator) Reset

func (iter *GravityReadIterator) Reset()

type GravityWriteIterator

type GravityWriteIterator struct {
	// contains filtered or unexported fields
}

func (*GravityWriteIterator) HasNext

func (iter *GravityWriteIterator) HasNext() bool

func (*GravityWriteIterator) NextEntity

func (iter *GravityWriteIterator) NextEntity() Entity

func (*GravityWriteIterator) NextGravity

func (iter *GravityWriteIterator) NextGravity() (Entity, *Gravity)

func (*GravityWriteIterator) Reset

func (iter *GravityWriteIterator) Reset()

type Grows

type Grows []Entity

func GrowsFromEntities

func GrowsFromEntities(e ...Entity) Grows

func GrowsFromEntity

func GrowsFromEntity(c []Entity) Grows

func (Grows) ToEntities

func (c Grows) ToEntities() []Entity

func (Grows) ToEntity

func (c Grows) ToEntity() []Entity

func (Grows) ToPB added in v0.2.0

func (c Grows) ToPB() *ecspb.GrowsComponent

func (Grows) ToU32s added in v0.2.0

func (c Grows) ToU32s() []uint32

type GrowsReadIterator

type GrowsReadIterator struct {
	// contains filtered or unexported fields
}

func (*GrowsReadIterator) HasNext

func (iter *GrowsReadIterator) HasNext() bool

func (*GrowsReadIterator) NextEntity

func (iter *GrowsReadIterator) NextEntity() Entity

func (*GrowsReadIterator) NextGrows

func (iter *GrowsReadIterator) NextGrows() (Entity, Grows)

func (*GrowsReadIterator) Reset

func (iter *GrowsReadIterator) Reset()

type GrowsWriteIterator

type GrowsWriteIterator struct {
	// contains filtered or unexported fields
}

func (*GrowsWriteIterator) HasNext

func (iter *GrowsWriteIterator) HasNext() bool

func (*GrowsWriteIterator) NextEntity

func (iter *GrowsWriteIterator) NextEntity() Entity

func (*GrowsWriteIterator) NextGrows

func (iter *GrowsWriteIterator) NextGrows() (Entity, *Grows)

func (*GrowsWriteIterator) Reset

func (iter *GrowsWriteIterator) Reset()

type IsA

type IsA Entity

func IsAFromEntity

func IsAFromEntity(c Entity) IsA

func (IsA) FromEntity

func (c IsA) FromEntity(e Entity) IsA

func (IsA) ToEntity

func (c IsA) ToEntity() Entity

func (IsA) ToPB added in v0.2.0

func (c IsA) ToPB() *ecspb.IsAComponent

type IsAReadIterator

type IsAReadIterator struct {
	// contains filtered or unexported fields
}

func (*IsAReadIterator) HasNext

func (iter *IsAReadIterator) HasNext() bool

func (*IsAReadIterator) NextEntity

func (iter *IsAReadIterator) NextEntity() Entity

func (*IsAReadIterator) NextIsA

func (iter *IsAReadIterator) NextIsA() (Entity, IsA)

func (*IsAReadIterator) Reset

func (iter *IsAReadIterator) Reset()

type IsAWriteIterator

type IsAWriteIterator struct {
	// contains filtered or unexported fields
}

func (*IsAWriteIterator) HasNext

func (iter *IsAWriteIterator) HasNext() bool

func (*IsAWriteIterator) NextEntity

func (iter *IsAWriteIterator) NextEntity() Entity

func (*IsAWriteIterator) NextIsA

func (iter *IsAWriteIterator) NextIsA() (Entity, *IsA)

func (*IsAWriteIterator) Reset

func (iter *IsAWriteIterator) Reset()

type LessThan

type LessThan[T any] func(a, b Entity) bool

LessThan is Delegate type that sorting uses as a comparator

type Likes

type Likes []Entity

func LikesFromEntities

func LikesFromEntities(e ...Entity) Likes

func LikesFromEntity

func LikesFromEntity(c []Entity) Likes

func (Likes) ToEntities

func (c Likes) ToEntities() []Entity

func (Likes) ToEntity

func (c Likes) ToEntity() []Entity

func (Likes) ToPB added in v0.2.0

func (c Likes) ToPB() *ecspb.LikesComponent

func (Likes) ToU32s added in v0.2.0

func (c Likes) ToU32s() []uint32

type LikesReadIterator

type LikesReadIterator struct {
	// contains filtered or unexported fields
}

func (*LikesReadIterator) HasNext

func (iter *LikesReadIterator) HasNext() bool

func (*LikesReadIterator) NextEntity

func (iter *LikesReadIterator) NextEntity() Entity

func (*LikesReadIterator) NextLikes

func (iter *LikesReadIterator) NextLikes() (Entity, Likes)

func (*LikesReadIterator) Reset

func (iter *LikesReadIterator) Reset()

type LikesWriteIterator

type LikesWriteIterator struct {
	// contains filtered or unexported fields
}

func (*LikesWriteIterator) HasNext

func (iter *LikesWriteIterator) HasNext() bool

func (*LikesWriteIterator) NextEntity

func (iter *LikesWriteIterator) NextEntity() Entity

func (*LikesWriteIterator) NextLikes

func (iter *LikesWriteIterator) NextLikes() (Entity, *Likes)

func (*LikesWriteIterator) Reset

func (iter *LikesWriteIterator) Reset()

type Name

type Name string

func NameFromString

func NameFromString(c string) Name

func (Name) ToPB added in v0.2.0

func (c Name) ToPB() *ecspb.NameComponent

func (Name) ToString

func (c Name) ToString() string

type NameReadIterator

type NameReadIterator struct {
	// contains filtered or unexported fields
}

func (*NameReadIterator) HasNext

func (iter *NameReadIterator) HasNext() bool

func (*NameReadIterator) NextEntity

func (iter *NameReadIterator) NextEntity() Entity

func (*NameReadIterator) NextName

func (iter *NameReadIterator) NextName() (Entity, Name)

func (*NameReadIterator) Reset

func (iter *NameReadIterator) Reset()

type NameWriteIterator

type NameWriteIterator struct {
	// contains filtered or unexported fields
}

func (*NameWriteIterator) HasNext

func (iter *NameWriteIterator) HasNext() bool

func (*NameWriteIterator) NextEntity

func (iter *NameWriteIterator) NextEntity() Entity

func (*NameWriteIterator) NextName

func (iter *NameWriteIterator) NextName() (Entity, *Name)

func (*NameWriteIterator) Reset

func (iter *NameWriteIterator) Reset()

type Planet

type Planet struct{}

type PlanetReadIterator

type PlanetReadIterator struct {
	// contains filtered or unexported fields
}

func (*PlanetReadIterator) HasNext

func (iter *PlanetReadIterator) HasNext() bool

func (*PlanetReadIterator) NextEntity

func (iter *PlanetReadIterator) NextEntity() Entity

func (*PlanetReadIterator) Reset

func (iter *PlanetReadIterator) Reset()

type PlanetWriteIterator

type PlanetWriteIterator struct {
	// contains filtered or unexported fields
}

func (*PlanetWriteIterator) HasNext

func (iter *PlanetWriteIterator) HasNext() bool

func (*PlanetWriteIterator) NextEntity

func (iter *PlanetWriteIterator) NextEntity() Entity

func (*PlanetWriteIterator) Reset

func (iter *PlanetWriteIterator) Reset()

type Position

type Position struct {
	X float32 `json:"x"`
	Y float32 `json:"y"`
	Z float32 `json:"z"`
}

func (Position) ToPB added in v0.2.0

func (c Position) ToPB() *ecspb.PositionComponent

type PositionReadIterator

type PositionReadIterator struct {
	// contains filtered or unexported fields
}

func (*PositionReadIterator) HasNext

func (iter *PositionReadIterator) HasNext() bool

func (*PositionReadIterator) NextEntity

func (iter *PositionReadIterator) NextEntity() Entity

func (*PositionReadIterator) NextPosition

func (iter *PositionReadIterator) NextPosition() (Entity, Position)

func (*PositionReadIterator) Reset

func (iter *PositionReadIterator) Reset()

type PositionVelocitySet

type PositionVelocitySet struct {
	// contains filtered or unexported fields
}

func NewPositionVelocitySet

func NewPositionVelocitySet(w *World) *PositionVelocitySet

func (*PositionVelocitySet) Len

func (set *PositionVelocitySet) Len() int

func (*PositionVelocitySet) NewIterator

func (set *PositionVelocitySet) NewIterator() *PositionVelocitySetIter

func (*PositionVelocitySet) PossibleUpdate

func (set *PositionVelocitySet) PossibleUpdate(entities ...Entity)

type PositionVelocitySetIter

type PositionVelocitySetIter struct {
	// contains filtered or unexported fields
}

func (*PositionVelocitySetIter) HasNext

func (iter *PositionVelocitySetIter) HasNext() bool

func (*PositionVelocitySetIter) Next

func (iter *PositionVelocitySetIter) Next() (
	Entity,
	Velocity,
	*Position,
)

func (*PositionVelocitySetIter) Reset

func (iter *PositionVelocitySetIter) Reset()

type PositionWriteIterator

type PositionWriteIterator struct {
	// contains filtered or unexported fields
}

func (*PositionWriteIterator) HasNext

func (iter *PositionWriteIterator) HasNext() bool

func (*PositionWriteIterator) NextEntity

func (iter *PositionWriteIterator) NextEntity() Entity

func (*PositionWriteIterator) NextPosition

func (iter *PositionWriteIterator) NextPosition() (Entity, *Position)

func (*PositionWriteIterator) Reset

func (iter *PositionWriteIterator) Reset()

type Rotation

type Rotation struct {
	X float32 `json:"x"`
	Y float32 `json:"y"`
	Z float32 `json:"z"`
	W float32 `json:"w"`
}

func (Rotation) ToPB added in v0.2.0

func (c Rotation) ToPB() *ecspb.RotationComponent

type RotationReadIterator

type RotationReadIterator struct {
	// contains filtered or unexported fields
}

func (*RotationReadIterator) HasNext

func (iter *RotationReadIterator) HasNext() bool

func (*RotationReadIterator) NextEntity

func (iter *RotationReadIterator) NextEntity() Entity

func (*RotationReadIterator) NextRotation

func (iter *RotationReadIterator) NextRotation() (Entity, Rotation)

func (*RotationReadIterator) Reset

func (iter *RotationReadIterator) Reset()

type RotationWriteIterator

type RotationWriteIterator struct {
	// contains filtered or unexported fields
}

func (*RotationWriteIterator) HasNext

func (iter *RotationWriteIterator) HasNext() bool

func (*RotationWriteIterator) NextEntity

func (iter *RotationWriteIterator) NextEntity() Entity

func (*RotationWriteIterator) NextRotation

func (iter *RotationWriteIterator) NextRotation() (Entity, *Rotation)

func (*RotationWriteIterator) Reset

func (iter *RotationWriteIterator) Reset()

type RuledBy

type RuledBy Entity

func RuledByFromEntity

func RuledByFromEntity(c Entity) RuledBy

func (RuledBy) FromEntity

func (c RuledBy) FromEntity(e Entity) RuledBy

func (RuledBy) ToEntity

func (c RuledBy) ToEntity() Entity

func (RuledBy) ToPB added in v0.2.0

func (c RuledBy) ToPB() *ecspb.RuledByComponent

type RuledByReadIterator

type RuledByReadIterator struct {
	// contains filtered or unexported fields
}

func (*RuledByReadIterator) HasNext

func (iter *RuledByReadIterator) HasNext() bool

func (*RuledByReadIterator) NextEntity

func (iter *RuledByReadIterator) NextEntity() Entity

func (*RuledByReadIterator) NextRuledBy

func (iter *RuledByReadIterator) NextRuledBy() (Entity, RuledBy)

func (*RuledByReadIterator) Reset

func (iter *RuledByReadIterator) Reset()

type RuledByWriteIterator

type RuledByWriteIterator struct {
	// contains filtered or unexported fields
}

func (*RuledByWriteIterator) HasNext

func (iter *RuledByWriteIterator) HasNext() bool

func (*RuledByWriteIterator) NextEntity

func (iter *RuledByWriteIterator) NextEntity() Entity

func (*RuledByWriteIterator) NextRuledBy

func (iter *RuledByWriteIterator) NextRuledBy() (Entity, *RuledBy)

func (*RuledByWriteIterator) Reset

func (iter *RuledByWriteIterator) Reset()

type Spaceship

type Spaceship struct{}

type SpaceshipReadIterator

type SpaceshipReadIterator struct {
	// contains filtered or unexported fields
}

func (*SpaceshipReadIterator) HasNext

func (iter *SpaceshipReadIterator) HasNext() bool

func (*SpaceshipReadIterator) NextEntity

func (iter *SpaceshipReadIterator) NextEntity() Entity

func (*SpaceshipReadIterator) Reset

func (iter *SpaceshipReadIterator) Reset()

type SpaceshipWriteIterator

type SpaceshipWriteIterator struct {
	// contains filtered or unexported fields
}

func (*SpaceshipWriteIterator) HasNext

func (iter *SpaceshipWriteIterator) HasNext() bool

func (*SpaceshipWriteIterator) NextEntity

func (iter *SpaceshipWriteIterator) NextEntity() Entity

func (*SpaceshipWriteIterator) Reset

func (iter *SpaceshipWriteIterator) Reset()

type Spacestation

type Spacestation struct{}

type SpacestationReadIterator

type SpacestationReadIterator struct {
	// contains filtered or unexported fields
}

func (*SpacestationReadIterator) HasNext

func (iter *SpacestationReadIterator) HasNext() bool

func (*SpacestationReadIterator) NextEntity

func (iter *SpacestationReadIterator) NextEntity() Entity

func (*SpacestationReadIterator) Reset

func (iter *SpacestationReadIterator) Reset()

type SpacestationWriteIterator

type SpacestationWriteIterator struct {
	// contains filtered or unexported fields
}

func (*SpacestationWriteIterator) HasNext

func (iter *SpacestationWriteIterator) HasNext() bool

func (*SpacestationWriteIterator) NextEntity

func (iter *SpacestationWriteIterator) NextEntity() Entity

func (*SpacestationWriteIterator) Reset

func (iter *SpacestationWriteIterator) Reset()

type SparseSet

type SparseSet[T any] struct {
	LessThan LessThan[T]
	// contains filtered or unexported fields
}

func NewSparseSet

func NewSparseSet[T any](lessThan LessThan[T]) *SparseSet[T]

func (*SparseSet[T]) Clear

func (ss *SparseSet[T]) Clear()

func (*SparseSet[T]) Has

func (ss *SparseSet[T]) Has(e Entity) bool

func (*SparseSet[T]) IterateSafe

func (ss *SparseSet[T]) IterateSafe(fn func(e Entity, c T) error) error

func (*SparseSet[T]) IterateUnsafe

func (ss *SparseSet[T]) IterateUnsafe(fn func(e Entity, c T))

func (*SparseSet[T]) Len

func (ss *SparseSet[T]) Len() int

func (*SparseSet[T]) Read

func (ss *SparseSet[T]) Read(e Entity) (c T, versionMatched bool)

func (*SparseSet[T]) Remove

func (ss *SparseSet[T]) Remove(entities ...Entity)

func (*SparseSet[T]) Set

func (ss *SparseSet[T]) Set(c T, entities ...Entity) error

func (*SparseSet[T]) Sort

func (s *SparseSet[T]) Sort()

Sort an array using the provided comparator

func (*SparseSet[T]) Writeable

func (ss *SparseSet[T]) Writeable(e Entity) (c *T, versionMatched bool)

type SparseSetSortFunc

type SparseSetSortFunc[T any] func(a, b T) bool

type System

type System interface {
	Name() string
	ReliesOn() []string
	Initialize(w *World) error
	Tick(ctx context.Context, w *World) error
}

type UnsubscribeFunc

type UnsubscribeFunc func()

type Velocity

type Velocity struct {
	X float32 `json:"x"`
	Y float32 `json:"y"`
	Z float32 `json:"z"`
}

func (Velocity) ToPB added in v0.2.0

func (c Velocity) ToPB() *ecspb.VelocityComponent

type VelocityReadIterator

type VelocityReadIterator struct {
	// contains filtered or unexported fields
}

func (*VelocityReadIterator) HasNext

func (iter *VelocityReadIterator) HasNext() bool

func (*VelocityReadIterator) NextEntity

func (iter *VelocityReadIterator) NextEntity() Entity

func (*VelocityReadIterator) NextVelocity

func (iter *VelocityReadIterator) NextVelocity() (Entity, Velocity)

func (*VelocityReadIterator) Reset

func (iter *VelocityReadIterator) Reset()

type VelocityWriteIterator

type VelocityWriteIterator struct {
	// contains filtered or unexported fields
}

func (*VelocityWriteIterator) HasNext

func (iter *VelocityWriteIterator) HasNext() bool

func (*VelocityWriteIterator) NextEntity

func (iter *VelocityWriteIterator) NextEntity() Entity

func (*VelocityWriteIterator) NextVelocity

func (iter *VelocityWriteIterator) NextVelocity() (Entity, *Velocity)

func (*VelocityWriteIterator) Reset

func (iter *VelocityWriteIterator) Reset()

type World

type World struct {
	PositionVelocitySet *PositionVelocitySet
	// contains filtered or unexported fields
}

func NewWorld

func NewWorld() *World

func (*World) AddSystems

func (w *World) AddSystems(ss ...System) (err error)

region Systems

func (*World) AlliedWithEntities

func (w *World) AlliedWithEntities() []Entity

func (*World) AlliedWithReadIter

func (w *World) AlliedWithReadIter() *AlliedWithReadIterator

func (*World) AlliedWithResource

func (w *World) AlliedWithResource() ([]Entity, bool)

Retrieve the AlliedWith resource from the world

func (*World) AlliedWithWriteIter

func (w *World) AlliedWithWriteIter() *AlliedWithWriteIterator

func (*World) ApplyAlliedWithPatch added in v0.2.0

func (w *World) ApplyAlliedWithPatch(e Entity, patch *ecspb.AlliedWithComponent) Entity

func (*World) ApplyChildOfPatch added in v0.2.0

func (w *World) ApplyChildOfPatch(e Entity, patch *ecspb.ChildOfComponent) Entity

func (*World) ApplyDirectionPatch added in v0.2.0

func (w *World) ApplyDirectionPatch(e Entity, patch *ecspb.DirectionComponent) Entity

func (*World) ApplyDockedToPatch added in v0.2.0

func (w *World) ApplyDockedToPatch(e Entity, patch *ecspb.DockedToComponent) Entity

func (*World) ApplyEatsPatch added in v0.2.0

func (w *World) ApplyEatsPatch(e Entity, patch *ecspb.EatsComponent) Entity

func (*World) ApplyEnemyPatch added in v0.2.0

func (w *World) ApplyEnemyPatch(e Entity, pb *emptypb.Empty) Entity

func (*World) ApplyFactionPatch added in v0.2.0

func (w *World) ApplyFactionPatch(e Entity, patch *ecspb.FactionComponent) Entity

func (*World) ApplyGravityPatch added in v0.2.0

func (w *World) ApplyGravityPatch(e Entity, patch *ecspb.GravityComponent) Entity

func (*World) ApplyGrowsPatch added in v0.2.0

func (w *World) ApplyGrowsPatch(e Entity, patch *ecspb.GrowsComponent) Entity

func (*World) ApplyIsAPatch added in v0.2.0

func (w *World) ApplyIsAPatch(e Entity, patch *ecspb.IsAComponent) Entity

func (*World) ApplyLikesPatch added in v0.2.0

func (w *World) ApplyLikesPatch(e Entity, patch *ecspb.LikesComponent) Entity

func (*World) ApplyNamePatch added in v0.2.0

func (w *World) ApplyNamePatch(e Entity, patch *ecspb.NameComponent) Entity

func (*World) ApplyPatches added in v0.2.0

func (w *World) ApplyPatches(patches ...*ecspb.WorldPatch)

func (*World) ApplyPlanetPatch added in v0.2.0

func (w *World) ApplyPlanetPatch(e Entity, pb *emptypb.Empty) Entity

func (*World) ApplyPositionPatch added in v0.2.0

func (w *World) ApplyPositionPatch(e Entity, patch *ecspb.PositionComponent) Entity

func (*World) ApplyRotationPatch added in v0.2.0

func (w *World) ApplyRotationPatch(e Entity, patch *ecspb.RotationComponent) Entity

func (*World) ApplyRuledByPatch added in v0.2.0

func (w *World) ApplyRuledByPatch(e Entity, patch *ecspb.RuledByComponent) Entity

func (*World) ApplySpaceshipPatch added in v0.2.0

func (w *World) ApplySpaceshipPatch(e Entity, pb *emptypb.Empty) Entity

func (*World) ApplySpacestationPatch added in v0.2.0

func (w *World) ApplySpacestationPatch(e Entity, pb *emptypb.Empty) Entity

func (*World) ApplyVelocityPatch added in v0.2.0

func (w *World) ApplyVelocityPatch(e Entity, patch *ecspb.VelocityComponent) Entity

func (*World) ChildOfEntities

func (w *World) ChildOfEntities() []Entity

func (*World) ChildOfReadIter

func (w *World) ChildOfReadIter() *ChildOfReadIterator

func (*World) ChildOfResource

func (w *World) ChildOfResource() (Entity, bool)

Retrieve the ChildOf resource from the world

func (*World) ChildOfWriteIter

func (w *World) ChildOfWriteIter() *ChildOfWriteIterator

func (*World) DestroyEntities added in v0.2.0

func (w *World) DestroyEntities(es ...Entity)

func (*World) DirectionEntities added in v0.2.0

func (w *World) DirectionEntities() []Entity

func (*World) DirectionReadIter added in v0.2.0

func (w *World) DirectionReadIter() *DirectionReadIterator

func (*World) DirectionResource added in v0.2.0

func (w *World) DirectionResource() (Direction, bool)

Retrieve the Direction resource from the world

func (*World) DirectionWriteIter added in v0.2.0

func (w *World) DirectionWriteIter() *DirectionWriteIterator

func (*World) DisableSystem

func (w *World) DisableSystem(ss ...System) error

func (*World) DockedToEntities

func (w *World) DockedToEntities() []Entity

func (*World) DockedToReadIter

func (w *World) DockedToReadIter() *DockedToReadIterator

func (*World) DockedToResource

func (w *World) DockedToResource() (Entity, bool)

Retrieve the DockedTo resource from the world

func (*World) DockedToWriteIter

func (w *World) DockedToWriteIter() *DockedToWriteIterator

func (*World) EatsEntities

func (w *World) EatsEntities() []Entity

func (*World) EatsReadIter

func (w *World) EatsReadIter() *EatsReadIterator

func (*World) EatsResource

func (w *World) EatsResource() (Eats, bool)

Retrieve the Eats resource from the world

func (*World) EatsWriteIter

func (w *World) EatsWriteIter() *EatsWriteIterator

func (*World) EnableSystem

func (w *World) EnableSystem(ss ...System) error

func (*World) EnemyEntities

func (w *World) EnemyEntities() []Entity

func (*World) EnemyReadIter

func (w *World) EnemyReadIter() *EnemyReadIterator

func (*World) EnemyWriteIter

func (w *World) EnemyWriteIter() *EnemyWriteIterator

func (*World) Entities

func (w *World) Entities(count int) []Entity

func (*World) EntitiesFromU32s added in v0.2.0

func (w *World) EntitiesFromU32s(vals ...uint32) (entities []Entity)

func (*World) Entity

func (w *World) Entity() (e Entity)

func (*World) EntityFromU32

func (w *World) EntityFromU32(val uint32) Entity

func (*World) EntityWithName

func (w *World) EntityWithName(name string) Entity

func (*World) FactionEntities

func (w *World) FactionEntities() []Entity

func (*World) FactionReadIter

func (w *World) FactionReadIter() *FactionReadIterator

func (*World) FactionResource

func (w *World) FactionResource() (Entity, bool)

Retrieve the Faction resource from the world

func (*World) FactionWriteIter

func (w *World) FactionWriteIter() *FactionWriteIterator

func (*World) GravityEntities

func (w *World) GravityEntities() []Entity

func (*World) GravityReadIter

func (w *World) GravityReadIter() *GravityReadIterator

func (*World) GravityResource

func (w *World) GravityResource() (Gravity, bool)

Retrieve the Gravity resource from the world

func (*World) GravityWriteIter

func (w *World) GravityWriteIter() *GravityWriteIterator

func (*World) GrowsEntities

func (w *World) GrowsEntities() []Entity

func (*World) GrowsReadIter

func (w *World) GrowsReadIter() *GrowsReadIterator

func (*World) GrowsResource

func (w *World) GrowsResource() ([]Entity, bool)

Retrieve the Grows resource from the world

func (*World) GrowsWriteIter

func (w *World) GrowsWriteIter() *GrowsWriteIterator

func (*World) HasAlliedWithResource

func (w *World) HasAlliedWithResource() bool

HasAlliedWith checks if the world has a AlliedWith}}

func (*World) HasChildOfResource

func (w *World) HasChildOfResource() bool

HasChildOf checks if the world has a ChildOf}}

func (*World) HasDirectionResource added in v0.2.0

func (w *World) HasDirectionResource() bool

HasDirection checks if the world has a Direction}}

func (*World) HasDockedToResource

func (w *World) HasDockedToResource() bool

HasDockedTo checks if the world has a DockedTo}}

func (*World) HasEatsResource

func (w *World) HasEatsResource() bool

HasEats checks if the world has a Eats}}

func (*World) HasFactionResource

func (w *World) HasFactionResource() bool

HasFaction checks if the world has a Faction}}

func (*World) HasGravityResource

func (w *World) HasGravityResource() bool

HasGravity checks if the world has a Gravity}}

func (*World) HasGrowsResource

func (w *World) HasGrowsResource() bool

HasGrows checks if the world has a Grows}}

func (*World) HasIsAResource

func (w *World) HasIsAResource() bool

HasIsA checks if the world has a IsA}}

func (*World) HasLikesResource

func (w *World) HasLikesResource() bool

HasLikes checks if the world has a Likes}}

func (*World) HasNameResource

func (w *World) HasNameResource() bool

HasName checks if the world has a Name}}

func (*World) HasPositionResource

func (w *World) HasPositionResource() bool

HasPosition checks if the world has a Position}}

func (*World) HasRotationResource

func (w *World) HasRotationResource() bool

HasRotation checks if the world has a Rotation}}

func (*World) HasRuledByResource

func (w *World) HasRuledByResource() bool

HasRuledBy checks if the world has a RuledBy}}

func (*World) HasVelocityResource

func (w *World) HasVelocityResource() bool

HasVelocity checks if the world has a Velocity}}

func (*World) IsAEntities

func (w *World) IsAEntities() []Entity

func (*World) IsAReadIter

func (w *World) IsAReadIter() *IsAReadIterator

func (*World) IsAResource

func (w *World) IsAResource() (Entity, bool)

Retrieve the IsA resource from the world

func (*World) IsAWriteIter

func (w *World) IsAWriteIter() *IsAWriteIterator

func (*World) LikesEntities

func (w *World) LikesEntities() []Entity

func (*World) LikesReadIter

func (w *World) LikesReadIter() *LikesReadIterator

func (*World) LikesResource

func (w *World) LikesResource() ([]Entity, bool)

Retrieve the Likes resource from the world

func (*World) LikesWriteIter

func (w *World) LikesWriteIter() *LikesWriteIterator

func (*World) NameEntities

func (w *World) NameEntities() []Entity

func (*World) NameReadIter

func (w *World) NameReadIter() *NameReadIterator

func (*World) NameResource

func (w *World) NameResource() (Name, bool)

Retrieve the Name resource from the world

func (*World) NameWriteIter

func (w *World) NameWriteIter() *NameWriteIterator

func (*World) OnEntityCreated

func (w *World) OnEntityCreated(fn func(EntityCreatedEvent)) UnsubscribeFunc

func (*World) OnEntityDestroyed

func (w *World) OnEntityDestroyed(fn func(EntityDestroyedEvent)) UnsubscribeFunc

func (*World) PlanetEntities

func (w *World) PlanetEntities() []Entity

func (*World) PlanetReadIter

func (w *World) PlanetReadIter() *PlanetReadIterator

func (*World) PlanetWriteIter

func (w *World) PlanetWriteIter() *PlanetWriteIterator

func (*World) PositionEntities

func (w *World) PositionEntities() []Entity

func (*World) PositionReadIter

func (w *World) PositionReadIter() *PositionReadIterator

func (*World) PositionResource

func (w *World) PositionResource() (Position, bool)

Retrieve the Position resource from the world

func (*World) PositionWriteIter

func (w *World) PositionWriteIter() *PositionWriteIterator

func (*World) RemoveAlliedWithResource

func (w *World) RemoveAlliedWithResource() Entity

Remove the AlliedWith resource from the world

func (*World) RemoveAlliedWiths

func (w *World) RemoveAlliedWiths(entities ...Entity)

func (*World) RemoveChildOf

func (w *World) RemoveChildOf(entities ...Entity)

func (*World) RemoveChildOfResource

func (w *World) RemoveChildOfResource() Entity

Remove the ChildOf resource from the world

func (*World) RemoveDirectionResource added in v0.2.0

func (w *World) RemoveDirectionResource() Entity

Remove the Direction resource from the world

func (*World) RemoveDirections added in v0.2.0

func (w *World) RemoveDirections(entities ...Entity)

func (*World) RemoveDockedToResource

func (w *World) RemoveDockedToResource() Entity

Remove the DockedTo resource from the world

func (*World) RemoveDockedTos

func (w *World) RemoveDockedTos(entities ...Entity)

func (*World) RemoveEats

func (w *World) RemoveEats(entities ...Entity)

func (*World) RemoveEatsResource

func (w *World) RemoveEatsResource() Entity

Remove the Eats resource from the world

func (*World) RemoveEnemyTags

func (w *World) RemoveEnemyTags(entities ...Entity)

func (*World) RemoveFactionResource

func (w *World) RemoveFactionResource() Entity

Remove the Faction resource from the world

func (*World) RemoveFactions

func (w *World) RemoveFactions(entities ...Entity)

func (*World) RemoveGravities

func (w *World) RemoveGravities(entities ...Entity)

func (*World) RemoveGravityResource

func (w *World) RemoveGravityResource() Entity

Remove the Gravity resource from the world

func (*World) RemoveGrows

func (w *World) RemoveGrows(entities ...Entity)

func (*World) RemoveGrowsResource

func (w *World) RemoveGrowsResource() Entity

Remove the Grows resource from the world

func (*World) RemoveIsA

func (w *World) RemoveIsA(entities ...Entity)

func (*World) RemoveIsAResource

func (w *World) RemoveIsAResource() Entity

Remove the IsA resource from the world

func (*World) RemoveLikes

func (w *World) RemoveLikes(entities ...Entity)

func (*World) RemoveLikesResource

func (w *World) RemoveLikesResource() Entity

Remove the Likes resource from the world

func (*World) RemoveNameResource

func (w *World) RemoveNameResource() Entity

Remove the Name resource from the world

func (*World) RemoveNames

func (w *World) RemoveNames(entities ...Entity)

func (*World) RemovePlanetTags

func (w *World) RemovePlanetTags(entities ...Entity)

func (*World) RemovePositionResource

func (w *World) RemovePositionResource() Entity

Remove the Position resource from the world

func (*World) RemovePositions

func (w *World) RemovePositions(entities ...Entity)

func (*World) RemoveRotationResource

func (w *World) RemoveRotationResource() Entity

Remove the Rotation resource from the world

func (*World) RemoveRotations

func (w *World) RemoveRotations(entities ...Entity)

func (*World) RemoveRuledByResource

func (w *World) RemoveRuledByResource() Entity

Remove the RuledBy resource from the world

func (*World) RemoveRuledBys

func (w *World) RemoveRuledBys(entities ...Entity)

func (*World) RemoveSpaceshipTags

func (w *World) RemoveSpaceshipTags(entities ...Entity)

func (*World) RemoveSpacestationTags

func (w *World) RemoveSpacestationTags(entities ...Entity)

func (*World) RemoveSystems

func (w *World) RemoveSystems(ss ...System) error

func (*World) RemoveVelocities

func (w *World) RemoveVelocities(entities ...Entity)

func (*World) RemoveVelocityResource

func (w *World) RemoveVelocityResource() Entity

Remove the Velocity resource from the world

func (*World) Reset

func (w *World) Reset()

func (*World) ResetChildOf

func (w *World) ResetChildOf() Entity

func (*World) ResetDirection added in v0.2.0

func (w *World) ResetDirection() EnumDirection

func (*World) ResetDockedTo

func (w *World) ResetDockedTo() Entity

func (*World) ResetEats

func (w *World) ResetEats() Eats

func (*World) ResetFaction

func (w *World) ResetFaction() Entity

func (*World) ResetGravity

func (w *World) ResetGravity() float32

func (*World) ResetIsA

func (w *World) ResetIsA() Entity

func (*World) ResetName

func (w *World) ResetName() string

func (*World) ResetPosition

func (w *World) ResetPosition() Position

func (*World) ResetRotation

func (w *World) ResetRotation() Rotation

func (*World) ResetRuledBy

func (w *World) ResetRuledBy() Entity

func (*World) ResetVelocity

func (w *World) ResetVelocity() Velocity

func (*World) RotationEntities

func (w *World) RotationEntities() []Entity

func (*World) RotationReadIter

func (w *World) RotationReadIter() *RotationReadIterator

func (*World) RotationResource

func (w *World) RotationResource() (Rotation, bool)

Retrieve the Rotation resource from the world

func (*World) RotationWriteIter

func (w *World) RotationWriteIter() *RotationWriteIterator

func (*World) RuledByEntities

func (w *World) RuledByEntities() []Entity

func (*World) RuledByReadIter

func (w *World) RuledByReadIter() *RuledByReadIterator

func (*World) RuledByResource

func (w *World) RuledByResource() (Entity, bool)

Retrieve the RuledBy resource from the world

func (*World) RuledByWriteIter

func (w *World) RuledByWriteIter() *RuledByWriteIterator

func (*World) SetAlliedWithResource

func (w *World) SetAlliedWithResource(e ...Entity) Entity

Set the AlliedWith resource in the world

func (*World) SetAlliedWithSortFn

func (w *World) SetAlliedWithSortFn(lessThan func(a, b Entity) bool)

func (*World) SetAlliedWiths

func (w *World) SetAlliedWiths(c AlliedWith, entities ...Entity)

func (*World) SetChildOf

func (w *World) SetChildOf(c ChildOf, entities ...Entity)

func (*World) SetChildOfResource

func (w *World) SetChildOfResource(e Entity) Entity

Set the ChildOf resource in the world

func (*World) SetChildOfSortFn

func (w *World) SetChildOfSortFn(lessThan func(a, b Entity) bool)

func (*World) SetDirectionResource added in v0.2.0

func (w *World) SetDirectionResource(c Direction) Entity

Set the Direction resource in the world

func (*World) SetDirectionSortFn added in v0.2.0

func (w *World) SetDirectionSortFn(lessThan func(a, b Entity) bool)

func (*World) SetDirections added in v0.2.0

func (w *World) SetDirections(c Direction, entities ...Entity)

func (*World) SetDockedToResource

func (w *World) SetDockedToResource(e Entity) Entity

Set the DockedTo resource in the world

func (*World) SetDockedToSortFn

func (w *World) SetDockedToSortFn(lessThan func(a, b Entity) bool)

func (*World) SetDockedTos

func (w *World) SetDockedTos(c DockedTo, entities ...Entity)

func (*World) SetEats

func (w *World) SetEats(c Eats, entities ...Entity)

func (*World) SetEatsResource

func (w *World) SetEatsResource(c Eats) Entity

Set the Eats resource in the world

func (*World) SetEatsResourceValues added in v0.2.0

func (w *World) SetEatsResourceValues(
	entities0 []Entity,
	amounts1 []uint8,
) Entity

func (*World) SetEatsSortFn

func (w *World) SetEatsSortFn(lessThan func(a, b Entity) bool)

func (*World) SetFactionResource

func (w *World) SetFactionResource(e Entity) Entity

Set the Faction resource in the world

func (*World) SetFactionSortFn

func (w *World) SetFactionSortFn(lessThan func(a, b Entity) bool)

func (*World) SetFactions

func (w *World) SetFactions(c Faction, entities ...Entity)

func (*World) SetGravities

func (w *World) SetGravities(c Gravity, entities ...Entity)

func (*World) SetGravityResource

func (w *World) SetGravityResource(c Gravity) Entity

Set the Gravity resource in the world

func (*World) SetGravitySortFn

func (w *World) SetGravitySortFn(lessThan func(a, b Entity) bool)

func (*World) SetGrows

func (w *World) SetGrows(c Grows, entities ...Entity)

func (*World) SetGrowsResource

func (w *World) SetGrowsResource(e ...Entity) Entity

Set the Grows resource in the world

func (*World) SetGrowsSortFn

func (w *World) SetGrowsSortFn(lessThan func(a, b Entity) bool)

func (*World) SetIsA

func (w *World) SetIsA(c IsA, entities ...Entity)

func (*World) SetIsAResource

func (w *World) SetIsAResource(e Entity) Entity

Set the IsA resource in the world

func (*World) SetIsASortFn

func (w *World) SetIsASortFn(lessThan func(a, b Entity) bool)

func (*World) SetLikes

func (w *World) SetLikes(c Likes, entities ...Entity)

func (*World) SetLikesResource

func (w *World) SetLikesResource(e ...Entity) Entity

Set the Likes resource in the world

func (*World) SetLikesSortFn

func (w *World) SetLikesSortFn(lessThan func(a, b Entity) bool)

func (*World) SetNameResource

func (w *World) SetNameResource(c Name) Entity

Set the Name resource in the world

func (*World) SetNameSortFn

func (w *World) SetNameSortFn(lessThan func(a, b Entity) bool)

func (*World) SetNames

func (w *World) SetNames(c Name, entities ...Entity)

func (*World) SetPositionResource

func (w *World) SetPositionResource(c Position) Entity

Set the Position resource in the world

func (*World) SetPositionResourceValues added in v0.2.0

func (w *World) SetPositionResourceValues(
	x0 float32,
	y1 float32,
	z2 float32,
) Entity

func (*World) SetPositionSortFn

func (w *World) SetPositionSortFn(lessThan func(a, b Entity) bool)

func (*World) SetPositions

func (w *World) SetPositions(c Position, entities ...Entity)

func (*World) SetRotationResource

func (w *World) SetRotationResource(c Rotation) Entity

Set the Rotation resource in the world

func (*World) SetRotationResourceValues added in v0.2.0

func (w *World) SetRotationResourceValues(
	x0 float32,
	y1 float32,
	z2 float32,
	w3 float32,
) Entity

func (*World) SetRotationSortFn

func (w *World) SetRotationSortFn(lessThan func(a, b Entity) bool)

func (*World) SetRotations

func (w *World) SetRotations(c Rotation, entities ...Entity)

func (*World) SetRuledByResource

func (w *World) SetRuledByResource(e Entity) Entity

Set the RuledBy resource in the world

func (*World) SetRuledBySortFn

func (w *World) SetRuledBySortFn(lessThan func(a, b Entity) bool)

func (*World) SetRuledBys

func (w *World) SetRuledBys(c RuledBy, entities ...Entity)

func (*World) SetVelocities

func (w *World) SetVelocities(c Velocity, entities ...Entity)

func (*World) SetVelocityResource

func (w *World) SetVelocityResource(c Velocity) Entity

Set the Velocity resource in the world

func (*World) SetVelocityResourceValues added in v0.2.0

func (w *World) SetVelocityResourceValues(
	x0 float32,
	y1 float32,
	z2 float32,
) Entity

func (*World) SetVelocitySortFn

func (w *World) SetVelocitySortFn(lessThan func(a, b Entity) bool)

func (*World) SortAlliedWiths

func (w *World) SortAlliedWiths()

func (*World) SortChildOf

func (w *World) SortChildOf()

func (*World) SortDirections added in v0.2.0

func (w *World) SortDirections()

func (*World) SortDockedTos

func (w *World) SortDockedTos()

func (*World) SortEats

func (w *World) SortEats()

func (*World) SortFactions

func (w *World) SortFactions()

func (*World) SortGravities

func (w *World) SortGravities()

func (*World) SortGrows

func (w *World) SortGrows()

func (*World) SortIsA

func (w *World) SortIsA()

func (*World) SortLikes

func (w *World) SortLikes()

func (*World) SortNames

func (w *World) SortNames()

func (*World) SortPositions

func (w *World) SortPositions()

func (*World) SortRotations

func (w *World) SortRotations()

func (*World) SortRuledBys

func (w *World) SortRuledBys()

func (*World) SortVelocities

func (w *World) SortVelocities()

func (*World) SpaceshipEntities

func (w *World) SpaceshipEntities() []Entity

func (*World) SpaceshipReadIter

func (w *World) SpaceshipReadIter() *SpaceshipReadIterator

func (*World) SpaceshipWriteIter

func (w *World) SpaceshipWriteIter() *SpaceshipWriteIterator

func (*World) SpacestationEntities

func (w *World) SpacestationEntities() []Entity

func (*World) SpacestationReadIter

func (w *World) SpacestationReadIter() *SpacestationReadIterator

func (*World) SpacestationWriteIter

func (w *World) SpacestationWriteIter() *SpacestationWriteIterator

func (*World) Tick

func (w *World) Tick(ctx context.Context) error

func (*World) TickCount

func (w *World) TickCount() int

func (*World) VelocityEntities

func (w *World) VelocityEntities() []Entity

func (*World) VelocityReadIter

func (w *World) VelocityReadIter() *VelocityReadIterator

func (*World) VelocityResource

func (w *World) VelocityResource() (Velocity, bool)

Retrieve the Velocity resource from the world

func (*World) VelocityWriteIter

func (w *World) VelocityWriteIter() *VelocityWriteIterator

Directories

Path Synopsis
pb

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL