ecs

package
v0.4.0 Latest Latest
Warning

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

Go to latest
Published: Oct 19, 2024 License: Unlicense Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Tombstone = Entity(maxEntities)

Functions

func AllSparseSetsView added in v0.4.0

func AllSparseSetsView() templ.Component

func Page added in v0.4.0

func Page() templ.Component

func SetupRoutes added in v0.4.0

func SetupRoutes(setupCtx context.Context, world *World, baseRouter chi.Router) error

func SparseSetView added in v0.4.0

func SparseSetView[T any](ss *SparseSet[T]) templ.Component

Types

type AlliedWithRelationship added in v0.4.0

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

func NewAlliedWithRelationship added in v0.4.0

func NewAlliedWithRelationship() *AlliedWithRelationship

func (*AlliedWithRelationship) Clear added in v0.4.0

func (r *AlliedWithRelationship) Clear()

type AlliedWithRelationshipPair added in v0.4.0

type AlliedWithRelationshipPair struct {
	From Entity
	To   Entity
}

type ChildOfRelationship added in v0.4.0

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

func NewChildOfRelationship added in v0.4.0

func NewChildOfRelationship() *ChildOfRelationship

func (*ChildOfRelationship) Clear added in v0.4.0

func (r *ChildOfRelationship) Clear()

type ChildOfRelationshipPair added in v0.4.0

type ChildOfRelationshipPair struct {
	From Entity
	To   Entity
}

type DirectionComponent added in v0.4.0

type DirectionComponent struct {
	Values EnumDirection
}

func DefaultDirectionComponent added in v0.4.0

func DefaultDirectionComponent() DirectionComponent

func DirectionComponentFromValues added in v0.4.0

func DirectionComponentFromValues(
	valuesArg EnumDirection,
) DirectionComponent

func (DirectionComponent) Clone added in v0.4.0

type DockedToComponent added in v0.4.0

type DockedToComponent struct {
	Entity Entity
}

func DefaultDockedToComponent added in v0.4.0

func DefaultDockedToComponent() DockedToComponent

func DockedToComponentFromValues added in v0.4.0

func DockedToComponentFromValues(
	entityArg Entity,
) DockedToComponent

func (DockedToComponent) Clone added in v0.4.0

type EatsRelationship added in v0.4.0

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

func NewEatsRelationship added in v0.4.0

func NewEatsRelationship() *EatsRelationship

func (*EatsRelationship) Clear added in v0.4.0

func (r *EatsRelationship) Clear()

type EatsRelationshipPair added in v0.4.0

type EatsRelationshipPair struct {
	From   Entity
	To     Entity
	Amount uint8
}

type EntitiesCreatedEvent added in v0.4.0

type EntitiesCreatedEvent struct {
	Entities []Entity
}

type EntitiesDestroyedEvent added in v0.4.0

type EntitiesDestroyedEvent struct {
	Entities []Entity
}

type Entity

type Entity uint32

func EntityFromU32 added in v0.4.0

func EntityFromU32(u uint32) Entity

func NewEntity added in v0.4.0

func NewEntity(index, generation int) Entity

func SortEntities added in v0.4.0

func SortEntities(fn func(yield func(entity Entity) bool)) []Entity

func (Entity) Generation added in v0.4.0

func (e Entity) Generation() int

func (Entity) InIter added in v0.4.0

func (e Entity) InIter(iter func(yield func(entity Entity) bool)) func(yield func(entity Entity) bool)

func (Entity) InSlice added in v0.4.0

func (e Entity) InSlice(entities ...Entity) bool

func (Entity) Index

func (e Entity) Index() int

type EntityBuilderOption added in v0.4.0

type EntityBuilderOption func(w *World, entity Entity)

func WithDirection added in v0.4.0

func WithDirection(arg EnumDirection) EntityBuilderOption

func WithDockedTo added in v0.4.0

func WithDockedTo(arg Entity) EntityBuilderOption

func WithEnemyTag added in v0.4.0

func WithEnemyTag() EntityBuilderOption

EnemyBuilder

func WithFaction added in v0.4.0

func WithFaction(arg Entity) EntityBuilderOption

func WithGravity added in v0.4.0

func WithGravity(arg float32) EntityBuilderOption

func WithName added in v0.4.0

func WithName(arg string) EntityBuilderOption

func WithPlanetTag added in v0.4.0

func WithPlanetTag() EntityBuilderOption

PlanetBuilder

func WithPosition added in v0.4.0

func WithPosition(c PositionComponent) EntityBuilderOption

