public void Update(TimeSpan elapsed) { for (var i = 0; i < _collidables.Count; i++) { var collidable = _collidables[i]; for (var j = 0; j < _collidables.Count; j++) { var otherCollidable = _collidables[j]; if (IsCollisionDetected(collidable, otherCollidable)) { OnCollisionDetected?.Invoke(this, collidable, otherCollidable); } } } }
public void OnCollision(CollisionEventArgs collisionInfo) { OnCollisionDetected?.Invoke(collisionInfo); }