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)
| 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. |
| 306 | func (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 |
| 317 | func (rs *RenderSystem) AddByInterface(i ecs.Identifier) { |