func WithPositionFromValues added in v0.4.0

func WithPositionFromValues(
	xArg float32,
	yArg float32,
	zArg float32,
) EntityBuilderOption

func WithRotation added in v0.4.0

func WithRotation(c RotationComponent) EntityBuilderOption

func WithRotationFromValues added in v0.4.0

func WithRotationFromValues(
	xArg float32,
	yArg float32,
	zArg float32,
	wArg float32,
) EntityBuilderOption

func WithRuledBy added in v0.4.0

func WithRuledBy(arg Entity) EntityBuilderOption

func WithSpaceshipTag added in v0.4.0

func WithSpaceshipTag() EntityBuilderOption

SpaceshipBuilder

func WithSpacestationTag added in v0.4.0

func WithSpacestationTag() EntityBuilderOption

SpacestationBuilder

func WithVelocity added in v0.4.0

func WithVelocity(c VelocityComponent) EntityBuilderOption

func WithVelocityFromValues added in v0.4.0

func WithVelocityFromValues(
	xArg float32,
	yArg float32,
	zArg float32,
) EntityBuilderOption

type EnumDirection added in v0.2.0

type EnumDirection uint32
const (
	EnumDirectionUnknown EnumDirection = 0
	EnumDirectionNorth   EnumDirection = 1
	EnumDirectionSouth   EnumDirection = 2
	EnumDirectionEast    EnumDirection = 4
	EnumDirectionWest    EnumDirection = 8
)

func EnumDirectionFromString added in v0.4.0

func EnumDirectionFromString(value string) EnumDirection

func (EnumDirection) String added in v0.2.0

func (e EnumDirection) String() string

func (EnumDirection) U32 added in v0.4.0

func (e EnumDirection) U32() uint32

type FactionComponent added in v0.4.0

type FactionComponent struct {
	Entity Entity
}

func DefaultFactionComponent added in v0.4.0

func DefaultFactionComponent() FactionComponent

func FactionComponentFromValues added in v0.4.0

func FactionComponentFromValues(
	entityArg Entity,
) FactionComponent

func (FactionComponent) Clone added in v0.4.0

type GravityComponent added in v0.4.0

type GravityComponent struct {
	G float32
}

func DefaultGravityComponent added in v0.4.0

func DefaultGravityComponent() GravityComponent

func GravityComponentFromValues added in v0.4.0

func GravityComponentFromValues(
	gArg float32,
) GravityComponent

func (GravityComponent) Clone added in v0.4.0

type GrowsRelationship added in v0.4.0

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

func NewGrowsRelationship added in v0.4.0

func NewGrowsRelationship() *GrowsRelationship

func (*GrowsRelationship) Clear added in v0.4.0

func (r *GrowsRelationship) Clear()

type GrowsRelationshipPair added in v0.4.0

type GrowsRelationshipPair struct {
	From Entity
	To   Entity
}

type IsARelationship added in v0.4.0

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

func NewIsARelationship added in v0.4.0

func NewIsARelationship() *IsARelationship

func (*IsARelationship) Clear added in v0.4.0

func (r *IsARelationship) Clear()

type IsARelationshipPair added in v0.4.0

type IsARelationshipPair struct {
	From Entity
	To   Entity
}

type LikesRelationship added in v0.4.0

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

func NewLikesRelationship added in v0.4.0

func NewLikesRelationship() *LikesRelationship

func (*LikesRelationship) Clear added in v0.4.0

func (r *LikesRelationship) Clear()

type LikesRelationshipPair added in v0.4.0

type LikesRelationshipPair struct {
	From Entity
	To   Entity
}

type NameComponent added in v0.4.0

type NameComponent struct {
	Value string
}

func DefaultNameComponent added in v0.4.0

func DefaultNameComponent() NameComponent

func NameComponentFromValues added in v0.4.0

func NameComponentFromValues(
	valueArg string,
) NameComponent

func (NameComponent) Clone added in v0.4.0

func (c NameComponent) Clone() NameComponent

type PositionComponent added in v0.4.0

type PositionComponent struct {
	X float32
	Y float32
	Z float32
}

func DefaultPositionComponent added in v0.4.0

func DefaultPositionComponent() PositionComponent

func PositionComponentFromValues added in v0.4.0

func PositionComponentFromValues(
	xArg float32,
	yArg float32,
	zArg float32,
) PositionComponent

func (PositionComponent) Clone added in v0.4.0

type QueryExamplePositionVelocitiesArgs added in v0.4.0

