engi

package
v0.0.0-...-e1c21c9 Latest Latest
Warning

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

Go to latest
Published: May 10, 2019 License: Zlib Imports: 0 Imported by: 32

Documentation

Index

Constants

View Source
const GenerationBits = 8
View Source
const GenerationMask = (1 << GenerationBits) - 1
View Source
const Ghost = Entity(0xFFFFFFFF)

An invalid entity

View Source
const IndexBits = 24
View Source
const IndexMask = (1 << IndexBits) - 1

Variables

This section is empty.

Functions

This section is empty.

Types

type CompTable

type CompTable interface {
}

Component Table

type Component

type Component interface {
}

Components

type ComponentType

type ComponentType uint16

type Entity

type Entity uint32

func (Entity) Gene

func (e Entity) Gene() uint8

func (Entity) Index

func (e Entity) Index() uint32

type EntityManager

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

要不要用一个数组来管理所有的 Entity-Id 索引? 好处是可以方便的跟踪游戏整个生命周期中产生的所有对象. 同时需要一个 FreeList 来记录所有的对象.

func NewEntityManager

func NewEntityManager() *EntityManager

func (*EntityManager) Alive

func (em *EntityManager) Alive(e Entity) bool

func (*EntityManager) Destroy

func (em *EntityManager) Destroy(e Entity)

func (*EntityManager) New

func (em *EntityManager) New() Entity

type System

type System interface {
}

System

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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