Documentation ¶
Index ¶
- Variables
- func AllSparseSetsView() templ.Component
- func Page() templ.Component
- func SetupRoutes(setupCtx context.Context, world *World, baseRouter chi.Router) error
- func SparseSetView[T any](ss *SparseSet[T]) templ.Component
- type AlliedWithRelationship
- type AlliedWithRelationshipPair
- type ChildOfRelationship
- type ChildOfRelationshipPair
- type DirectionComponent
- type DockedToComponent
- type EatsRelationship
- type EatsRelationshipPair
- type EntitiesCreatedEvent
- type EntitiesDestroyedEvent
- type Entity
- type EntityBuilderOption
- func WithDirection(arg EnumDirection) EntityBuilderOption
- func WithDockedTo(arg Entity) EntityBuilderOption
- func WithEnemyTag() EntityBuilderOption
- func WithFaction(arg Entity) EntityBuilderOption
- func WithGravity(arg float32) EntityBuilderOption
- func WithName(arg string) EntityBuilderOption
- func WithPlanetTag() EntityBuilderOption
- func WithPosition(c PositionComponent) EntityBuilderOption
- func WithPositionFromValues(xArg float32, yArg float32, zArg float32) EntityBuilderOption
- func WithRotation(c RotationComponent) EntityBuilderOption
- func WithRotationFromValues(xArg float32, yArg float32, zArg float32, wArg float32) EntityBuilderOption
- func WithRuledBy(arg Entity) EntityBuilderOption
- func WithSpaceshipTag() EntityBuilderOption
- func WithSpacestationTag() EntityBuilderOption
- func WithVelocity(c VelocityComponent) EntityBuilderOption
- func WithVelocityFromValues(xArg float32, yArg float32, zArg float32) EntityBuilderOption
- type EnumDirection
- type FactionComponent
- type GravityComponent
- type GrowsRelationship
- type GrowsRelationshipPair
- type IsARelationship
- type IsARelationshipPair
- type LikesRelationship
- type LikesRelationshipPair
- type NameComponent
- type PositionComponent
- type QueryExamplePositionVelocitiesArgs
- type ReliedOnIter
- type RotationComponent
- type RuledByComponent
- type SparseSet
- func (s *SparseSet[T]) All(yield func(e Entity, c T) bool)
- func (s *SparseSet[T]) AllEntities(yield func(e Entity) bool)
- func (s *SparseSet[T]) AllMutable(yield func(e Entity, c *T) bool)
- func (s *SparseSet[T]) Cap() int
- func (s *SparseSet[T]) Clear()
- func (s *SparseSet[T]) Contains(e Entity) bool
- func (s *SparseSet[T]) Data(e Entity) (T, bool)
- func (s *SparseSet[T]) DataMutable(e Entity) (*T, bool)
- func (s *SparseSet[T]) Len() int
- func (s *SparseSet[T]) Remove(e Entity) (wasRemoved bool)
- func (s *SparseSet[T]) Upsert(e Entity, c T) (old T, wasAdded bool)
- type System
- type SystemTicker
- type UnsubscribeFunc
- type VelocityComponent
- type World
- func (w *World) AddSystems(systems ...System) error
- func (w *World) All(yield func(entity Entity) bool)
- func (w *World) AllDirections(yield func(e Entity, c DirectionComponent) bool)
- func (w *World) AllDirectionsEntities(yield func(e Entity) bool)
- func (w *World) AllDockedTos(yield func(e Entity, c DockedToComponent) bool)
- func (w *World) AllDockedTosEntities(yield func(e Entity) bool)
- func (w *World) AllEnemyTags(yield func(e Entity) bool)
- func (w *World) AllFactions(yield func(e Entity, c FactionComponent) bool)
- func (w *World) AllFactionsEntities(yield func(e Entity) bool)
- func (w *World) AllGravities(yield func(e Entity, c GravityComponent) bool)
- func (w *World) AllGravitiesEntities(yield func(e Entity) bool)
- func (w *World) AllMutableDirections(yield func(e Entity, c *DirectionComponent) bool)
- func (w *World) AllMutableDockedTos(yield func(e Entity, c *DockedToComponent) bool)
- func (w *World) AllMutableFactions(yield func(e Entity, c *FactionComponent) bool)
- func (w *World) AllMutableGravities(yield func(e Entity, c *GravityComponent) bool)
- func (w *World) AllMutableNames(yield func(e Entity, c *NameComponent) bool)
- func (w *World) AllMutablePositions(yield func(e Entity, c *PositionComponent) bool)
- func (w *World) AllMutableRotations(yield func(e Entity, c *RotationComponent) bool)
- func (w *World) AllMutableRuledBys(yield func(e Entity, c *RuledByComponent) bool)
- func (w *World) AllMutableVelocities(yield func(e Entity, c *VelocityComponent) bool)
- func (w *World) AllNames(yield func(e Entity, c NameComponent) bool)
- func (w *World) AllNamesEntities(yield func(e Entity) bool)
- func (w *World) AllPlanetTags(yield func(e Entity) bool)
- func (w *World) AllPositions(yield func(e Entity, c PositionComponent) bool)
- func (w *World) AllPositionsEntities(yield func(e Entity) bool)
- func (w *World) AllRotations(yield func(e Entity, c RotationComponent) bool)
- func (w *World) AllRotationsEntities(yield func(e Entity) bool)
- func (w *World) AllRuledBys(yield func(e Entity, c RuledByComponent) bool)
- func (w *World) AllRuledBysEntities(yield func(e Entity) bool)
- func (w *World) AllSpaceshipTags(yield func(e Entity) bool)
- func (w *World) AllSpacestationTags(yield func(e Entity) bool)
- func (w *World) AllVelocities(yield func(e Entity, c VelocityComponent) bool)
- func (w *World) AllVelocitiesEntities(yield func(e Entity) bool)
- func (w *World) AlliedWith(to Entity) func(yield func(from Entity) bool)
- func (w *World) AlliedWithIsLinked(from, to Entity) bool
- func (w *World) ChildOf(to Entity) func(yield func(from Entity) bool)
- func (w *World) ChildOfIsLinked(from, to Entity) bool
- func (w *World) DestroyEntities(entities ...Entity)
- func (w *World) Direction(e Entity) (c DirectionComponent, ok bool)
- func (w *World) DirectionResource() (DirectionComponent, bool)
- func (w *World) DockedTo(e Entity) (c DockedToComponent, ok bool)
- func (w *World) DockedToResource() (DockedToComponent, bool)
- func (w *World) Eats(to Entity) func(yield func(from Entity) bool)
- func (w *World) EatsIsLinked(from, to Entity) bool
- func (w *World) Faction(e Entity) (c FactionComponent, ok bool)
- func (w *World) FactionResource() (FactionComponent, bool)
- func (w *World) Gravity(e Entity) (c GravityComponent, ok bool)
- func (w *World) GravityResource() (GravityComponent, bool)
- func (w *World) Grows(to Entity) func(yield func(from Entity) bool)
- func (w *World) GrowsIsLinked(from, to Entity) bool
- func (w *World) HasDirection(e Entity) bool
- func (w *World) HasDirectionResource() bool
- func (w *World) HasDockedTo(e Entity) bool
- func (w *World) HasDockedToResource() bool
- func (w *World) HasEnemyTag(entity Entity) bool
- func (w *World) HasFaction(e Entity) bool
- func (w *World) HasFactionResource() bool
- func (w *World) HasGravity(e Entity) bool
- func (w *World) HasGravityResource() bool
- func (w *World) HasName(e Entity) bool
- func (w *World) HasNameResource() bool
- func (w *World) HasPlanetTag(entity Entity) bool
- func (w *World) HasPosition(e Entity) bool
- func (w *World) HasPositionResource() bool
- func (w *World) HasRotation(e Entity) bool
- func (w *World) HasRotationResource() bool
- func (w *World) HasRuledBy(e Entity) bool
- func (w *World) HasRuledByResource() bool
- func (w *World) HasSpaceshipTag(entity Entity) bool
- func (w *World) HasSpacestationTag(entity Entity) bool
- func (w *World) HasVelocity(e Entity) bool
- func (w *World) HasVelocityResource() bool
- func (w *World) IsA(to Entity) func(yield func(from Entity) bool)
- func (w *World) IsAIsLinked(from, to Entity) bool
- func (w *World) IsAlive(entity Entity) bool
- func (w *World) Likes(to Entity) func(yield func(from Entity) bool)
- func (w *World) LikesIsLinked(from, to Entity) bool
- func (w *World) LinkAlliedWith(to, from Entity)
- func (w *World) LinkChildOf(to, from Entity)
- func (w *World) LinkEats(to, from Entity, amountArg uint8)
- func (w *World) LinkGrows(to, from Entity)
- func (w *World) LinkIsA(to, from Entity)
- func (w *World) LinkLikes(to, from Entity)
- func (w *World) MustDirection(e Entity) DirectionComponent
- func (w *World) MustDirectionResource() DirectionComponent
- func (w *World) MustDockedTo(e Entity) DockedToComponent
- func (w *World) MustDockedToResource() DockedToComponent
- func (w *World) MustFaction(e Entity) FactionComponent
- func (w *World) MustFactionResource() FactionComponent
- func (w *World) MustGravity(e Entity) GravityComponent
- func (w *World) MustGravityResource() GravityComponent
- func (w *World) MustName(e Entity) NameComponent
- func (w *World) MustNameResource() NameComponent
- func (w *World) MustPosition(e Entity) PositionComponent
- func (w *World) MustPositionResource() PositionComponent
- func (w *World) MustRotation(e Entity) RotationComponent
- func (w *World) MustRotationResource() RotationComponent
- func (w *World) MustRuledBy(e Entity) RuledByComponent
- func (w *World) MustRuledByResource() RuledByComponent
- func (w *World) MustVelocity(e Entity) VelocityComponent
- func (w *World) MustVelocityResource() VelocityComponent
- func (w *World) MutableDirection(e Entity) (c *DirectionComponent, ok bool)
- func (w *World) MutableDockedTo(e Entity) (c *DockedToComponent, ok bool)
- func (w *World) MutableFaction(e Entity) (c *FactionComponent, ok bool)
- func (w *World) MutableGravity(e Entity) (c *GravityComponent, ok bool)
- func (w *World) MutableName(e Entity) (c *NameComponent, ok bool)
- func (w *World) MutablePosition(e Entity) (c *PositionComponent, ok bool)
- func (w *World) MutableRotation(e Entity) (c *RotationComponent, ok bool)
- func (w *World) MutableRuledBy(e Entity) (c *RuledByComponent, ok bool)
- func (w *World) MutableVelocity(e Entity) (c *VelocityComponent, ok bool)
- func (w *World) Name(e Entity) (c NameComponent, ok bool)
- func (w *World) NameResource() (NameComponent, bool)
- func (w *World) NextEntities(count int, opts ...EntityBuilderOption) []Entity
- func (w *World) NextEntity(opts ...EntityBuilderOption) Entity
- func (w *World) OnEntitiesCreated(fn func(EntitiesCreatedEvent)) UnsubscribeFunc
- func (w *World) OnEntitiesDestroyed(fn func(EntitiesDestroyedEvent)) UnsubscribeFunc
- func (w *World) Position(e Entity) (c PositionComponent, ok bool)
- func (w *World) PositionResource() (PositionComponent, bool)
- func (w *World) QueryExamplePositionVelocity(yield queryExamplePositionVelocitiesIter)
- func (w *World) QueryExamplePositionVelocityEntities(yield func(e Entity) bool)
- func (w *World) RemoveAllAlliedWithRelationships(to Entity)
- func (w *World) RemoveAllChildOfRelationships(to Entity)
- func (w *World) RemoveAllEatsRelationships(to Entity)
- func (w *World) RemoveAllGrowsRelationships(to Entity)
- func (w *World) RemoveAllIsARelationships(to Entity)
- func (w *World) RemoveAllLikesRelationships(to Entity)
- func (w *World) RemoveAlliedWithRelationships(to Entity, froms ...Entity)
- func (w *World) RemoveChildOfRelationships(to Entity, froms ...Entity)
- func (w *World) RemoveDirection(e Entity)
- func (w *World) RemoveDirectionResource()
- func (w *World) RemoveDockedTo(e Entity)
- func (w *World) RemoveDockedToResource()
- func (w *World) RemoveEatsRelationships(to Entity, froms ...Entity)
- func (w *World) RemoveEnemyTag(entities ...Entity) (anyRemoved bool)
- func (w *World) RemoveFaction(e Entity)
- func (w *World) RemoveFactionResource()
- func (w *World) RemoveGravity(e Entity)
- func (w *World) RemoveGravityResource()
- func (w *World) RemoveGrowsRelationships(to Entity, froms ...Entity)
- func (w *World) RemoveIsARelationships(to Entity, froms ...Entity)
- func (w *World) RemoveLikesRelationships(to Entity, froms ...Entity)
- func (w *World) RemoveName(e Entity)
- func (w *World) RemoveNameResource()
- func (w *World) RemovePlanetTag(entities ...Entity) (anyRemoved bool)
- func (w *World) RemovePosition(e Entity)
- func (w *World) RemovePositionResource()
- func (w *World) RemoveRotation(e Entity)
- func (w *World) RemoveRotationResource()
- func (w *World) RemoveRuledBy(e Entity)
- func (w *World) RemoveRuledByResource()
- func (w *World) RemoveSpaceshipTag(entities ...Entity) (anyRemoved bool)
- func (w *World) RemoveSpacestationTag(entities ...Entity) (anyRemoved bool)
- func (w *World) RemoveVelocity(e Entity)
- func (w *World) RemoveVelocityResource()
- func (w *World) Reset()
- func (w *World) ResourceHasEnemyTag() bool
- func (w *World) ResourceHasPlanetTag() bool
- func (w *World) ResourceHasSpaceshipTag() bool
- func (w *World) ResourceHasSpacestationTag() bool
- func (w *World) ResourceRemoveEnemyTag()
- func (w *World) ResourceRemovePlanetTag()
- func (w *World) ResourceRemoveSpaceshipTag()
- func (w *World) ResourceRemoveSpacestationTag()
- func (w *World) ResourceUpsertEnemyTag()
- func (w *World) ResourceUpsertPlanetTag()
- func (w *World) ResourceUpsertSpaceshipTag()
- func (w *World) ResourceUpsertSpacestationTag()
- func (w *World) Rotation(e Entity) (c RotationComponent, ok bool)
- func (w *World) RotationResource() (RotationComponent, bool)
- func (w *World) RuledBy(e Entity) (c RuledByComponent, ok bool)
- func (w *World) RuledByResource() (RuledByComponent, bool)
- func (w *World) SetDirection(e Entity, arg EnumDirection) (old DirectionComponent, wasAdded bool)
- func (w *World) SetDirectionResource(arg EnumDirection)
- func (w *World) SetDockedTo(e Entity, arg Entity) (old DockedToComponent, wasAdded bool)
- func (w *World) SetDockedToResource(arg Entity)
- func (w *World) SetFaction(e Entity, arg Entity) (old FactionComponent, wasAdded bool)
- func (w *World) SetFactionResource(arg Entity)
- func (w *World) SetGravity(e Entity, arg float32) (old GravityComponent, wasAdded bool)
- func (w *World) SetGravityResource(arg float32)
- func (w *World) SetName(e Entity, arg string) (old NameComponent, wasAdded bool)
- func (w *World) SetNameResource(arg string)
- func (w *World) SetPosition(e Entity, c PositionComponent) (old PositionComponent, wasAdded bool)
- func (w *World) SetPositionFromValues(e Entity, xArg float32, yArg float32, zArg float32)
- func (w *World) SetPositionResource(c PositionComponent)
- func (w *World) SetPositionResourceFromValues(xArg float32, yArg float32, zArg float32)
- func (w *World) SetRotation(e Entity, c RotationComponent) (old RotationComponent, wasAdded bool)
- func (w *World) SetRotationFromValues(e Entity, xArg float32, yArg float32, zArg float32, wArg float32)
- func (w *World) SetRotationResource(c RotationComponent)
- func (w *World) SetRotationResourceFromValues(xArg float32, yArg float32, zArg float32, wArg float32)
- func (w *World) SetRuledBy(e Entity, arg Entity) (old RuledByComponent, wasAdded bool)
- func (w *World) SetRuledByResource(arg Entity)
- func (w *World) SetVelocity(e Entity, c VelocityComponent) (old VelocityComponent, wasAdded bool)
- func (w *World) SetVelocityFromValues(e Entity, xArg float32, yArg float32, zArg float32)
- func (w *World) SetVelocityResource(c VelocityComponent)
- func (w *World) SetVelocityResourceFromValues(xArg float32, yArg float32, zArg float32)
- func (w *World) TagWithEnemy(entities ...Entity) (anyUpdated bool)
- func (w *World) TagWithPlanet(entities ...Entity) (anyUpdated bool)
- func (w *World) TagWithSpaceship(entities ...Entity) (anyUpdated bool)
- func (w *World) TagWithSpacestation(entities ...Entity) (anyUpdated bool)
- func (w *World) Tick(ctx context.Context) error
- func (w *World) UnlinkAlliedWith(from, to Entity)
- func (w *World) UnlinkChildOf(from, to Entity)
- func (w *World) UnlinkEats(from, to Entity)
- func (w *World) UnlinkGrows(from, to Entity)
- func (w *World) UnlinkIsA(from, to Entity)
- func (w *World) UnlinkLikes(from, to Entity)
- func (w *World) Velocity(e Entity) (c VelocityComponent, ok bool)
- func (w *World) VelocityResource() (VelocityComponent, bool)
Constants ¶
This section is empty.
Variables ¶
View Source
var Tombstone = Entity(maxEntities)
Functions ¶
func AllSparseSetsView ¶ added in v0.4.0
func SetupRoutes ¶ added in v0.4.0
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 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 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
func (c DirectionComponent) Clone() DirectionComponent
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
func (c DockedToComponent) Clone() DockedToComponent
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 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 SortEntities ¶ added in v0.4.0
func (Entity) Generation ¶ added in v0.4.0
type EntityBuilderOption ¶ added in v0.4.0
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 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 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
func (c FactionComponent) Clone() FactionComponent
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
func (c GravityComponent) Clone() GravityComponent
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 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 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 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
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
func (c PositionComponent) Clone() PositionComponent
type QueryExamplePositionVelocitiesArgs ¶ added in v0.4.0
type QueryExamplePositionVelocitiesArgs struct { Velocity VelocityComponent Position *PositionComponent }
type ReliedOnIter ¶ added in v0.4.0
type RotationComponent ¶ added in v0.4.0
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
func (c RotationComponent) Clone() RotationComponent
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
func (c RuledByComponent) Clone() RuledByComponent
type SparseSet ¶
type SparseSet[T any] struct { // contains filtered or unexported fields }
func NewSparseSet ¶
func (*SparseSet[T]) AllEntities ¶ added in v0.4.0
func (*SparseSet[T]) AllMutable ¶ added in v0.4.0
func (*SparseSet[T]) DataMutable ¶ added in v0.4.0
type System ¶
type System interface { Initialize(w *World) error ReliesOn() ReliedOnIter }
type SystemTicker ¶ added in v0.4.0
type UnsubscribeFunc ¶
type UnsubscribeFunc func()
type VelocityComponent ¶ added in v0.4.0
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
func (c VelocityComponent) Clone() VelocityComponent
type World ¶
type World struct {
// contains filtered or unexported fields
}
func (*World) AddSystems ¶
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 (*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 (*World) AllEnemyTags ¶ added in v0.4.0
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 (*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 (*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 (*World) AllPlanetTags ¶ added in v0.4.0
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 (*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 (*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 (*World) AllSpaceshipTags ¶ added in v0.4.0
func (*World) AllSpacestationTags ¶ added in v0.4.0
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 (*World) AlliedWith ¶ added in v0.4.0
func (*World) AlliedWithIsLinked ¶ added in v0.4.0
func (*World) ChildOfIsLinked ¶ added in v0.4.0
func (*World) DestroyEntities ¶ added in v0.2.0
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) EatsIsLinked ¶ added in v0.4.0
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) GrowsIsLinked ¶ added in v0.4.0
func (*World) HasDirection ¶ added in v0.4.0
func (*World) HasDirectionResource ¶ added in v0.2.0
func (*World) HasDockedTo ¶ added in v0.4.0
func (*World) HasDockedToResource ¶
func (*World) HasEnemyTag ¶ added in v0.4.0
func (*World) HasFaction ¶ added in v0.4.0
func (*World) HasFactionResource ¶
func (*World) HasGravity ¶ added in v0.4.0
func (*World) HasGravityResource ¶
func (*World) HasNameResource ¶
func (*World) HasPlanetTag ¶ added in v0.4.0
func (*World) HasPosition ¶ added in v0.4.0
func (*World) HasPositionResource ¶
func (*World) HasRotation ¶ added in v0.4.0
func (*World) HasRotationResource ¶
func (*World) HasRuledBy ¶ added in v0.4.0
func (*World) HasRuledByResource ¶
func (*World) HasSpaceshipTag ¶ added in v0.4.0
func (*World) HasSpacestationTag ¶ added in v0.4.0
func (*World) HasVelocity ¶ added in v0.4.0
func (*World) HasVelocityResource ¶
func (*World) IsAIsLinked ¶ added in v0.4.0
func (*World) LikesIsLinked ¶ added in v0.4.0
func (*World) LinkAlliedWith ¶ added in v0.4.0
func (*World) LinkChildOf ¶ added in v0.4.0
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) 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 (*World) RemoveAllAlliedWithRelationships ¶ added in v0.4.0
func (*World) RemoveAllChildOfRelationships ¶ added in v0.4.0
func (*World) RemoveAllEatsRelationships ¶ added in v0.4.0
func (*World) RemoveAllGrowsRelationships ¶ added in v0.4.0
func (*World) RemoveAllIsARelationships ¶ added in v0.4.0
func (*World) RemoveAllLikesRelationships ¶ added in v0.4.0
func (*World) RemoveAlliedWithRelationships ¶ added in v0.4.0
func (*World) RemoveChildOfRelationships ¶ added in v0.4.0
func (*World) RemoveDirection ¶ added in v0.4.0
func (*World) RemoveDirectionResource ¶ added in v0.2.0
func (w *World) RemoveDirectionResource()
func (*World) RemoveDockedTo ¶ added in v0.4.0
func (*World) RemoveDockedToResource ¶
func (w *World) RemoveDockedToResource()
func (*World) RemoveEatsRelationships ¶ added in v0.4.0
func (*World) RemoveEnemyTag ¶ added in v0.4.0
func (*World) RemoveFaction ¶ added in v0.4.0
func (*World) RemoveFactionResource ¶
func (w *World) RemoveFactionResource()
func (*World) RemoveGravity ¶ added in v0.4.0
func (*World) RemoveGravityResource ¶
func (w *World) RemoveGravityResource()
func (*World) RemoveGrowsRelationships ¶ added in v0.4.0
func (*World) RemoveIsARelationships ¶ added in v0.4.0
func (*World) RemoveLikesRelationships ¶ added in v0.4.0
func (*World) RemoveName ¶ added in v0.4.0
func (*World) RemoveNameResource ¶
func (w *World) RemoveNameResource()
func (*World) RemovePlanetTag ¶ added in v0.4.0
func (*World) RemovePosition ¶ added in v0.4.0
func (*World) RemovePositionResource ¶
func (w *World) RemovePositionResource()
func (*World) RemoveRotation ¶ added in v0.4.0
func (*World) RemoveRotationResource ¶
func (w *World) RemoveRotationResource()
func (*World) RemoveRuledBy ¶ added in v0.4.0
func (*World) RemoveRuledByResource ¶
func (w *World) RemoveRuledByResource()
func (*World) RemoveSpaceshipTag ¶ added in v0.4.0
func (*World) RemoveSpacestationTag ¶ added in v0.4.0
func (*World) RemoveVelocity ¶ added in v0.4.0
func (*World) RemoveVelocityResource ¶
func (w *World) RemoveVelocityResource()
func (*World) ResourceHasEnemyTag ¶ added in v0.4.0
func (*World) ResourceHasPlanetTag ¶ added in v0.4.0
func (*World) ResourceHasSpaceshipTag ¶ added in v0.4.0
func (*World) ResourceHasSpacestationTag ¶ added in v0.4.0
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 (*World) SetFaction ¶ added in v0.4.0
func (w *World) SetFaction(e Entity, arg Entity) (old FactionComponent, wasAdded bool)
func (*World) SetFactionResource ¶
func (*World) SetGravity ¶ added in v0.4.0
func (w *World) SetGravity(e Entity, arg float32) (old GravityComponent, wasAdded bool)
func (*World) SetGravityResource ¶
func (*World) SetName ¶ added in v0.4.0
func (w *World) SetName(e Entity, arg string) (old NameComponent, wasAdded bool)
func (*World) SetNameResource ¶
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 (*World) SetPositionResource ¶
func (w *World) SetPositionResource(c PositionComponent)
func (*World) SetPositionResourceFromValues ¶ added in v0.4.0
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 (*World) SetRotationResource ¶
func (w *World) SetRotationResource(c RotationComponent)
func (*World) SetRotationResourceFromValues ¶ added in v0.4.0
func (*World) SetRuledBy ¶ added in v0.4.0
func (w *World) SetRuledBy(e Entity, arg Entity) (old RuledByComponent, wasAdded bool)
func (*World) SetRuledByResource ¶
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 (*World) SetVelocityResource ¶
func (w *World) SetVelocityResource(c VelocityComponent)
func (*World) SetVelocityResourceFromValues ¶ added in v0.4.0
func (*World) TagWithEnemy ¶ added in v0.4.0
func (*World) TagWithPlanet ¶ added in v0.4.0
func (*World) TagWithSpaceship ¶ added in v0.4.0
func (*World) TagWithSpacestation ¶ added in v0.4.0
func (*World) UnlinkAlliedWith ¶ added in v0.4.0
func (*World) UnlinkChildOf ¶ added in v0.4.0
func (*World) UnlinkEats ¶ added in v0.4.0
func (*World) UnlinkGrows ¶ added in v0.4.0
func (*World) UnlinkLikes ¶ added in v0.4.0
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)
Source Files ¶
- builtin_components_names.go
- builtin_relationships_child_of.go
- builtin_relationships_is_a.go
- ecs_entities.go
- ecs_events.go
- ecs_sparse_set.go
- ecs_web.go
- ecs_web_templates_templ.go
- ecs_world.go
- example_components_directions.go
- example_components_gravities.go
- example_components_positions.go
- example_components_rotations.go
- example_components_velocities.go
- example_enums_directions.go
- example_relationships_eats.go
- example_relationships_grows.go
- example_relationships_likes.go
- example_tags_enemy.go
- queries_example_position_velocities.go
- xxx_components_docked_tos.go
- xxx_components_factions.go
- xxx_components_ruled_bys.go
- xxx_relationships_allied_withs.go
- xxx_tags_planet.go
- xxx_tags_spaceship.go
- xxx_tags_spacestation.go
Click to show internal directories.
Click to hide internal directories.