type QueryExamplePositionVelocitiesArgs struct {
	Velocity VelocityComponent

	Position *PositionComponent
}

type ReliedOnIter added in v0.4.0

type ReliedOnIter func(reliedOn System) bool

type RotationComponent added in v0.4.0

type RotationComponent struct {
	X float32
	Y float32
	Z float32
	W float32
}

func DefaultRotationComponent added in v0.4.0

func DefaultRotationComponent() RotationComponent

func RotationComponentFromValues added in v0.4.0

func RotationComponentFromValues(
	xArg float32,
	yArg float32,
	zArg float32,
	wArg float32,
) RotationComponent

func (RotationComponent) Clone added in v0.4.0

type RuledByComponent added in v0.4.0

type RuledByComponent struct {
	Entity Entity
}

func DefaultRuledByComponent added in v0.4.0

func DefaultRuledByComponent() RuledByComponent

func RuledByComponentFromValues added in v0.4.0

func RuledByComponentFromValues(
	entityArg Entity,
) RuledByComponent

func (RuledByComponent) Clone added in v0.4.0

type SparseSet

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

func NewSparseSet

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

func (*SparseSet[T]) All added in v0.4.0

func (s *SparseSet[T]) All(yield func(e Entity, c T) bool)

func (*SparseSet[T]) AllEntities added in v0.4.0

func (s *SparseSet[T]) AllEntities(yield func(e Entity) bool)

func (*SparseSet[T]) AllMutable added in v0.4.0

func (s *SparseSet[T]) AllMutable(yield func(e Entity, c *T) bool)

func (*SparseSet[T]) Cap added in v0.4.0

func (s *SparseSet[T]) Cap() int

func (*SparseSet[T]) Clear

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

func (*SparseSet[T]) Contains added in v0.4.0

func (s *SparseSet[T]) Contains(e Entity) bool

func (*SparseSet[T]) Data added in v0.4.0

func (s *SparseSet[T]) Data(e Entity) (T, bool)

func (*SparseSet[T]) DataMutable added in v0.4.0

func (s *SparseSet[T]) DataMutable(e Entity) (*T, bool)

func (*SparseSet[T]) Len

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

func (*SparseSet[T]) Remove

func (s *SparseSet[T]) Remove(e Entity) (wasRemoved bool)

func (*SparseSet[T]) Upsert added in v0.4.0

func (s *SparseSet[T]) Upsert(e Entity, c T) (old T, wasAdded bool)

type System

type System interface {
	Initialize(w *World) error
	ReliesOn() ReliedOnIter
}

type SystemTicker added in v0.4.0

type SystemTicker interface {
	System
	Tick(ctx context.Context, w *World) error
}

type UnsubscribeFunc

type UnsubscribeFunc func()

type VelocityComponent added in v0.4.0

type VelocityComponent struct {
	X float32
	Y float32
	Z float32
}

func DefaultVelocityComponent added in v0.4.0

func DefaultVelocityComponent() VelocityComponent

func VelocityComponentFromValues added in v0.4.0

func VelocityComponentFromValues(
	xArg float32,
	yArg float32,
	zArg float32,
) VelocityComponent

func (VelocityComponent) Clone added in v0.4.0

type World

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

func NewWorld

func NewWorld() *World

func (*World) AddSystems

func (w *World) AddSystems(systems ...System) error

func (*World) All added in v0.4.0

func (w *World) All(yield func(entity Entity) bool)

func (*World) AllDirections added in v0.4.0

func (w *World) AllDirections(yield func(e Entity, c DirectionComponent) bool)

func (*World) AllDirectionsEntities added in v0.4.0

func (w *World) AllDirectionsEntities(yield func(e Entity) bool)

func (*World) AllDockedTos added in v0.4.0

func (w *World) AllDockedTos(yield func(e Entity, c DockedToComponent) bool)

func (*World) AllDockedTosEntities added in v0.4.0

func (w *World) AllDockedTosEntities(yield func(e Entity) bool)

func (*World) AllEnemyTags added in v0.4.0

func (w *World) AllEnemyTags(yield func(e Entity) bool)

func (*World) AllFactions added in v0.4.0

func (w *World) AllFactions(yield func(e Entity, c FactionComponent) bool)

func (*World) AllFactionsEntities added in v0.4.0

func (w *World) AllFactionsEntities(yield func(e Entity) bool)

func (*World) AllGravities added in v0.4.0

func (w *World) AllGravities(yield func(e Entity, c GravityComponent) bool)

func (*World) AllGravitiesEntities added in v0.4.0

