using System;
using System.Collections.Generic;
using Microsoft.Xna.Framework.Graphics;
using Microsoft.Xna.Framework;

namespace GraphiXNA.ParticleSystems
{
    public class SteamParticleSystem : ParticleSystem
    {
        private ParticleEmitter steamEmitter = null;

        public ParticleEmitter SteamEmitter
        {
            get { return steamEmitter; }
        }
        public SteamParticleSystem(GraphicsDevice graphicsDevice)
            : base(graphicsDevice)
        {
            steamEmitter = new ParticleEmitter(graphicsDevice, 1024);
            steamEmitter.SetTexture(ResourceManager.GetCoronaTexture(GraphicsDevice));

            steamEmitter.Duration = TimeSpan.FromSeconds(0.5);
            steamEmitter.DurationRandomness = 1;
            steamEmitter.MinHorizontalVelocity = -2;
            steamEmitter.MaxHorizontalVelocity = 2f;
            steamEmitter.MinVerticalVelocity = -2.0f;
            steamEmitter.MaxVerticalVelocity = 2.0f;
            steamEmitter.MinColor = new Color(255, 255, 255, 20);
            steamEmitter.MaxColor = new Color(255, 255, 255, 40);
            steamEmitter.MinStartSize = 0.0f;
            steamEmitter.MaxStartSize = 0.0f;

            steamEmitter.MinEndSize = 1.0f;
            steamEmitter.MaxEndSize = 4.0f;
            steamEmitter.Gravity = new Vector3(0, 10, 0);

            steamEmitter.SourceBlend = Blend.SourceAlpha;
            steamEmitter.DestinationBlend = Blend.InverseSourceAlpha;
        }

        internal override void InternalDraw()
        {
            steamEmitter.Draw();
        }
    }
}
