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 ComponentType ¶
type ComponentType uint16
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
Click to show internal directories.
Click to hide internal directories.