func (w *World) AllGravitiesEntities(yield func(e Entity) bool)

func (*World) AllMutableDirections added in v0.4.0

func (w *World) AllMutableDirections(yield func(e Entity, c *DirectionComponent) bool)

func (*World) AllMutableDockedTos added in v0.4.0

func (w *World) AllMutableDockedTos(yield func(e Entity, c *DockedToComponent) bool)

func (*World) AllMutableFactions added in v0.4.0

func (w *World) AllMutableFactions(yield func(e Entity, c *FactionComponent) bool)

func (*World) AllMutableGravities added in v0.4.0

func (w *World) AllMutableGravities(yield func(e Entity, c *GravityComponent) bool)

func (*World) AllMutableNames added in v0.4.0

func (w *World) AllMutableNames(yield func(e Entity, c *NameComponent) bool)

func (*World) AllMutablePositions added in v0.4.0

func (w *World) AllMutablePositions(yield func(e Entity, c *PositionComponent) bool)

func (*World) AllMutableRotations added in v0.4.0

func (w *World) AllMutableRotations(yield func(e Entity, c *RotationComponent) bool)

func (*World) AllMutableRuledBys added in v0.4.0

func (w *World) AllMutableRuledBys(yield func(e Entity, c *RuledByComponent) bool)

func (*World) AllMutableVelocities added in v0.4.0

func (w *World) AllMutableVelocities(yield func(e Entity, c *VelocityComponent) bool)

func (*World) AllNames added in v0.4.0

func (w *World) AllNames(yield func(e Entity, c NameComponent) bool)

func (*World) AllNamesEntities added in v0.4.0

func (w *World) AllNamesEntities(yield func(e Entity) bool)

func (*World) AllPlanetTags added in v0.4.0

func (w *World) AllPlanetTags(yield func(e Entity) bool)

func (*World) AllPositions added in v0.4.0

func (w *World) AllPositions(yield func(e Entity, c PositionComponent) bool)

func (*World) AllPositionsEntities added in v0.4.0

func (w *World) AllPositionsEntities(yield func(e Entity) bool)

func (*World) AllRotations added in v0.4.0

func (w *World) AllRotations(yield func(e Entity, c RotationComponent) bool)

func (*World) AllRotationsEntities added in v0.4.0

func (w *World) AllRotationsEntities(yield func(e Entity) bool)

func (*World) AllRuledBys added in v0.4.0

func (w *World) AllRuledBys(yield func(e Entity, c RuledByComponent) bool)

func (*World) AllRuledBysEntities added in v0.4.0

func (w *World) AllRuledBysEntities(yield func(e Entity) bool)

func (*World) AllSpaceshipTags added in v0.4.0

func (w *World) AllSpaceshipTags(yield func(e Entity) bool)

func (*World) AllSpacestationTags added in v0.4.0

func (w *World) AllSpacestationTags(yield func(e Entity) bool)

func (*World) AllVelocities added in v0.4.0

func (w *World) AllVelocities(yield func(e Entity, c VelocityComponent) bool)

func (*World) AllVelocitiesEntities added in v0.4.0

func (w *World) AllVelocitiesEntities(yield func(e Entity) bool)

func (*World) AlliedWith added in v0.4.0

func (w *World) AlliedWith(to Entity) func(yield func(from Entity) bool)

func (*World) AlliedWithIsLinked added in v0.4.0

func (w *World) AlliedWithIsLinked(from, to Entity) bool

func (*World) ChildOf added in v0.4.0

func (w *World) ChildOf(to Entity) func(yield func(from Entity) bool)

func (*World) ChildOfIsLinked added in v0.4.0

func (w *World) ChildOfIsLinked(from, to Entity) bool

func (*World) DestroyEntities added in v0.2.0

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

func (*World) Direction added in v0.4.0

func (w *World) Direction(e Entity) (c DirectionComponent, ok bool)

func (*World) DirectionResource added in v0.2.0

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

func (*World) DockedTo added in v0.4.0

func (w *World) DockedTo(e Entity) (c DockedToComponent, ok bool)

func (*World) DockedToResource

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

func (*World) Eats added in v0.4.0

func (w *World) Eats(to Entity) func(yield func(from Entity) bool)

func (*World) EatsIsLinked added in v0.4.0

func (w *World) EatsIsLinked(from, to Entity) bool

func (*World) Faction added in v0.4.0

func (w *World) Faction(e Entity) (c FactionComponent, ok bool)

func (*World) FactionResource

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

func (*World) Gravity added in v0.4.0

