entity

package
v0.0.0-...-a6bf7df Latest Latest
Warning

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

Go to latest
Published: Jun 13, 2022 License: Unlicense Imports: 1 Imported by: 0

Documentation

Index

Constants

View Source
const MaxEntities = 10000

MaxEntities is the total amount of living entities allowed in the game world.

Variables

This section is empty.

Functions

This section is empty.

Types

type Entity

type Entity int

Entity is a reference to an object in the game world and a list of it's components.

type EntityManager

type EntityManager interface {
	// Create will reserve an unused entity ID and update the current total of
	// all living objects.
	Create() Entity

	// Destroy will remove the entity from the current living set and free it's
	// ID up for use by another entity later on, if necessary.
	Destroy(entity Entity)

	// Sign adds a component signature to the given entity ID.
	Sign(entity Entity, signature *bitset.BitSet)

	// Read will provide the given entity's component signature.
	Read(entity Entity) *bitset.BitSet

	// Living will return the number of currently active objects in the game world.
	Living() int
}

EntityManager describes all available methods that a user can call to operate on the game world objects.

func CreateEntityManager

func CreateEntityManager() EntityManager

CreateEntityManager will new up an instance of an entity manager which is responsible for creating, and destroying objects in the game world.

Jump to

Keyboard shortcuts

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