private void ShotCollision(object sender, CollisionEventArgs e) { if (e.OtherEntity(this) is Player) { return; } if (e.OtherEntity(this) is Shot) { return; } ShotCollisionEventArgs args = new ShotCollisionEventArgs { Shot = this, OtherEntity = e.OtherEntity(this) }; OnShotCollision?.Invoke(this, args); this.DestroyEntity(); }
private void ShotOnCollision(object sender, ShotCollisionEventArgs e) { OnShotCollision?.Invoke(sender, e); }