func (w *World) Gravity(e Entity) (c GravityComponent, ok bool)

func (*World) GravityResource

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

func (*World) Grows added in v0.4.0

func (w *World) Grows(to Entity) func(yield func(from Entity) bool)

func (*World) GrowsIsLinked added in v0.4.0

func (w *World) GrowsIsLinked(from, to Entity) bool

func (*World) HasDirection added in v0.4.0

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

func (*World) HasDirectionResource added in v0.2.0

func (w *World) HasDirectionResource() bool

func (*World) HasDockedTo added in v0.4.0

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

func (*World) HasDockedToResource

func (w *World) HasDockedToResource() bool

func (*World) HasEnemyTag added in v0.4.0

func (w *World) HasEnemyTag(entity Entity) bool

func (*World) HasFaction added in v0.4.0

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

func (*World) HasFactionResource

func (w *World) HasFactionResource() bool

func (*World) HasGravity added in v0.4.0

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

func (*World) HasGravityResource

func (w *World) HasGravityResource() bool

func (*World) HasName added in v0.4.0

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

func (*World) HasNameResource

func (w *World) HasNameResource() bool

func (*World) HasPlanetTag added in v0.4.0

func (w *World) HasPlanetTag(entity Entity) bool

func (*World) HasPosition added in v0.4.0

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

func (*World) HasPositionResource

func (w *World) HasPositionResource() bool

func (*World) HasRotation added in v0.4.0

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

func (*World) HasRotationResource

func (w *World) HasRotationResource() bool

func (*World) HasRuledBy added in v0.4.0

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

func (*World) HasRuledByResource

func (w *World) HasRuledByResource() bool

func (*World) HasSpaceshipTag added in v0.4.0

func (w *World) HasSpaceshipTag(entity Entity) bool

func (*World) HasSpacestationTag added in v0.4.0

func (w *World) HasSpacestationTag(entity Entity) bool

func (*World) HasVelocity added in v0.4.0

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

func (*World) HasVelocityResource

func (w *World) HasVelocityResource() bool

func (*World) IsA added in v0.4.0

func (w *World) IsA(to Entity) func(yield func(from Entity) bool)

func (*World) IsAIsLinked added in v0.4.0

func (w *World) IsAIsLinked(from, to Entity) bool

func (*World) IsAlive added in v0.4.0

func (w *World) IsAlive(entity Entity) bool

func (*World) Likes added in v0.4.0

func (w *World) Likes(to Entity) func(yield func(from Entity) bool)

func (*World) LikesIsLinked added in v0.4.0

func (w *World) LikesIsLinked(from, to Entity) bool

func (*World) LinkAlliedWith added in v0.4.0

func (w *World) LinkAlliedWith(
	to, from Entity,
)

func (*World) LinkChildOf added in v0.4.0

func (w *World) LinkChildOf(
	to, from Entity,
)

func (*World) LinkEats added in v0.4.0

func (w *World) LinkEats(
	to, from Entity,
	amountArg uint8,
)

func (*World) LinkGrows added in v0.4.0

func (w *World) LinkGrows(
	to, from Entity,
)

func (*World) LinkIsA added in v0.4.0

func (w *World) LinkIsA(
	to, from Entity,
)

func (*World) LinkLikes added in v0.4.0

func (w *World) LinkLikes(
	to, from Entity,
)

func (*World) MustDirection added in v0.4.0

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

func (*World) MustDirectionResource added in v0.4.0

func (w *World) MustDirectionResource() DirectionComponent

func (*World) MustDockedTo added in v0.4.0

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

func (*World) MustDockedToResource added in v0.4.0

func (w *World) MustDockedToResource() DockedToComponent

func (*World) MustFaction added in v0.4.0

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

func (*World) MustFactionResource added in v0.4.0

func (w *World) MustFactionResource() FactionComponent

func (*World) MustGravity added in v0.4.0

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

func (*World) MustGravityResource added in v0.4.0

func (w *World) MustGravityResource() GravityComponent

func (*World) MustName added in v0.4.0

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

func (*World) MustNameResource added in v0.4.0

func (w *World) MustNameResource() NameComponent

func (*World) MustPosition added in v0.4.0

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

func (*World) MustPositionResource added in v0.4.0

func (w *World) MustPositionResource() PositionComponent

func (*World) MustRotation added in v0.4.0

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

func (*World) MustRotationResource added in v0.4.0

func (w *World) MustRotationResource() RotationComponent

func (*World) MustRuledBy added in v0.4.0

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

func (*World) MustRuledByResource added in v0.4.0

