entity

package
v1.3.6 Latest Latest
Warning

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

Go to latest
Published: Mar 19, 2023 License: CC0-1.0, MIT Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Null = Entity(0)

Null represents a invalid entity.

Functions

This section is empty.

Types

type Entity

type Entity uint64

Entity is identifier of an entity. The first 32 bits are the entity id. The last 32 bits are the version. The version is incremented when the entity is destroyed.

func NewEntity

func NewEntity(id EntityId) Entity

NewEntity creates a new entity. The id is a unique identifier for the entity. To reuse the id, the id should be passed from the world that created the entity.

func (Entity) Id

func (e Entity) Id() EntityId

Id returns the entity id.

func (Entity) IncVersion

func (e Entity) IncVersion() Entity

IncVersion increments the entity version.

func (Entity) String added in v1.2.9

func (e Entity) String() string

func (Entity) Version

func (e Entity) Version() uint32

Version returns the entity version.

type EntityId

type EntityId uint32

EntityId is a unique identifier for an entity.

Jump to

Keyboard shortcuts

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