Documentation ¶ Index ¶ type Entity type EntityID func (e EntityID) ID() EntityID type System type World func (w *World) AddSystem(system System) func (w *World) NewEntity() EntityID func (w *World) RemoveEntity(id EntityID) func (w *World) Systems() []System func (w *World) Update(dt float64) Constants ¶ This section is empty. Variables ¶ This section is empty. Functions ¶ This section is empty. Types ¶ type Entity ¶ type Entity interface { ID() EntityID } type EntityID ¶ type EntityID = uint64 func (EntityID) ID ¶ func (e EntityID) ID() EntityID type System ¶ type System interface { // Update updates the system. It is invoked by the engine once every frame, // with dt being the duration since the previous update. Update(dt float64) // Remove removes the given entity from the system. Remove(id EntityID) } type World ¶ type World struct { // contains filtered or unexported fields } func (*World) AddSystem ¶ func (w *World) AddSystem(system System) AddSystem adds the given System to the World, sorted by priority. func (*World) NewEntity ¶ func (w *World) NewEntity() EntityID func (*World) RemoveEntity ¶ func (w *World) RemoveEntity(id EntityID) RemoveEntity removes the entity across all systems. func (*World) Systems ¶ func (w *World) Systems() []System Systems returns the list of Systems managed by the World. func (*World) Update ¶ func (w *World) Update(dt float64) Update updates each System managed by the World. It is invoked by the engine once every frame, with dt being the duration since the previous update. Source Files ¶ View all Source files entity.go system.go world.go Click to show internal directories. Click to hide internal directories.