Remove removes an entity from the MouseSystem.
(basic ecs.BasicEntity)
| 168 | |
| 169 | // Remove removes an entity from the MouseSystem. |
| 170 | func (m *MouseSystem) Remove(basic ecs.BasicEntity) { |
| 171 | var delete = -1 |
| 172 | for index, entity := range m.entities { |
| 173 | if entity.ID() == basic.ID() { |
| 174 | delete = index |
| 175 | break |
| 176 | } |
| 177 | } |
| 178 | if delete >= 0 { |
| 179 | m.entities = append(m.entities[:delete], m.entities[delete+1:]...) |
| 180 | } |
| 181 | } |
| 182 | |
| 183 | // Update updates all the entities in the MouseSystem. |
| 184 | func (m *MouseSystem) Update(dt float32) { |