MCPcopy Index your code
hub / github.com/EngoEngine/engo / EntityExists

Method EntityExists

common/render.go:306–314  ·  view source on GitHub ↗

EntityExists looks if the entity is already into the System's entities. It will return the index >= 0 of the object into de rs.entities or -1 if it could not be found.

(basic *ecs.BasicEntity)

Source from the content-addressed store, hash-verified

304
305// EntityExists looks if the entity is already into the System's entities. It will return the index >= 0 of the object into de rs.entities or -1 if it could not be found.
306func (rs *RenderSystem) EntityExists(basic *ecs.BasicEntity) int {
307 for index, entity := range rs.entities {
308 if entity.ID() == basic.ID() {
309 return index
310 }
311 }
312
313 return -1
314}
315
316// AddByInterface adds any Renderable to the render system. Any Entity containing a BasicEntity,RenderComponent, and SpaceComponent anonymously does this automatically
317func (rs *RenderSystem) AddByInterface(i ecs.Identifier) {

Callers 1

RemoveMethod · 0.95

Calls 1

IDMethod · 0.80

Tested by

no test coverage detected