當前位置: 首頁>>代碼示例>>Golang>>正文


Golang BasicEntity.ID方法代碼示例

本文整理匯總了Golang中engo/io/ecs.BasicEntity.ID方法的典型用法代碼示例。如果您正苦於以下問題:Golang BasicEntity.ID方法的具體用法?Golang BasicEntity.ID怎麽用?Golang BasicEntity.ID使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在engo/io/ecs.BasicEntity的用法示例。


在下文中一共展示了BasicEntity.ID方法的8個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Golang代碼示例。

示例1: Remove

func (a *AnimationSystem) Remove(basic ecs.BasicEntity) {
	delete := -1
	for index, e := range a.entities {
		if e.BasicEntity.ID() == basic.ID() {
			delete = index
			break
		}
	}
	if delete >= 0 {
		a.entities = append(a.entities[:delete], a.entities[delete+1:]...)
	}
}
開發者ID:matiwinnetou,項目名稱:engi,代碼行數:12,代碼來源:animation.go

示例2: Remove

func (s *ScaleSystem) Remove(basic ecs.BasicEntity) {
	delete := -1
	for index, e := range s.entities {
		if e.BasicEntity.ID() == basic.ID() {
			delete = index
			break
		}
	}
	if delete >= 0 {
		s.entities = append(s.entities[:delete], s.entities[delete+1:]...)
	}
}
開發者ID:matiwinnetou,項目名稱:engi,代碼行數:12,代碼來源:scale.go

示例3: Remove

func (c *CollisionSystem) Remove(basic ecs.BasicEntity) {
	delete := -1
	for index, e := range c.entities {
		if e.BasicEntity.ID() == basic.ID() {
			delete = index
			break
		}
	}
	if delete >= 0 {
		c.entities = append(c.entities[:delete], c.entities[delete+1:]...)
	}
}
開發者ID:matiwinnetou,項目名稱:engi,代碼行數:12,代碼來源:collision.go

示例4: Remove

func (b *BounceSystem) Remove(basic ecs.BasicEntity) {
	delete := -1
	for index, e := range b.entities {
		if e.BasicEntity.ID() == basic.ID() {
			delete = index
			break
		}
	}
	if delete >= 0 {
		b.entities = append(b.entities[:delete], b.entities[delete+1:]...)
	}
}
開發者ID:matiwinnetou,項目名稱:engi,代碼行數:12,代碼來源:pong.go

示例5: Remove

func (f *FallingSystem) Remove(basic ecs.BasicEntity) {
	delete := -1
	for index, e := range f.entities {
		if e.BasicEntity.ID() == basic.ID() {
			delete = index
			break
		}
	}
	if delete >= 0 {
		f.entities = append(f.entities[:delete], f.entities[delete+1:]...)
	}
}
開發者ID:matiwinnetou,項目名稱:engi,代碼行數:12,代碼來源:falling.go

示例6: Remove

func (h *HideSystem) Remove(basic ecs.BasicEntity) {
	delete := -1
	for index, e := range h.entities {
		if e.BasicEntity.ID() == basic.ID() {
			delete = index
			break
		}
	}
	if delete >= 0 {
		h.entities = append(h.entities[:delete], h.entities[delete+1:]...)
	}
}
開發者ID:matiwinnetou,項目名稱:engi,代碼行數:12,代碼來源:hide.go

示例7: Remove

func (m *MouseSystem) Remove(basic ecs.BasicEntity) {
	var delete int = -1
	for index, entity := range m.entities {
		if entity.ID() == basic.ID() {
			delete = index
			break
		}
	}
	if delete >= 0 {
		m.entities = append(m.entities[:delete], m.entities[delete+1:]...)
	}
}
開發者ID:matiwinnetou,項目名稱:engi,代碼行數:12,代碼來源:mouse.go

示例8: Remove

func (rs *RenderSystem) Remove(basic ecs.BasicEntity) {
	var delete int = -1
	for index, entity := range rs.entities {
		if entity.ID() == basic.ID() {
			delete = index
			break
		}
	}
	if delete >= 0 {
		rs.entities = append(rs.entities[:delete], rs.entities[delete+1:]...)
		rs.sortingNeeded = true
	}
}
開發者ID:matiwinnetou,項目名稱:engi,代碼行數:13,代碼來源:render.go


注:本文中的engo/io/ecs.BasicEntity.ID方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。