MoodSwingGame.MSChangeableBuilding.Update C# (CSharp) Method

Update() public method

public Update ( GameTime gameTime ) : void
gameTime Microsoft.Xna.Framework.GameTime
return void
        public override void Update(GameTime gameTime)
        {
            timeCount = 0;
            if (State == MSChangeableBuildingState.TRANSFORMING)
            {
                timeCount = gameTime.TotalGameTime.TotalSeconds - startTime;

                for (int i = 0; i < MSSmokePlumeParticleSystem.THICKNESS / 5; i++)
                {
                    Vector3 min = BoundingBox.Min;
                    Vector3 max = boundingBox.Max;
                    (Game as MoodSwing).SmokeParticles.AddParticle(
                        new Vector3(min.X,
                                    MathHelper.Lerp(min.Y, max.Y, MSRandom.Instance.GetUniform()),
                                    MathHelper.Lerp(min.Z, max.Z, MSRandom.Instance.GetUniform())),
                        new Vector3(0, 0, 5));
                    (Game as MoodSwing).SmokeParticles.AddParticle(
                        new Vector3(MathHelper.Lerp(min.X, max.X, MSRandom.Instance.GetUniform()),
                                    min.Y,
                                    MathHelper.Lerp(min.Z, max.Z, MSRandom.Instance.GetUniform())),
                        new Vector3(0, 0, 5));
                    (Game as MoodSwing).SmokeParticles.AddParticle(
                        new Vector3(max.X,
                                    MathHelper.Lerp(min.Y, max.Y, MSRandom.Instance.GetUniform()),
                                    MathHelper.Lerp(min.Z, max.Z, MSRandom.Instance.GetUniform())),
                        new Vector3(0, 0, 5));
                    (Game as MoodSwing).SmokeParticles.AddParticle(
                        new Vector3(MathHelper.Lerp(min.X, max.X, MSRandom.Instance.GetUniform()),
                                    max.Y,
                                    MathHelper.Lerp(min.Z, max.Z, MSRandom.Instance.GetUniform())),
                        new Vector3(0, 0, 5));
                    (Game as MoodSwing).SmokeParticles.AddParticle(
                        new Vector3(MathHelper.Lerp(min.X, max.X, MSRandom.Instance.GetUniform()),
                                    MathHelper.Lerp(min.Y, max.Y, MSRandom.Instance.GetUniform()),
                                    min.Z),
                        new Vector3(0, 0, 5));
                }

                if (timeCount >= buildTime) State = MSChangeableBuildingState.DONE;
            }
            base.Update(gameTime);
        }