func (w *World) MustRuledByResource() RuledByComponent

func (*World) MustVelocity added in v0.4.0

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

func (*World) MustVelocityResource added in v0.4.0

func (w *World) MustVelocityResource() VelocityComponent

func (*World) MutableDirection added in v0.4.0

func (w *World) MutableDirection(e Entity) (c *DirectionComponent, ok bool)

func (*World) MutableDockedTo added in v0.4.0

func (w *World) MutableDockedTo(e Entity) (c *DockedToComponent, ok bool)

func (*World) MutableFaction added in v0.4.0

func (w *World) MutableFaction(e Entity) (c *FactionComponent, ok bool)

func (*World) MutableGravity added in v0.4.0

func (w *World) MutableGravity(e Entity) (c *GravityComponent, ok bool)

func (*World) MutableName added in v0.4.0

func (w *World) MutableName(e Entity) (c *NameComponent, ok bool)

func (*World) MutablePosition added in v0.4.0

func (w *World) MutablePosition(e Entity) (c *PositionComponent, ok bool)

func (*World) MutableRotation added in v0.4.0

func (w *World) MutableRotation(e Entity) (c *RotationComponent, ok bool)

func (*World) MutableRuledBy added in v0.4.0

func (w *World) MutableRuledBy(e Entity) (c *RuledByComponent, ok bool)

func (*World) MutableVelocity added in v0.4.0

func (w *World) MutableVelocity(e Entity) (c *VelocityComponent, ok bool)

func (*World) Name added in v0.4.0

func (w *World) Name(e Entity) (c NameComponent, ok bool)

func (*World) NameResource

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

func (*World) NextEntities added in v0.4.0

func (w *World) NextEntities(count int, opts ...EntityBuilderOption) []Entity

func (*World) NextEntity added in v0.4.0

func (w *World) NextEntity(opts ...EntityBuilderOption) Entity

func (*World) OnEntitiesCreated added in v0.4.0

func (w *World) OnEntitiesCreated(fn func(EntitiesCreatedEvent)) UnsubscribeFunc

func (*World) OnEntitiesDestroyed added in v0.4.0

func (w *World) OnEntitiesDestroyed(fn func(EntitiesDestroyedEvent)) UnsubscribeFunc

func (*World) Position added in v0.4.0

func (w *World) Position(e Entity) (c PositionComponent, ok bool)

func (*World) PositionResource

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

func (*World) QueryExamplePositionVelocity added in v0.4.0

func (w *World) QueryExamplePositionVelocity(yield queryExamplePositionVelocitiesIter)

func (*World) QueryExamplePositionVelocityEntities added in v0.4.0

func (w *World) QueryExamplePositionVelocityEntities(yield func(e Entity) bool)

func (*World) RemoveAllAlliedWithRelationships added in v0.4.0

func (w *World) RemoveAllAlliedWithRelationships(to Entity)

func (*World) RemoveAllChildOfRelationships added in v0.4.0

func (w *World) RemoveAllChildOfRelationships(to Entity)

func (*World) RemoveAllEatsRelationships added in v0.4.0

func (w *World) RemoveAllEatsRelationships(to Entity)

func (*World) RemoveAllGrowsRelationships added in v0.4.0

func (w *World) RemoveAllGrowsRelationships(to Entity)

func (*World) RemoveAllIsARelationships added in v0.4.0

func (w *World) RemoveAllIsARelationships(to Entity)

func (*World) RemoveAllLikesRelationships added in v0.4.0

func (w *World) RemoveAllLikesRelationships(to Entity)

func (*World) RemoveAlliedWithRelationships added in v0.4.0

func (w *World) RemoveAlliedWithRelationships(to Entity, froms ...Entity)

func (*World) RemoveChildOfRelationships added in v0.4.0

func (w *World) RemoveChildOfRelationships(to Entity, froms ...Entity)

func (*World) RemoveDirection added in v0.4.0

func (w *World) RemoveDirection(e Entity)

func (*World) RemoveDirectionResource added in v0.2.0

func (w *World) RemoveDirectionResource()

func (*World) RemoveDockedTo added in v0.4.0

func (w *World) RemoveDockedTo(e Entity)

func (*World) RemoveDockedToResource

func (w *World) RemoveDockedToResource()

func (*World) RemoveEatsRelationships added in v0.4.0

func (w *World) RemoveEatsRelationships(to Entity, froms ...Entity)

func (*World) RemoveEnemyTag added in v0.4.0

