PGCGame.Ship.Update C# (CSharp) Method

Update() public method

public Update ( GameTime gt ) : void
gt GameTime
return void
        public virtual void Update(GameTime gt)
        {
            if (shipState != ShipState.Dead && shipState != ShipState.Exploding)
            {
                base.Update();
                _timeDead = TimeSpan.Zero;

                angleVector = (Rotation.Radians + toEngineAngle).AngleToVector();
                angleVector.Normalize();
                engine.PositionOffset = angleVector * toEngineLength;
                engine.Update(gt);

                if (WorldCoords.X < 0 || WorldCoords.X >= StateManager.WorldSize.Width || WorldCoords.Y <= 0 || WorldCoords.Y >= StateManager.WorldSize.Height)
                {
                    //"Void" effect
                    CurrentHealth--;
                }

                if (_isFirstUpdate)
                {
                    CurrentHealth = InitialHealth;
                    UpdateWcPos();
                    _isFirstUpdate = false;
                }

                if (CurrentHealth <= 0)
                {
                    shipState = ShipState.Dead;
                    if (StateManager.Options.SFXEnabled && ShipState == CoreTypes.ShipState.Exploding)
                    {
                        ExplosionSFX.Play();
                    }
                    if (PlayerType == CoreTypes.PlayerType.Enemy || PlayerType == CoreTypes.PlayerType.Solo)
                    {
                        //Done in DrawNonAuto() ?!?!?!?
                        //StateManager.EnemyShips.Remove(this);
                    }
                    else
                    {
                        //This code isn't called consistently
                        if (PlayerType == CoreTypes.PlayerType.MyShip)
                        {
                            StateManager.AllyBullets.Legit.Clear();
                            StateManager.AllyBullets.Dud.Clear();
                            StateManager.EnemyBullets.Legit.Clear();
                            StateManager.EnemyBullets.Dud.Clear();
                        }
                        //Done in DrawNonAuto() ?!?!?!?
                        //StateManager.AllyShips.Remove(this);
                    }
                }

                _healthBar.Denominator = InitialHealth;
                _healthBar.Value = CurrentHealth;
            }
            else
            {
                _timeDead += gt.ElapsedGameTime;
            }
        }