AngryTanks.Client.LocalPlayer.CheckShots C# (CSharp) Method

CheckShots() private method

private CheckShots ( GameTime gameTime ) : void
gameTime Microsoft.Xna.Framework.GameTime
return void
        private void CheckShots(GameTime gameTime)
        {
            IWorldObject collidingObject;

            List<Shot> activeShots = World.PlayerManager.AllActiveShots;
            activeShots.RemoveAll(s => s.Player == this);
            activeShots.RemoveAll(s => s.State != ShotState.Active);

            if (FindNearestCollision(activeShots.Cast<IWorldObject>().ToList(), out collidingObject))
            {
                // get the shot that killed us
                Shot shot = (Shot)collidingObject;

                // we shall die
                Die(shot.Player);

                // now end that shot
                shot.End(false, true);
            }
        }