func (w *World) RemoveEnemyTag(entities ...Entity) (anyRemoved bool)

func (*World) RemoveFaction added in v0.4.0

func (w *World) RemoveFaction(e Entity)

func (*World) RemoveFactionResource

func (w *World) RemoveFactionResource()

func (*World) RemoveGravity added in v0.4.0

func (w *World) RemoveGravity(e Entity)

func (*World) RemoveGravityResource

func (w *World) RemoveGravityResource()

func (*World) RemoveGrowsRelationships added in v0.4.0

func (w *World) RemoveGrowsRelationships(to Entity, froms ...Entity)

func (*World) RemoveIsARelationships added in v0.4.0

func (w *World) RemoveIsARelationships(to Entity, froms ...Entity)

func (*World) RemoveLikesRelationships added in v0.4.0

func (w *World) RemoveLikesRelationships(to Entity, froms ...Entity)

func (*World) RemoveName added in v0.4.0

func (w *World) RemoveName(e Entity)

func (*World) RemoveNameResource

func (w *World) RemoveNameResource()

func (*World) RemovePlanetTag added in v0.4.0

func (w *World) RemovePlanetTag(entities ...Entity) (anyRemoved bool)

func (*World) RemovePosition added in v0.4.0

func (w *World) RemovePosition(e Entity)

func (*World) RemovePositionResource

func (w *World) RemovePositionResource()

func (*World) RemoveRotation added in v0.4.0

func (w *World) RemoveRotation(e Entity)

func (*World) RemoveRotationResource

func (w *World) RemoveRotationResource()

func (*World) RemoveRuledBy added in v0.4.0

func (w *World) RemoveRuledBy(e Entity)

func (*World) RemoveRuledByResource

func (w *World) RemoveRuledByResource()

func (*World) RemoveSpaceshipTag added in v0.4.0

func (w *World) RemoveSpaceshipTag(entities ...Entity) (anyRemoved bool)

func (*World) RemoveSpacestationTag added in v0.4.0

func (w *World) RemoveSpacestationTag(entities ...Entity) (anyRemoved bool)

func (*World) RemoveVelocity added in v0.4.0

func (w *World) RemoveVelocity(e Entity)

func (*World) RemoveVelocityResource

func (w *World) RemoveVelocityResource()

func (*World) Reset

func (w *World) Reset()

func (*World) ResourceHasEnemyTag added in v0.4.0

func (w *World) ResourceHasEnemyTag() bool

func (*World) ResourceHasPlanetTag added in v0.4.0

func (w *World) ResourceHasPlanetTag() bool

func (*World) ResourceHasSpaceshipTag added in v0.4.0

func (w *World) ResourceHasSpaceshipTag() bool

func (*World) ResourceHasSpacestationTag added in v0.4.0

func (w *World) ResourceHasSpacestationTag() bool

func (*World) ResourceRemoveEnemyTag added in v0.4.0

func (w *World) ResourceRemoveEnemyTag()

func (*World) ResourceRemovePlanetTag added in v0.4.0

func (w *World) ResourceRemovePlanetTag()

func (*World) ResourceRemoveSpaceshipTag added in v0.4.0

func (w *World) ResourceRemoveSpaceshipTag()

func (*World) ResourceRemoveSpacestationTag added in v0.4.0

func (w *World) ResourceRemoveSpacestationTag()

func (*World) ResourceUpsertEnemyTag added in v0.4.0

func (w *World) ResourceUpsertEnemyTag()

Resource

func (*World) ResourceUpsertPlanetTag added in v0.4.0

func (w *World) ResourceUpsertPlanetTag()

Resource

func (*World) ResourceUpsertSpaceshipTag added in v0.4.0

func (w *World) ResourceUpsertSpaceshipTag()

Resource

func (*World) ResourceUpsertSpacestationTag added in v0.4.0

func (w *World) ResourceUpsertSpacestationTag()

Resource

func (*World) Rotation added in v0.4.0

func (w *World) Rotation(e Entity) (c RotationComponent, ok bool)

func (*World) RotationResource

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

func (*World) RuledBy added in v0.4.0

func (w *World) RuledBy(e Entity) (c RuledByComponent, ok bool)

func (*World) RuledByResource

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

func (*World) SetDirection added in v0.4.0

func (w *World) SetDirection(e Entity, arg EnumDirection) (old DirectionComponent, wasAdded bool)

func (*World) SetDirectionResource added in v0.2.0

func (w *World) SetDirectionResource(arg EnumDirection)

func (*World) SetDockedTo added in v0.4.0

