A System implements logic for processing entities possessing components of the same aspects as the system. A System should iterate over its Entities on `Update`, in any way suitable for the current implementation. By convention, systems provide an Add method for adding entities and their associated
| 9 | // |
| 10 | // Add(basic *ecs.BasicEntity, collision *CollisionComponent, space *SpaceComponent) |
| 11 | type System interface { |
| 12 | // Update updates the system. It is invoked by the engine once every frame, |
| 13 | // with dt being the duration since the previous update. |
| 14 | Update(dt float32) |
| 15 | |
| 16 | // Remove removes the given entity from the system. |
| 17 | Remove(e BasicEntity) |
| 18 | } |
| 19 | |
| 20 | // SystemAddByInterfacer is a system that also implements the AddByInterface method |
| 21 | type SystemAddByInterfacer interface { |
no outgoing calls
no test coverage detected
searching dependent graphs…