Пример #1
0
        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();
        }
Пример #2
0
 private void ShotOnCollision(object sender, ShotCollisionEventArgs e)
 {
     OnShotCollision?.Invoke(sender, e);
 }