func (w *World) SetDockedTo(e Entity, arg Entity) (old DockedToComponent, wasAdded bool)

func (*World) SetDockedToResource

func (w *World) SetDockedToResource(arg Entity)

func (*World) SetFaction added in v0.4.0

func (w *World) SetFaction(e Entity, arg Entity) (old FactionComponent, wasAdded bool)

func (*World) SetFactionResource

func (w *World) SetFactionResource(arg Entity)

func (*World) SetGravity added in v0.4.0

func (w *World) SetGravity(e Entity, arg float32) (old GravityComponent, wasAdded bool)

func (*World) SetGravityResource

func (w *World) SetGravityResource(arg float32)

func (*World) SetName added in v0.4.0

func (w *World) SetName(e Entity, arg string) (old NameComponent, wasAdded bool)

func (*World) SetNameResource

func (w *World) SetNameResource(arg string)

func (*World) SetPosition added in v0.4.0

func (w *World) SetPosition(e Entity, c PositionComponent) (old PositionComponent, wasAdded bool)

func (*World) SetPositionFromValues added in v0.4.0

func (w *World) SetPositionFromValues(
	e Entity,
	xArg float32,
	yArg float32,
	zArg float32,
)

func (*World) SetPositionResource

func (w *World) SetPositionResource(c PositionComponent)

func (*World) SetPositionResourceFromValues added in v0.4.0

func (w *World) SetPositionResourceFromValues(
	xArg float32,
	yArg float32,
	zArg float32,
)

func (*World) SetRotation added in v0.4.0

func (w *World) SetRotation(e Entity, c RotationComponent) (old RotationComponent, wasAdded bool)

func (*World) SetRotationFromValues added in v0.4.0

func (w *World) SetRotationFromValues(
	e Entity,
	xArg float32,
	yArg float32,
	zArg float32,
	wArg float32,
)

func (*World) SetRotationResource

func (w *World) SetRotationResource(c RotationComponent)

func (*World) SetRotationResourceFromValues added in v0.4.0

func (w *World) SetRotationResourceFromValues(
	xArg float32,
	yArg float32,
	zArg float32,
	wArg float32,
)

func (*World) SetRuledBy added in v0.4.0

func (w *World) SetRuledBy(e Entity, arg Entity) (old RuledByComponent, wasAdded bool)

func (*World) SetRuledByResource

func (w *World) SetRuledByResource(arg Entity)

func (*World) SetVelocity added in v0.4.0

func (w *World) SetVelocity(e Entity, c VelocityComponent) (old VelocityComponent, wasAdded bool)

func (*World) SetVelocityFromValues added in v0.4.0

func (w *World) SetVelocityFromValues(
	e Entity,
	xArg float32,
	yArg float32,
	zArg float32,
)

func (*World) SetVelocityResource

func (w *World) SetVelocityResource(c VelocityComponent)

func (*World) SetVelocityResourceFromValues added in v0.4.0

func (w *World) SetVelocityResourceFromValues(
	xArg float32,
	yArg float32,
	zArg float32,
)

func (*World) TagWithEnemy added in v0.4.0

func (w *World) TagWithEnemy(entities ...Entity) (anyUpdated bool)

func (*World) TagWithPlanet added in v0.4.0

func (w *World) TagWithPlanet(entities ...Entity) (anyUpdated bool)

func (*World) TagWithSpaceship added in v0.4.0

func (w *World) TagWithSpaceship(entities ...Entity) (anyUpdated bool)

func (*World) TagWithSpacestation added in v0.4.0

func (w *World) TagWithSpacestation(entities ...Entity) (anyUpdated bool)

func (*World) Tick

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

func (*World) UnlinkAlliedWith added in v0.4.0

func (w *World) UnlinkAlliedWith(from, to Entity)

func (*World) UnlinkChildOf added in v0.4.0

func (w *World) UnlinkChildOf(from, to Entity)

func (*World) UnlinkEats added in v0.4.0

func (w *World) UnlinkEats(from, to Entity)

func (*World) UnlinkGrows added in v0.4.0

func (w *World) UnlinkGrows(from, to Entity)

func (*World) UnlinkIsA added in v0.4.0

func (w *World) UnlinkIsA(from, to Entity)

func (*World) UnlinkLikes added in v0.4.0

func (w *World) UnlinkLikes(from, to Entity)

func (*World) Velocity added in v0.4.0

func (w *World) Velocity(e Entity) (c VelocityComponent, ok bool)

func (*World) VelocityResource

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

Jump to

Keyboard shortcuts

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