//------------------------------------------------------------------------------
// <auto-generated>
//     This code was generated by a tool.
//     Runtime Version:2.0.50727.42
//
//     Changes to this file may cause incorrect behavior and will be lost if
//     the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------

using System;
using System.Xml;
using System.Xml.Serialization;
using System.ComponentModel;
using System.Collections.Generic;
using System.Drawing;
using System.IO;

using EditorCore;

// 
// This source code was auto-generated by xsd, Version=2.0.50727.42.
// 
namespace ParticleSystem
{
   /// <remarks/>
   [System.CodeDom.Compiler.GeneratedCodeAttribute("xsd", "2.0.50727.42")]
   [System.SerializableAttribute()]
   [System.Diagnostics.DebuggerStepThroughAttribute()]
   [System.ComponentModel.DesignerCategoryAttribute("code")]
   [System.Xml.Serialization.XmlTypeAttribute(AnonymousType = true)]
   [System.Xml.Serialization.XmlRootAttribute(Namespace = "", IsNullable = false)]
   public partial class ParticleEffect
   {

      public ParticleEffect()
      {
         particleEmitterField = new List<ParticleEmitter>();
         nameField = "Untitled";
      }
      private List<ParticleEmitter> particleEmitterField;
      private string nameField;
      
      //-- This function needs to be called to fixup data that the game understands right before
      //-- we serialize to XML
      public void preSerialization()
      {
         for (int i = 0; i < Emitters.Count; ++i)
         {
            Emitters[i].preSerialization();
         }
      }

      //-- This function needs to be called to fixup data so that the game data can be converted so that
      //-- the understands the values stored in XML
      public void postDeserialization()
      {
         for (int i = 0; i < Emitters.Count; ++i)
         {
            Emitters[i].postDeserialization();
         }
      }

      /// <remarks/>
      [System.Xml.Serialization.XmlElementAttribute("ParticleEmitter")]
      public List<ParticleEmitter> Emitters
      {
         get { return this.particleEmitterField;  }
         set { this.particleEmitterField = value; }
      }

      /// <remarks/>
      [System.Xml.Serialization.XmlAttributeAttribute()]
      public string Name
      {
         get { return this.nameField;  }
         set { this.nameField = value; }
      }

      public void addEmitter(string name)
      {
         ParticleEmitter newEmitter = new ParticleEmitter();
         newEmitter.Name = name;
         newEmitter.postDeserialization();
         Emitters.Add(newEmitter);
      }

      public void addEmitterAt(int index, ParticleEmitter e)
      {
         Emitters.Insert(index, e);
      }

      public void deleteEmitter(int index)
      {
         if (index < 0 || index >= Emitters.Count)
            return;
         Emitters.RemoveAt(index);
      }
   }

   /// <remarks/>
   [System.CodeDom.Compiler.GeneratedCodeAttribute("xsd", "2.0.50727.42")]
   [System.SerializableAttribute()]
   [System.Diagnostics.DebuggerStepThroughAttribute()]
   [System.ComponentModel.DesignerCategoryAttribute("code")]
   [System.Xml.Serialization.XmlTypeAttribute(AnonymousType = true)]
   public partial class ParticleEmitter
   {
      public ParticleEmitter()
      {
         emitterField = new EmitterData();
         shapeField = new ShapeData();
         texturesField = new TextureData();
         opacityField = new FloatProgressionData();
         scaleField = new VectorProgressionData();
         speedField = new VectorProgressionData();
         intensityField = new FloatProgressionData();
         colorField = new ColorData();
         forcesField = new ForceData();
         magnetField = new List<MagnetData>();
      }

      public ParticleEmitter clone()
      {
         ParticleEmitter clone = new ParticleEmitter();
         clone.Emitter = Emitter.clone();
         clone.Shape = Shape.clone();
         clone.Textures = Textures.clone();
         clone.Color = Color.clone();
         clone.Opacity = Opacity.clone();
         clone.Scale = Scale.clone();
         clone.Speed = Speed.clone();
         clone.Intensity = Intensity.clone();
         clone.Forces = Forces.clone();
         clone.Name = Name;
         clone.Active = Active;

         clone.Magnets.Clear();
         for (int i = 0; i < Magnets.Count; ++i)
         {
            clone.Magnets.Add(Magnets[i].clone());
         }         
         return clone;
      }

      private EmitterData emitterField;
      private ShapeData shapeField;
      private TextureData texturesField;
      private FloatProgressionData opacityField;
      private VectorProgressionData scaleField;
      private VectorProgressionData speedField;
      private FloatProgressionData intensityField;
      private ColorData colorField;
      private ForceData forcesField;
      private string nameField;
      private bool activeField;
      private List<MagnetData> magnetField;

      public void preSerialization()
      {
         Emitter.preSerialization();
         Shape.preSerialization();
         Textures.preSerialization();
         Opacity.preSerialization();
         Scale.preSerialization();
         Speed.preSerialization();
         Intensity.preSerialization();
         Color.preSerialization();
         Forces.preSerialization();

         for (int i = 0; i < Magnets.Count; ++i)
         {
            Magnets[i].preSerialization();
         }
      }

      public void postDeserialization()
      {
         Emitter.postDeserialization();
         Shape.postDeserialization();
         Textures.postDeserialization();
         Opacity.postDeserialization();
         Scale.postDeserialization();
         Speed.postDeserialization();
         Intensity.postDeserialization();
         Color.postDeserialization();
         Forces.postDeserialization();

         for (int i = 0; i < Magnets.Count; ++i)
         {
            Magnets[i].postDeserialization();
         }
      }

      public void addMagnet(string name)
      {
         MagnetData newMagnet = new MagnetData();
         newMagnet.Name = name;
         newMagnet.postDeserialization();
         Magnets.Add(newMagnet);
      }

      public void addMagnetAt(int index, MagnetData e)
      {
         Magnets.Insert(index, e);
      }

      public void deleteMagnet(int index)
      {
         if (index < 0 || index >= Magnets.Count)
            return;
         Magnets.RemoveAt(index);
      }

      /// <remarks/>
      [XmlElement("EmitterData")]
      public EmitterData Emitter
      {
         get { return this.emitterField; }
         set { this.emitterField = value;}
      }

      /// <remarks/>
      [XmlElement("ShapeData")]
      public ShapeData Shape
      {
         get { return this.shapeField;  }
         set { this.shapeField = value; }
      }

      /// <remarks/>
      [XmlElement("TextureData")]
      public TextureData Textures
      {
         get { return this.texturesField;  }
         set { this.texturesField = value; }
      }

      /// <remarks/>
      [XmlElement("ColorData")]
      public ColorData Color
      {
         get { return this.colorField; }
         set { this.colorField = value; }
      }

      /// <remarks/>
      [XmlElement("OpacityData")]
      public FloatProgressionData Opacity
      {
         get { return this.opacityField;  }
         set { this.opacityField = value; }
      }

      /// <remarks/>
      [XmlElement("ScaleData")]
      public VectorProgressionData Scale
      {
         get { return this.scaleField;  }
         set { this.scaleField = value; }
      }

      /// <remarks/>
      [XmlElement("SpeedData")]
      public VectorProgressionData Speed
      {
         get { return this.speedField;  }
         set { this.speedField = value; }
      }

      /// <remarks/>
      [XmlElement("IntensityData")]
      public FloatProgressionData Intensity
      {
         get { return this.intensityField;  }
         set { this.intensityField = value; }
      }
      
      /// <remarks/>
      [XmlElement("ForceData")]
      public ForceData Forces
      {
         get { return this.forcesField;  }
         set { this.forcesField = value; }
      }

      /// <remarks/>
      [System.Xml.Serialization.XmlAttributeAttribute()]
      public string Name
      {
         get { return this.nameField;  }
         set { this.nameField = value; }
      }

      /// <remarks/>
      [System.Xml.Serialization.XmlAttributeAttribute()]
      public bool Active
      {
         get { return this.activeField;  }
         set { this.activeField = value; }
      }

      [System.Xml.Serialization.XmlElementAttribute("ParticleMagnet")]
      public List<MagnetData> Magnets
      {
         get { return this.magnetField; }
         set { this.magnetField = value; }
      }
   }

   /// <remarks/>
   [System.CodeDom.Compiler.GeneratedCodeAttribute("xsd", "2.0.50727.42")]
   [System.SerializableAttribute()]
   [System.Diagnostics.DebuggerStepThroughAttribute()]
   [System.ComponentModel.DesignerCategoryAttribute("code")]
   [System.Xml.Serialization.XmlTypeAttribute(AnonymousType = true)]
   public partial class EmitterData
   {
      public EmitterData()         
      {
         TiedToEmitter = false;
         IgnoreRotation = false;
         Loop = false;
         AlwaysActive = false;
         AlwaysRender = false;
         MaxParticles = 1000;
         ParticleType = EmitterData.EmitterParticleTypeEnum.eBillBoard;
         BlendMode = EmitterData.EmitterBlendModeEnum.eAlphaBlend;
         UpdateRadius = 10.0f;

         MaxParticlesVar = 0.0f;
         ParticleLife = 1.0f;
         ParticleLifeVar = 0.0f;
         GlobalFadeIn = 0.0f;
         GlobalFadeInVar = 0.0f;
         GlobalFadeOut = 0.0f;
         GlobalFadeOutVar = 0.0f;

         EmissionRate = 50.0f;
         EmissionRateVar = 0.0f;
         StartDelay = 0.0f;
         StartDelayVar = 0.0f;
         InitialUpdate = 0.0f;
         InitialUpdateVar = 0.0f;

         EmissionTime = 10.0f;
         EmissionTimeVar = 0.0f;
         LoopDelay = 0.0f;
         LoopDelayVar = 0.0f;
         InitialDistance = 0.0f;
         InitialDistanceVar = 0.0f;

         Velocity = 1.0f;
         VelocityVar = 0.0f;
         Acceleration = 0.0f;
         AccelerationVar = 0.0f;

         TrailSegmentLength = 0.5f;

         EmitterAttraction = 1.0f;
         EmitterAttractionVar = 0.0f;

         BeamAlignmentType = EmitterData.EmitterBeamAlignmentType.eBeamAlignToCamera;
         BeamTesselation = 1;
         BeamTangent1X = 0.0f;
         BeamTangent1Y = 0.0f;
         BeamTangent1Z = 0.0f;

         BeamTangent2X = 0.0f;
         BeamTangent2Y = 0.0f;
         BeamTangent2Z = 0.0f;
         
         BeamOpacityByLength = false;
         BeamColorByLength = false;
         BeamIntensityByLength = false;

         CollisionDetectionTerrain = false;
         CollisionEnergyLoss = 0.0f;
         CollisionEnergyLossVar = 0.0f;
         CollisionOffset = 0.0f;

         TerrainDecalYOffset = 0.125f;
         TerrainDecalTesselation = 4.0f;

         SoftParticles = false;
         SoftParticleFadeRange = 0.5f;

         LightBuffer = true;
         LightBufferIntensityScale = 1.0f;
      }

      public EmitterData clone()
      {
         EmitterData clone = new EmitterData();

         clone.TiedToEmitter = TiedToEmitter;
         clone.IgnoreRotation = IgnoreRotation;
         clone.Loop = Loop;
         clone.AlwaysActive = AlwaysActive;
         clone.AlwaysRender = AlwaysRender;
         clone.MaxParticles = MaxParticles;
         clone.MaxParticlesVar = MaxParticlesVar;
         clone.ParticleType = ParticleType;
         clone.BlendMode = BlendMode;
         clone.UpdateRadius = UpdateRadius;
         clone.ParticleLife = ParticleLife;
         clone.ParticleLifeVar = ParticleLifeVar;
         clone.GlobalFadeIn = GlobalFadeIn;
         clone.GlobalFadeInVar = GlobalFadeInVar;
         clone.GlobalFadeOut = GlobalFadeOut;
         clone.GlobalFadeOutVar = GlobalFadeOutVar;
         clone.EmissionRate = EmissionRate;
         clone.EmissionRateVar = EmissionRateVar;
         clone.StartDelay = StartDelay;
         clone.StartDelayVar = StartDelayVar;
         clone.InitialUpdate = InitialUpdate;
         clone.InitialUpdateVar =InitialUpdateVar;
         clone.EmissionTime =EmissionTime;
         clone.EmissionTimeVar =EmissionTimeVar;
         clone.LoopDelay =LoopDelay;
         clone.LoopDelayVar =LoopDelayVar;
         clone.InitialDistance =InitialDistance;
         clone.InitialDistanceVar =InitialDistanceVar;
         clone.Velocity =Velocity;
         clone.VelocityVar =VelocityVar;
         clone.Acceleration =Acceleration;
         clone.AccelerationVar =AccelerationVar;
         clone.TrailEmissionType =TrailEmissionType;
         clone.TrailUVType =TrailUVType;
         clone.TrailSegmentLength =TrailSegmentLength;
         clone.EmitterAttraction =EmitterAttraction;
         clone.EmitterAttractionVar = EmitterAttractionVar;

         clone.BeamAlignmentType = BeamAlignmentType;
         clone.BeamTesselation = BeamTesselation;
         clone.BeamTangent1X = BeamTangent1X;
         clone.BeamTangent1Y = BeamTangent1Y;
         clone.BeamTangent1Z = BeamTangent1Z;

         clone.BeamTangent2X = BeamTangent2X;
         clone.BeamTangent2Y = BeamTangent2Y;
         clone.BeamTangent2Z = BeamTangent2Z;

         clone.BeamColorByLength = BeamColorByLength;
         clone.BeamOpacityByLength = BeamOpacityByLength;         
         clone.BeamIntensityByLength = BeamIntensityByLength;

         clone.PFXFilePath = PFXFilePath;
         clone.CollisionDetectionTerrain = CollisionDetectionTerrain;
         clone.CollisionEnergyLoss = CollisionEnergyLoss;
         clone.CollisionEnergyLossVar = CollisionEnergyLossVar;
         clone.CollisionOffset = CollisionOffset;

         clone.TerrainDecalTesselation = TerrainDecalTesselation;
         clone.TerrainDecalYOffset = TerrainDecalYOffset;
         clone.SoftParticleFadeRange = SoftParticleFadeRange;
         clone.SoftParticles = SoftParticles;

         clone.LightBuffer = LightBuffer;
         clone.LightBufferIntensityScale = LightBufferIntensityScale;
         
         return clone;
      }

      public void preSerialization()
      {
         MaxParticlesVar /= 100.0f;
         ParticleLifeVar /= 100.0f;
         GlobalFadeInVar /= 100.0f;
         GlobalFadeOutVar /= 100.0f;
         EmissionRateVar  /= 100.0f;
         StartDelayVar /= 100.0f;
         InitialUpdateVar /= 100.0f;
         EmissionTimeVar /= 100.0f;
         LoopDelayVar /= 100.0f;
         InitialDistanceVar /= 100.0f;
         VelocityVar /= 100.0f;
         AccelerationVar /= 100.0f;

         EmitterAttraction /= 100.0f;
         EmitterAttractionVar /= 100.0f;

         CollisionEnergyLoss /= 100.0f;
         CollisionEnergyLossVar /= 100.0f;
      }

      public void postDeserialization()
      {
         MaxParticlesVar *= 100.0f;
         ParticleLifeVar *= 100.0f;
         GlobalFadeInVar *= 100.0f;
         GlobalFadeOutVar *= 100.0f;
         EmissionRateVar *= 100.0f;
         StartDelayVar *= 100.0f;
         InitialUpdateVar *= 100.0f;
         EmissionTimeVar *= 100.0f;
         LoopDelayVar *= 100.0f;
         InitialDistanceVar *= 100.0f;
         VelocityVar *= 100.0f;
         AccelerationVar *= 100.0f;

         EmitterAttraction *= 100.0f;
         EmitterAttractionVar *= 100.0f;

         CollisionEnergyLoss *= 100.0f;
         CollisionEnergyLossVar *= 100.0f;
      }

      public enum EmitterParticleTypeEnum
      {
         eBillBoard = 0,
         eOrientedAxialBillboard,
         eUpfacing,
         eTrail,
         eTrailCross,
         eBeam,
         eVelocityAligned,
         ePFX,
         eTerrainPatch,
         eTypeTotal
      };

      public enum EmitterBlendModeEnum
      {
         eAlphaBlend = 0,
         eAdditive,
         eSubtractive,
         eDistortion,
         ePremultipliedAlpha,
         eBlendModeToal
      };

      public enum EmitterTrailUVType
      {
         eStretch = 0,
         eFaceMap,
         eTrailUVTypeTotal
      };

      public enum EmitterTrailEmissionType
      {
         eEmitByLength,
         eEmitByTime,
         eTrailEmissionTypeTotal         
      };

      public enum EmitterBeamAlignmentType
      {
         eBeamAlignToCamera,
         eBeamAlignVertical,
         eBeamAlignHorizontal,
         eBeamAlignTypeTotal
      };

      private bool   tiedToEmitterField;
      private bool   ignoreRotationField;      
      private bool   loopField;
      private bool   alwaysActiveField;
      private bool   alwaysRenderField;
      private int    maxParticlesField;
      private EmitterParticleTypeEnum particleTypeField = new EmitterParticleTypeEnum();
      private EmitterBlendModeEnum blendMode = new EmitterBlendModeEnum();
      
      private double updateRadiusField;
      private double maxParticlesVarField;

      private double particleLifeField;
      private double particleLifeVarField;
      private double globalFadeInField;
      private double globalFadeInVarField;
      private double globalFadeOutField;
      private double globalFadeOutVarField;

      private double emissionRateField;
      private double emissionRateVarField;
      private double startDelayField;
      private double startDelayVarField;
      private double initialUpdateField;
      private double initialUpdateVarField;
      private double emissionTimeField;
      private double emissionTimeVarField;
      private double loopDelayField;
      private double loopDelayVarField;
      private double initialDistanceField;
      private double initialDistanceVarField;
      private double velocityField;
      private double velocityVarField;
      private double accelerationField;
      private double accelerationVarField;

      private double terraindecalTesselationField;
      private double terraindecalYOffsetField;

      private double softParticleFadeRangeField;

      private EmitterTrailEmissionType trailEmissionTypeField;
      private EmitterTrailUVType trailUVTypeField;      
      private double trailSegmentLength;

      private double emitterAttractionField;
      private double emitterAttractionVarField;

      private EmitterBeamAlignmentType beamAlignmentTypeField;
      private int    beamTesselationField;
      private double beamTangent1XField;
      private double beamTangent1YField;
      private double beamTangent1ZField;
      private double beamTangent2XField;
      private double beamTangent2YField;
      private double beamTangent2ZField;      
      private bool   beamOpacityByLengthField;
      private bool   beamColorByLengthField;
      private bool   beamIntensityByLengthField;

      private string pfxFilePathField;

      private bool   collisionDetectionTerrainField;
      private double collisionEnergyLossField;
      private double collisionEnergyLossVarField;
      private double collisionOffsetField;

      private bool   softParticlesField;
      private bool   sortParticlesField;
      private bool   fillOptimizedField;
      private bool   lightBufferField;
      private double lightBufferIntensityScaleField;
      private bool   killImmediatelyOnReleaseField;

      
      /// <remarks/>
      [Description("Forces the particles to inherit the emitter transformation"), Category("Base")]
      public bool TiedToEmitter
      {
         get { return this.tiedToEmitterField;  }
         set { this.tiedToEmitterField = value; }
      }

      /// <remarks/>
      [Description("Disables Rotational Transformation of the Emitter"), Category("Base")]
      public bool IgnoreRotation
      {
         get { return this.ignoreRotationField;  }
         set { this.ignoreRotationField = value; }
      }
      
      /// <remarks/>
      [Description("Loops Emission Properties"), Category("Emission")]      
      public bool Loop
      {
         get { return this.loopField; }
         set { this.loopField = value;}
      }

      /// <remarks/>
      [Description("Emitter is always active"), Category("Base")]
      public bool AlwaysActive
      {
         get { return this.alwaysActiveField; }
         set { this.alwaysActiveField = value;}
      }

      public bool AlwaysRender
      {
         get { return this.alwaysRenderField; }
         set { this.alwaysRenderField = value; }
      }
      
      /// <remarks/>
      /// 
      [Description("Maximum Number of Particles this Emitter is allowed to have active at the same time"), Category("Base")]
      public int MaxParticles
      {
         get { return this.maxParticlesField;  } 
         set { this.maxParticlesField = value; }
      }

      [Description("Percentage Variance of the Max Particles Value"), Category("Base")]      
      public double MaxParticlesVar
      {
         get { return this.maxParticlesVarField;  }
         set { this.maxParticlesVarField = value; }
      }


      /// <remarks/>
      /// 
      [Description("Type of Particles emitted by this emitter"), Category("Appearance")]      
      public EmitterParticleTypeEnum ParticleType
      {
         get { return this.particleTypeField;  }
         set { this.particleTypeField = value; }
      }

      /// <remarks/>      
      public EmitterBlendModeEnum BlendMode
      {
         get { return this.blendMode; }
         set { this.blendMode = value; }
      }

      /// <remarks/>
      //[Description("Maximum Update radius for Emitter"), Category("Base")]      
      public double UpdateRadius
      {
         get { return this.updateRadiusField;  }
         set { this.updateRadiusField = value; }
      }

      /// <remarks/>
      
      /// <remarks/>
      [Description("Lifespan in seconds that each particle lives"), Category("Base")]      
      public double ParticleLife
      {
         get { return this.particleLifeField;  }
         set { this.particleLifeField = value; }
      }

      /// <remarks/>
      [Description("Variance of the Lifespan in seconds that each particle lives"), Category("Base")]      
      public double ParticleLifeVar
      {
         get { return this.particleLifeVarField;  }
         set { this.particleLifeVarField = value; }
      }

      /// <remarks/>
      /// 
      [Description("Global Fade In Time In Seconds for the Emitter"), Category("Base")]      
      public double GlobalFadeIn
      {
         get { return this.globalFadeInField;  }
         set { this.globalFadeInField = value; }
      }

      /// <remarks/>
      [Description("Variance of the Global Fade In Time in seconds for the Emitter"), Category("Base")]
      public double GlobalFadeInVar
      {
         get { return this.globalFadeInVarField;  }
         set { this.globalFadeInVarField = value; }
      }

      /// <remarks/>
      /// 
      [Description("Global Fade Out Time in seconds for the Emitter"), Category("Base")]
      public double GlobalFadeOut
      {
         get { return this.globalFadeOutField;  }
         set { this.globalFadeOutField = value; }
      }

      /// <remarks/>
      [Description("Variance of Global Fade Out Time in seconds for the Emitter"), Category("Base")]
      public double GlobalFadeOutVar
      {
         get { return this.globalFadeOutVarField;  }
         set { this.globalFadeOutVarField = value; }
      }

      
      /// <remarks/>
      /// 
      [Description("Emission Rate in Particles Per Second of the Emitter"), Category("Emission")]
      public double EmissionRate
      {
         get { return this.emissionRateField;  }
         set { this.emissionRateField = value; }
      }

      /// <remarks/>
      /// 
      [Description("Variance of Emission Rate in Particles Per Second of the Emitter"), Category("Emission")]
      public double EmissionRateVar
      {
         get { return this.emissionRateVarField;  }
         set { this.emissionRateVarField = value; }
      }

      /// <remarks/>
      /// 
      [Description("Start Delay in Seconds before the Emitter starts emission"), Category("Emission")]
      public double StartDelay
      {
         get { return this.startDelayField;  }
         set { this.startDelayField = value; }
      }

      /// <remarks/>
      /// 
      [Description("Variance of Emitter Start Delay"), Category("Emission")]
      public double StartDelayVar
      {
         get { return this.startDelayVarField;  }
         set { this.startDelayVarField = value; }
      }

      /// <remarks/>
      /// 
      [Description("Time In Seconds that the Emitter assumes has occurred on its first update"), Category("Emission")]
      public double InitialUpdate
      {
         get { return this.initialUpdateField;  }
         set { this.initialUpdateField = value; }
      }

      /// <remarks/>
      [Description("Variance of Initial Update Time"), Category("Emission")]
      public double InitialUpdateVar
      {
         get { return this.initialUpdateVarField;  }
         set { this.initialUpdateVarField = value; }
      }

      /// <remarks/>
      /// 
      [Description("Total Time in Seconds the Emitter is allowed to emit particles"), Category("Emission")]
      public double EmissionTime
      {
         get { return this.emissionTimeField;  }
         set { this.emissionTimeField = value; }
      }

      /// <remarks/>
      /// 
      [Description("Variance of Emission Time"), Category("Emission")]
      public double EmissionTimeVar
      {
         get { return this.emissionTimeVarField;  }
         set { this.emissionTimeVarField = value; }
      }

      /// <remarks/>
      [Description("Time in Seconds Emitter stops emitting particles between emission cycles"), Category("Emission")]
      public double LoopDelay
      {
         get { return this.loopDelayField;  }
         set { this.loopDelayField = value; }
      }

      [Description("Variance of Dormant Time"), Category("Emission")]
      public double LoopDelayVar
      {
         get { return this.loopDelayVarField;  }
         set { this.loopDelayVarField = value; }
      }

      /// <remarks/>
      /// 
      [Description("Initial Particle Distance away from Emitter a particle has moved when it gets spawned"), Category("Motion")]
      public double InitialDistance
      {
         get { return this.initialDistanceField;  }
         set { this.initialDistanceField = value; }
      }

      [Description("Variance of Initial Particle Distance"), Category("Motion")]
      public double InitialDistanceVar
      {
         get { return this.initialDistanceVarField;  }
         set { this.initialDistanceVarField = value; }
      }

      /// <remarks/>
      [Description("Starting Velocity of a Particle"), Category("Motion")]
      public double Velocity
      {
         get { return this.velocityField;  }
         set { this.velocityField = value; }
      }

      /// <remarks/>
      [Description("Variance of Starting Velocity of a Particle"), Category("Motion")]
      public double VelocityVar
      {
         get { return this.velocityVarField;  }
         set { this.velocityVarField = value; }
      }

      /// <remarks/>
      [Description("Acceleration of a Particle"), Category("Motion")]
      public double Acceleration
      {
         get { return this.accelerationField;  }
         set { this.accelerationField = value; }
      }

      /// <remarks/>
      [Description("Variance of Acceleration of a Particle"), Category("Motion")]
      public double AccelerationVar
      {
         get { return this.accelerationVarField;  }
         set { this.accelerationVarField = value; }
      }

      public EmitterTrailEmissionType TrailEmissionType
      {
         get { return this.trailEmissionTypeField; }
         set { this.trailEmissionTypeField = value; }
      }

      public EmitterTrailUVType TrailUVType
      {
         get { return this.trailUVTypeField; }
         set { this.trailUVTypeField = value; }
      }
   
      public double TrailSegmentLength
      {
         get { return this.trailSegmentLength; }
         set { this.trailSegmentLength = value; }
      }

      public double EmitterAttraction
      {
         get { return this.emitterAttractionField;  }
         set { this.emitterAttractionField = value; }
      }

      public double EmitterAttractionVar
      {
         get { return this.emitterAttractionVarField; }
         set { this.emitterAttractionVarField = value; }
      }

      public EmitterBeamAlignmentType BeamAlignmentType 
      {
         get { return beamAlignmentTypeField; }
         set { beamAlignmentTypeField = value; }         
      }

      public int BeamTesselation
      {
         get { return this.beamTesselationField;  }
         set { this.beamTesselationField = value; }
      }
      public double BeamTangent1X
      {
         get { return this.beamTangent1XField; }
         set { this.beamTangent1XField = value; }
      }

      public double BeamTangent1Y
      {
         get { return this.beamTangent1YField; }
         set { this.beamTangent1YField = value; }
      }

      public double BeamTangent1Z
      {
         get { return this.beamTangent1ZField; }
         set { this.beamTangent1ZField = value; }
      }

      public double BeamTangent2X
      {
         get { return this.beamTangent2XField; }
         set { this.beamTangent2XField = value; }
      }

      public double BeamTangent2Y
      {
         get { return this.beamTangent2YField; }
         set { this.beamTangent2YField = value; }
      }

      public double BeamTangent2Z
      {
         get { return this.beamTangent2ZField; }
         set { this.beamTangent2ZField = value; }
      }
      
      public bool BeamOpacityByLength
      {
         get { return this.beamOpacityByLengthField; }
         set { this.beamOpacityByLengthField = value; }
      }

      public bool BeamColorByLength
      {
         get { return this.beamColorByLengthField; }
         set { this.beamColorByLengthField = value; }
      }

      public bool BeamIntensityByLength
      {
         get { return this.beamIntensityByLengthField; }
         set { this.beamIntensityByLengthField = value; }
      }      

      public string PFXFilePath
      {
         get { return pfxFilePathField;  }
         set { pfxFilePathField = value; }
      }

      public bool CollisionDetectionTerrain
      {
         get { return collisionDetectionTerrainField; }
         set { collisionDetectionTerrainField = value; }
      }

      public double CollisionEnergyLoss
      {
         get { return collisionEnergyLossField; }
         set { collisionEnergyLossField = value; }
      }
      public double CollisionEnergyLossVar
      {
         get { return collisionEnergyLossVarField; }
         set { collisionEnergyLossVarField = value; }
      }

      public double CollisionOffset
      {
         get { return collisionOffsetField; }
         set { collisionOffsetField = value; }
      }

      public double TerrainDecalTesselation
      {
         get { return terraindecalTesselationField; }
         set { terraindecalTesselationField = value; }
      }
      public double TerrainDecalYOffset
      {
         get { return terraindecalYOffsetField; }
         set { terraindecalYOffsetField = value; }
      }

      public double SoftParticleFadeRange
      {
         get { return softParticleFadeRangeField; }
         set { softParticleFadeRangeField = value; }
      }

      public bool SoftParticles
      {
         get { return softParticlesField; }
         set { softParticlesField = value; }
      }
      
      public bool SortParticles
      {
         get { return sortParticlesField; }
         set { sortParticlesField = value; }
      }

      public bool FillOptimized
      {
         get { return fillOptimizedField; }
         set { fillOptimizedField = value; }
      }

      public bool LightBuffer
      {
         get { return lightBufferField; }
         set { lightBufferField = value; }
      }

      public double LightBufferIntensityScale
      {
         get { return lightBufferIntensityScaleField; }
         set { lightBufferIntensityScaleField = value; }
      }

      public bool KillImmediatelyOnRelease
      {
         get { return killImmediatelyOnReleaseField; }
         set { killImmediatelyOnReleaseField = value; }
      }
   }

   /// <remarks/>
   [System.CodeDom.Compiler.GeneratedCodeAttribute("xsd", "2.0.50727.42")]
   [System.SerializableAttribute()]
   [System.Diagnostics.DebuggerStepThroughAttribute()]
   [System.ComponentModel.DesignerCategoryAttribute("code")]
   [System.Xml.Serialization.XmlTypeAttribute(AnonymousType = true)]
   public partial class ShapeData
   {
      public enum ShapeTypeEnum
      {
         ePoint = 0,
         eBox,
         eCylinder,
         eSphere,
         eHalfSphere,
         eRectangle,
         eCircle,
         eTypeTotal
      };
      
      //--- New Data
      private ShapeTypeEnum shapeTypeField;
      private double xSizeField;
      private double ySizeField;
      private double zSizeField;
      private double xPosOffsetField;
      private double yPosOffsetField;
      private double zPosOffsetField;
      private double trajectoryInnerAngleField;
      private double trajectoryOuterAngleField;
      private double trajectoryPitchField;
      private double trajectoryYawField;
      private double trajectoryBankField;
      private bool   emitFromSurfaceField;
      private double emitFromSurfaceRadius;

      public ShapeData()
      {
         ShapeType = ShapeTypeEnum.ePoint;
         XSize = 1.0f;
         YSize = 1.0f;
         ZSize = 1.0f;
         XPosOffset = 0.0f;
         YPosOffset = 0.0f;
         ZPosOffset = 0.0f;
         TrajectoryInnerAngle = 0.0f;
         TrajectoryOuterAngle = 0.0f;
         TrajectoryPitch = 0.0f;
         TrajectoryYaw = 0.0f;
         TrajectoryBank = 0.0f;
         EmitFromSurface = false;
         emitFromSurfaceRadius = 0.0f;         
      }

      public ShapeData clone()
      {
         ShapeData clone = new ShapeData();

         clone.ShapeType             =ShapeType;
         clone.XSize                 =XSize;
         clone.YSize                 =YSize;
         clone.ZSize                 =ZSize;
         clone.XPosOffset            =XPosOffset;
         clone.YPosOffset            =YPosOffset;
         clone.ZPosOffset            =ZPosOffset;
         clone.TrajectoryInnerAngle  =TrajectoryInnerAngle;
         clone.TrajectoryOuterAngle  =TrajectoryOuterAngle;
         clone.TrajectoryPitch       =TrajectoryPitch;
         clone.TrajectoryYaw         =TrajectoryYaw;
         clone.TrajectoryBank        =TrajectoryBank;
         clone.EmitFromSurfaceRadius =EmitFromSurfaceRadius;
         clone.EmitFromSurface       =EmitFromSurface;

         return clone;

      }

      public void preSerialization()
      {
      }

      public void postDeserialization()
      {
      }
       
      /// <remarks/>
      // NEW DATA

      public ShapeTypeEnum ShapeType
      {
         get { return this.shapeTypeField; }
         set { this.shapeTypeField = value; }
      }

      public double XSize
      {
         get { return this.xSizeField;}
         set { this.xSizeField = value; }
      }

      public double YSize
      {
         get { return this.ySizeField;}
         set { this.ySizeField = value; }
      }

      public double ZSize
      {
         get { return this.zSizeField;}
         set { this.zSizeField = value; }
      }

      public double XPosOffset
      {
         get { return this.xPosOffsetField;}
         set { this.xPosOffsetField = value; }
      }

      public double YPosOffset
      {
         get { return this.yPosOffsetField;}
         set { this.yPosOffsetField = value; }
      }

      public double ZPosOffset
      {
         get { return this.zPosOffsetField;}
         set { this.zPosOffsetField = value; }
      }

      public double TrajectoryInnerAngle
      {
         get { return this.trajectoryInnerAngleField;}
         set { this.trajectoryInnerAngleField = value; }
      }

      public double TrajectoryOuterAngle
      {
         get { return this.trajectoryOuterAngleField;}
         set { this.trajectoryOuterAngleField = value; }
      }

      public double TrajectoryPitch
      {
         get { return this.trajectoryPitchField;}
         set { this.trajectoryPitchField = value; }
      }

      public double TrajectoryYaw
      {
         get { return this.trajectoryYawField;}
         set { this.trajectoryYawField = value; }
      }

      public double TrajectoryBank
      {
         get { return this.trajectoryBankField;}
         set { this.trajectoryBankField = value; }
      }

      public double EmitFromSurfaceRadius
      {
         get { return this.emitFromSurfaceRadius;}
         set { this.emitFromSurfaceRadius = value; }
      }

      public bool EmitFromSurface
      {
         get { return this.emitFromSurfaceField;}
         set { this.emitFromSurfaceField = value; }
      }
   }

   /// <remarks/>
   [System.CodeDom.Compiler.GeneratedCodeAttribute("xsd", "2.0.50727.42")]
   [System.SerializableAttribute()]
   [System.Diagnostics.DebuggerStepThroughAttribute()]
   [System.ComponentModel.DesignerCategoryAttribute("code")]
   [System.Xml.Serialization.XmlTypeAttribute(AnonymousType = true)]
   public partial class TextureData
   {
      public enum DiffuseLayerBlendType
      {
         eBlendMultiply,
         eBlendAlpha,
         eBlendTypeTotal
      };

      private TextureSet diffuseSetField;
      private TextureSet diffuseSetField2;
      private TextureSet diffuseSetField3;      
      private TextureSet maskSetField;
      private TextureSet intensitySetField;
      private DiffuseLayerBlendType diffuseLayer1To2BlendTypeField = new DiffuseLayerBlendType();
      private DiffuseLayerBlendType diffuseLayer2To3BlendTypeField = new DiffuseLayerBlendType();      
      
      public TextureData()
      {
         diffuseSetField = new TextureSet();
         diffuseSetField.addDefaultTexture();

         diffuseSetField2 = new TextureSet();
         diffuseSetField3 = new TextureSet();         

         maskSetField = new TextureSet();
         intensitySetField = new TextureSet();
      }

      public TextureData clone()
      {
         TextureData clone = new TextureData();

         clone.Diffuse  = Diffuse.clone();
         clone.Diffuse2 = Diffuse2.clone();
         clone.Diffuse3 = Diffuse3.clone();         
         clone.Masks = Masks.clone();
         clone.Intensity = Intensity.clone();

         return clone;
      }

      public void preSerialization()
      {
         Diffuse.preSerialization();
         Diffuse2.preSerialization();
         Diffuse3.preSerialization();
         Masks.preSerialization();
         Intensity.preSerialization();
      }

      public void postDeserialization()
      {
         Diffuse.postDeserialization();
         Diffuse2.postDeserialization();
         Diffuse3.postDeserialization();        
         Masks.postDeserialization();
         Intensity.postDeserialization();
      }

      public DiffuseLayerBlendType DiffuseLayer1To2BlendMode
      {
         get { return this.diffuseLayer1To2BlendTypeField; }
         set { this.diffuseLayer1To2BlendTypeField = value; }
      }

      public DiffuseLayerBlendType DiffuseLayer2To3BlendMode
      {
         get { return this.diffuseLayer2To3BlendTypeField; }
         set { this.diffuseLayer2To3BlendTypeField = value; }
      }
      
      public TextureSet Diffuse
      {
         get { return this.diffuseSetField;  }
         set { this.diffuseSetField = value; }
      }

      public TextureSet Diffuse2
      {
         get { return this.diffuseSetField2; }
         set { this.diffuseSetField2 = value; }
      }

      public TextureSet Diffuse3
      {
         get { return this.diffuseSetField3; }
         set { this.diffuseSetField3 = value; }
      }      

      public TextureSet Masks
      {
         get { return this.maskSetField;  }
         set { this.maskSetField = value; }
      }

      public TextureSet Intensity
      {
         get { return this.intensitySetField; }
         set { this.intensitySetField = value; }
      }
   }

   /// <remarks/>
   [System.CodeDom.Compiler.GeneratedCodeAttribute("xsd", "2.0.50727.42")]
   [System.SerializableAttribute()]
   [System.Diagnostics.DebuggerStepThroughAttribute()]
   [System.ComponentModel.DesignerCategoryAttribute("code")]
   [System.Xml.Serialization.XmlTypeAttribute(AnonymousType = true)]
   public partial class TextureSet
   {
      public TextureSet()
      {
         texturesField = new List<TextureStage>();
         uvAnimationField = new UVAnimation();
      }

      private List<TextureStage> texturesField;
      private UVAnimation uvAnimationField;
      
      public void addDefaultTexture()
      {
         TextureStage newTexture = new TextureStage();
         newTexture.file = "effects\\white.tga";
         newTexture.weight = 1.0f;            
         Textures.Add(newTexture);
      }

      public TextureSet clone()
      {
         TextureSet clone = new TextureSet();
         clone.Textures.Clear();
         for (int i = 0; i < Textures.Count; ++i )
         {
            clone.Textures.Add(Textures[i].clone());
         }

         clone.UVAnimation = UVAnimation.clone();         

         return clone;
      }

      public void preSerialization()
      {
         for (int i = 0; i < Textures.Count; ++i)
         {
            Textures[i].preSerialization();
         }
         UVAnimation.preSerialization();
      }

      public void postDeserialization()
      {
         for (int i = 0; i < Textures.Count; ++i)
         {
            Textures[i].postDeserialization();
         }
         UVAnimation.postDeserialization();
      }
      
      /// <remarks/>
      [System.Xml.Serialization.XmlArrayItemAttribute("Stage", IsNullable = false)]
      public List<TextureStage> Textures
      {
         get { return this.texturesField;  }
         set { this.texturesField = value; }
      }

      public UVAnimation UVAnimation
      {
         get { return this.uvAnimationField; }
         set { this.uvAnimationField = value; }
      }      
   }

   /// <remarks/>
   [System.CodeDom.Compiler.GeneratedCodeAttribute("xsd", "2.0.50727.42")]
   [System.SerializableAttribute()]
   [System.Diagnostics.DebuggerStepThroughAttribute()]
   [System.ComponentModel.DesignerCategoryAttribute("code")]
   [System.Xml.Serialization.XmlTypeAttribute(AnonymousType = true)]
   public partial class TextureStage
   {

      private string fileField;
      private double weightField;

      public TextureStage()
      {
         weight = 1.0f;
      }

      public TextureStage clone()
      {
         TextureStage clone = new TextureStage();
         clone.file = file;
         clone.weight = weight;

         return clone;
      }

      public void preSerialization()
      {
         weight /= 100.0f;
      }

      public void postDeserialization()
      {
         weight *= 100.0f;
      }

      /// <remarks/>
      public string file
      {
         get { return this.fileField;  }
         set { this.fileField = value; }
      }

      /// <remarks/>
      public double weight
      {
         get { return this.weightField;  }
         set { this.weightField = value; }
      }

      public override string ToString()
      {
         return file + " [" + weight + "]";
      }
   }

   /// <remarks/>
   [System.CodeDom.Compiler.GeneratedCodeAttribute("xsd", "2.0.50727.42")]
   [System.SerializableAttribute()]
   [System.Diagnostics.DebuggerStepThroughAttribute()]
   [System.ComponentModel.DesignerCategoryAttribute("code")]
   [System.Xml.Serialization.XmlTypeAttribute(AnonymousType = true)]
   public partial class UVAnimation
   {
      private bool   useUVAnimationEnabledField;
      private int    numFramesField;
      private int    frameWidthField;
      private int    frameHeightField;      
      private int    framesPerSecondField;
      private double scrollUField;
      private double scrollVField;
      private bool useRandomScrollOffsetUField;
      private bool useRandomScrollOffsetVField;


      public UVAnimation()
      {
         useUVAnimationEnabledField = false;
         numFramesField = 0;
         frameWidthField = 0;
         frameHeightField = 0;
         framesPerSecondField = 0;
         scrollUField = 0;
         scrollVField = 0;
         useRandomScrollOffsetUField = false;
         useRandomScrollOffsetVField = false;
      }

      public UVAnimation clone()
      {
         UVAnimation clone = new UVAnimation();

         clone.UVAnimationEnabled   = UVAnimationEnabled;
         clone.NumFrames            = NumFrames;
         clone.FrameWidth           = FrameWidth;
         clone.FrameHeight          = FrameHeight;
         clone.FramesPerSecond      = FramesPerSecond;
         clone.ScrollU = ScrollU;
         clone.ScrollV = ScrollV;
         clone.UseRandomScrollOffsetU = UseRandomScrollOffsetU;
         clone.UseRandomScrollOffsetV = UseRandomScrollOffsetV;

         return clone;
      }

      public void preSerialization()
      {
      }

      public void postDeserialization()
      {
      }

      /// <remarks/>
      public bool UVAnimationEnabled
      {
         get { return this.useUVAnimationEnabledField;  }
         set { this.useUVAnimationEnabledField = value; }
      }

      public bool UseRandomScrollOffsetU
      {
         get { return this.useRandomScrollOffsetUField; }
         set { this.useRandomScrollOffsetUField = value; }
      }

      public bool UseRandomScrollOffsetV
      {
         get { return this.useRandomScrollOffsetVField; }
         set { this.useRandomScrollOffsetVField = value; }
      }

      /// <remarks/>
      public int NumFrames
      {
         get { return this.numFramesField; }
         set { this.numFramesField = value; }
      }

      /// <remarks/>
      public int FrameWidth
      {
         get { return this.frameWidthField; }
         set { this.frameWidthField = value; }
      }

      /// <remarks/>
      public int FrameHeight
      {
         get { return this.frameHeightField; }
         set { this.frameHeightField = value; }
      }

      /// <remarks/>
      public int FramesPerSecond
      {
         get { return this.framesPerSecondField; }
         set { this.framesPerSecondField = value; }
      }

      public double ScrollU
      {
         get { return scrollUField; }
         set { scrollUField= value; }
      }

      public double ScrollV
      {
         get { return scrollVField; }
         set { scrollVField = value; }
      }            
   }

   /// <remarks/>
   [System.CodeDom.Compiler.GeneratedCodeAttribute("xsd", "2.0.50727.42")]
   [System.SerializableAttribute()]
   [System.Diagnostics.DebuggerStepThroughAttribute()]
   [System.ComponentModel.DesignerCategoryAttribute("code")]
   [System.Xml.Serialization.XmlTypeAttribute(AnonymousType = true)]
   public partial class ColorData
   {
      private ColorProgression colorProgressionField;
      private List<PalletteColor> colorPalleteField;
      private ColorTypeEnum colorTypeField;
      private Color colorField;
      private Color colorVertex1Field;
      private Color colorVertex2Field;
      private Color colorVertex3Field;
      private Color colorVertex4Field;
      private bool  playerColorField;
      private float playerColorIntensityField;
      private bool  sunColorField;
      private float sunColorIntensityField;

      public enum ColorTypeEnum
      {
         eSingleColor = 0,
         ePalletteColor,
         eProgression,
         eTotal
      }
      public ColorData()
      {
         colorPalleteField = new List<PalletteColor>();
         colorProgressionField = new ColorProgression();
         colorTypeField = new ColorTypeEnum();

         Type  = ColorTypeEnum.eSingleColor;
         Color = Color.White;
         ColorVertex1 = Color.White;
         ColorVertex2 = Color.White;
         ColorVertex3 = Color.White;
         ColorVertex4 = Color.White;
         PlayerColor = false;
         PlayerColorIntensity = 100.0f;
         SunColor = false;
         SunColorIntensity = 100.0f;
      }

      public ColorData clone()
      {
         ColorData clone = new ColorData();

         clone.Type = Type;
         clone.Color = Color;
         clone.ColorVertex1 = ColorVertex1;
         clone.ColorVertex2 = ColorVertex2;
         clone.ColorVertex3 = ColorVertex3;
         clone.ColorVertex4 = ColorVertex4;
         clone.PlayerColor = PlayerColor;
         clone.PlayerColorIntensity = PlayerColorIntensity;
         clone.SunColor = SunColor;
         clone.SunColorIntensity = SunColorIntensity;

         clone.ColorProgression = ColorProgression.clone();
         
         clone.ColorPallette.Clear();
         for (int i = 0; i < ColorPallette.Count; ++i)
            clone.ColorPallette.Add(ColorPallette[i].clone());

         return clone;
      }

      public void preSerialization()
      {
         PlayerColorIntensity /= 100.0f;
         if (PlayerColorIntensity > 1.0f)
            PlayerColorIntensity = 1.0f;
         if (PlayerColorIntensity < 0.0f)
            PlayerColorIntensity = 0.0f;

         SunColorIntensity /= 100.0f;
         if (SunColorIntensity > 1.0f)
            SunColorIntensity = 1.0f;
         if (SunColorIntensity < 0.0f)
            SunColorIntensity = 0.0f;
      }

      public void postDeserialization()
      {
         PlayerColorIntensity *= 100.0f;
         if (PlayerColorIntensity > 100.0f)
            PlayerColorIntensity = 100.0f;
         if (PlayerColorIntensity < 0.0f)
            PlayerColorIntensity = 0.0f;

         SunColorIntensity *= 100.0f;
         if (SunColorIntensity > 100.0f)
            SunColorIntensity = 100.0f;
         if (SunColorIntensity < 0.0f)
            SunColorIntensity = 0.0f;
      }

      public ColorTypeEnum Type
      {
         get { return this.colorTypeField; }
         set { this.colorTypeField = value; }
      }

      [XmlIgnore]
      public Color Color
      {
         get { return this.colorField; }
         set { this.colorField = value; }
      }

      [XmlElement("Color")]
      public int ColorSerializer
      {
         get { return colorField.ToArgb(); }
         set { this.colorField = Color.FromArgb(value); }
      }

      [XmlIgnore]
      public Color ColorVertex1
      {
         get { return this.colorVertex1Field; }
         set { this.colorVertex1Field = value; }
      }

      [XmlElement("ColorVertex1")]
      public int ColorVertex1Serializer
      {
         get { return colorVertex1Field.ToArgb(); }
         set { this.colorVertex1Field = Color.FromArgb(value); }
      }

      [XmlIgnore]
      public Color ColorVertex2
      {
         get { return this.colorVertex2Field; }
         set { this.colorVertex2Field = value; }
      }

      [XmlElement("ColorVertex2")]
      public int ColorVertex2Serializer
      {
         get { return colorVertex2Field.ToArgb(); }
         set { this.colorVertex2Field = Color.FromArgb(value); }
      }

      [XmlIgnore]
      public Color ColorVertex3
      {
         get { return this.colorVertex3Field; }
         set { this.colorVertex3Field = value; }
      }

      [XmlElement("ColorVertex3")]
      public int ColorVertex3Serializer
      {
         get { return colorVertex3Field.ToArgb(); }
         set { this.colorVertex3Field = Color.FromArgb(value); }
      }

      [XmlIgnore]
      public Color ColorVertex4
      {
         get { return this.colorVertex4Field; }
         set { this.colorVertex4Field = value; }
      }

      [XmlElement("ColorVertex4")]
      public int ColorVertex4Serializer
      {
         get { return colorVertex4Field.ToArgb(); }
         set { this.colorVertex4Field = Color.FromArgb(value); }
      }

      public ColorProgression ColorProgression
      {
         get { return this.colorProgressionField;  }
         set { this.colorProgressionField = value; }
      }

      public List<PalletteColor> ColorPallette
      {
         get   { return this.colorPalleteField;  }
         set   { this.colorPalleteField = value; }
      }

      public bool PlayerColor
      {
         get { return playerColorField; }
         set { playerColorField = value; }
      }

      public float PlayerColorIntensity
      {
         get { return playerColorIntensityField; }
         set { playerColorIntensityField = value; }
      }

      public bool SunColor
      {
         get { return sunColorField; }
         set { sunColorField = value; }
      }

      public float SunColorIntensity
      {
         get { return sunColorIntensityField; }
         set { sunColorIntensityField = value; }
      }
   }

   /// <remarks/>
   [System.CodeDom.Compiler.GeneratedCodeAttribute("xsd", "2.0.50727.42")]
   [System.SerializableAttribute()]
   [System.Diagnostics.DebuggerStepThroughAttribute()]
   [System.ComponentModel.DesignerCategoryAttribute("code")]
   [System.Xml.Serialization.XmlTypeAttribute(AnonymousType = true)]
   public partial class PalletteColor
   {
      private double weightField;
      private Color  colorField;

      public PalletteColor()
      {
         weightField = 1.0;
         colorField = new Color();
      }

      public PalletteColor clone()
      {
         PalletteColor clone = new PalletteColor();

         clone.Color = Color;
         clone.Weight = Weight;

         return clone;
      }

      public void preSerialization()
      {
      }

      public void postDeserialization()
      {
      }

      [XmlIgnore]
      public Color Color
      {
         get { return colorField;  }
         set { colorField = value; }
      }

      [XmlElement("Color")]
      public int ColorSerializer
      {
         get { return colorField.ToArgb(); }
         set { this.colorField = Color.FromArgb(value); }
      }

      public double Weight
      {
         get { return weightField;  }
         set { weightField = value; }
      }
   }
  
   /// <remarks/>
   [System.CodeDom.Compiler.GeneratedCodeAttribute("xsd", "2.0.50727.42")]
   [System.SerializableAttribute()]
   [System.Diagnostics.DebuggerStepThroughAttribute()]
   [System.ComponentModel.DesignerCategoryAttribute("code")]
   [System.Xml.Serialization.XmlTypeAttribute(AnonymousType = true)]
   public partial class VectorProgressionData
   {
      public VectorProgressionData()
      {
         progressionField = new VectorProgression();

         UseXProgression = false;
         UseYProgression = false;
         UseZProgression = false;
         UniformValue = 1.0f;
         ValueX = 1.0f;
         ValueY = 1.0f;
         ValueZ = 1.0f;
         UniformValueVariance = 0.0f;
         ValueXVariance = 0.0f;
         ValueYVariance = 0.0f;
         ValueZVariance = 0.0f;         
      }

      public VectorProgressionData clone()
      {
         VectorProgressionData clone = new VectorProgressionData();

         clone.UseXProgression            =UseXProgression;
         clone.UseYProgression            =UseYProgression;
         clone.UseZProgression            =UseZProgression;
         clone.UniformValue               =UniformValue;
         clone.UniformValueVariance       =UniformValueVariance;
         clone.ValueX                     =ValueX;
         clone.ValueXVariance             =ValueXVariance;
         clone.ValueY                     =ValueY;
         clone.ValueYVariance             =ValueYVariance;
         clone.ValueZ                     =ValueZ;
         clone.ValueZVariance             =ValueZVariance;
         clone.Progression                =Progression.clone();

         return clone;
      }

      public void preSerialization()
      {
         UniformValue /= 100.0f;
         ValueX /= 100.0f;
         ValueY /= 100.0f;
         ValueZ /= 100.0f;

         UniformValueVariance /= 100.0f;
         ValueXVariance /= 100.0f;
         ValueYVariance /= 100.0f;
         ValueZVariance /= 100.0f;

         Progression.preSerialization();
      }

      public void postDeserialization()
      {
         UniformValue *= 100.0f;
         ValueX *= 100.0f;
         ValueY *= 100.0f;
         ValueZ *= 100.0f;

         UniformValueVariance *= 100.0f;
         ValueXVariance *= 100.0f;
         ValueYVariance *= 100.0f;
         ValueZVariance *= 100.0f;

         Progression.postDeserialization();
      }

      private bool useXProgressionField;
      private bool useYProgressionField;
      private bool useZProgressionField;

      private double uniformField;
      private double uniformVarianceField;

      private double valueXField;
      private double valueXVarianceField;
      private double valueYField;
      private double valueYVarianceField;
      private double valueZField;
      private double valueZVarianceField;
      private VectorProgression progressionField;

      public bool UseXProgression
      {
         get { return useXProgressionField; }
         set { useXProgressionField = value; }
      }

      public bool UseYProgression
      {
         get { return useYProgressionField; }
         set { useYProgressionField = value; }
      }

      public bool UseZProgression
      {
         get { return useZProgressionField; }
         set { useZProgressionField = value; }
      }

      public double UniformValue
      {
         get { return uniformField; }
         set { uniformField = value; }
      }

      /// <remarks/>
      public double UniformValueVariance
      {
         get { return uniformVarianceField; }
         set { uniformVarianceField = value; }
      }

      public double ValueX
      {
         get { return valueXField; }
         set { valueXField = value; }
      }

      /// <remarks/>
      public double ValueXVariance
      {
         get { return valueXVarianceField; }
         set { valueXVarianceField = value; }
      }

      public double ValueY
      {
         get { return valueYField; }
         set { valueYField = value; }
      }

      /// <remarks/>
      public double ValueYVariance
      {
         get { return valueYVarianceField; }
         set { valueYVarianceField = value; }
      }

      public double ValueZ
      {
         get { return valueZField; }
         set { valueZField = value; }
      }

      /// <remarks/>
      public double ValueZVariance
      {
         get { return valueZVarianceField; }
         set { valueZVarianceField = value; }
      }

      public VectorProgression Progression
      {
         get { return progressionField; }
         set { progressionField = value; }
      }
   }
  
   /// <remarks/>
   [System.CodeDom.Compiler.GeneratedCodeAttribute("xsd", "2.0.50727.42")]
   [System.SerializableAttribute()]
   [System.Diagnostics.DebuggerStepThroughAttribute()]
   [System.ComponentModel.DesignerCategoryAttribute("code")]
   [System.Xml.Serialization.XmlTypeAttribute(AnonymousType = true)]
   public partial class FloatProgressionData
   {
      public FloatProgressionData()
      {
         progressionField = new FloatProgression();

         UseProgression = false;
         Value          = 1.0f;
         ValueVariance  = 0.0f;         
      }

      public FloatProgressionData clone()
      {
         FloatProgressionData clone = new FloatProgressionData();

         clone.UseProgression  = UseProgression;
         clone.Value           = Value;
         clone.ValueVariance   = ValueVariance;
         clone.Progression     = Progression.clone();

         return clone;
      }

      public void preSerialization()
      {
         Value /= 100.0f;
         ValueVariance /= 100.0f;
         Progression.preSerialization();
      }

      public void postDeserialization()
      {
         Value *= 100.0f;
         ValueVariance *= 100.0f;
         Progression.postDeserialization();
      }

      private bool useProgressionField;
      private double valueField;
      private double valueVarianceField;
      private FloatProgression progressionField;

      public bool UseProgression
      {
         get { return useProgressionField; }
         set { useProgressionField = value; }
      }

      public double Value
      {
         get { return valueField; }
         set { valueField = value; }
      }

      /// <remarks/>
      public double ValueVariance
      {
         get { return valueVarianceField; }
         set { valueVarianceField = value; }
      }

      public FloatProgression Progression
      {
         get { return progressionField; }
         set { progressionField = value; }
      }
   }

   /// <remarks/>
   [System.CodeDom.Compiler.GeneratedCodeAttribute("xsd", "2.0.50727.42")]
   [System.SerializableAttribute()]
   [System.Diagnostics.DebuggerStepThroughAttribute()]
   [System.ComponentModel.DesignerCategoryAttribute("code")]
   [System.Xml.Serialization.XmlTypeAttribute(AnonymousType = true)]
   public partial class ForceData
   {
      private bool   randomOrientationField;
      private bool   tumbleBothDirectionsField;
      private bool   tumbleField;
      private double minAngularVelocityField;
      private double maxAngularVelocityField;      
      private bool   useInternalGravityField;
      private double internalGravityField;
      private double internalGravityVarField;
      private bool   useInternalWindField;
      private double internalWindDirectionField;
      private double internalWindDirectionVarField;
      private double internalWindSpeedField;
      private double internalWindSpeedVarField;
      private double internalWindDelayField;
      private double internalWindDelayVarField;

      private bool   useExternalWindField;
      private double externalWindInfluenceField;
      private double externalWindInfluenceVarField;
      private double externalWindDelayField;
      private double externalWindDelayVarField;

      public ForceData()
      {
         RandomOrientation = false;
         TumbleBothDirections = false;
         UseTumble = false;
         MinAngularTumbleVelocity = 0.0f;
         MaxAngularTumbleVelocity = 0.0f;
         UseInternalGravity = false;
         InternalGravity = -9.8f;
         InternalGravityVar = 0.0f;
         UseInternalWind = false;
         InternalWindDirection = 0.0f;
         InternalWindDirectionVar = 0.0f;
         InternalWindSpeed = 1.0f;
         InternalWindSpeedVar = 0.0f;
         InternalWindDelay = 0.0f;
         InternalWindDelayVar = 0.0f;
         UseExternalWind = false;
         ExternalWindInfluence = 0.0f;
         ExternalWindInfluenceVar = 0.0f;
         ExternalWindDelay = 0.0f;
         ExternalWindDelayVar = 0.0f;         
      }

      public ForceData clone()
      {
         ForceData clone = new ForceData();

         clone.RandomOrientation         =RandomOrientation;
         clone.UseTumble                 =UseTumble;
         clone.MinAngularTumbleVelocity  =MinAngularTumbleVelocity;
         clone.MaxAngularTumbleVelocity  =MaxAngularTumbleVelocity;
         clone.TumbleBothDirections      =TumbleBothDirections;
         clone.UseInternalGravity        =UseInternalGravity;
         clone.InternalGravity           =InternalGravity;
         clone.InternalGravityVar        =InternalGravityVar;
         clone.UseInternalWind           =UseInternalWind;
         clone.InternalWindDirection     =InternalWindDirection;
         clone.InternalWindDirectionVar  =InternalWindDirectionVar;
         clone.InternalWindSpeed         =InternalWindSpeed;
         clone.InternalWindSpeedVar      =InternalWindSpeedVar;
         clone.InternalWindDelay         =InternalWindDelay;
         clone.InternalWindDelayVar      =InternalWindDelayVar;
         clone.UseExternalWind           =UseExternalWind;
         clone.ExternalWindInfluence     =ExternalWindInfluence;
         clone.ExternalWindInfluenceVar  =ExternalWindInfluenceVar;
         clone.ExternalWindDelay         =ExternalWindDelay;
         clone.ExternalWindDelayVar      =ExternalWindDelayVar;

         return clone;
      }

      public void preSerialization()
      {
         InternalGravityVar /= 100.0f;
         InternalWindDirectionVar /= 100.0f;
         InternalWindSpeedVar /= 100.0f;
         InternalWindDelayVar /= 100.0f;
         ExternalWindInfluenceVar /= 100.0f;
         ExternalWindDelayVar /= 100.0f;
      }

      public void postDeserialization()
      {
         InternalGravityVar *= 100.0f;
         InternalWindDirectionVar *= 100.0f;
         InternalWindSpeedVar *= 100.0f;
         InternalWindDelayVar *= 100.0f;
         ExternalWindInfluenceVar *= 100.0f;
         ExternalWindDelayVar *= 100.0f;
      }
      
      /// <remarks/>
      [Description("Applies a random tumble angle upon birth to particles"), Category("Tumble")]
      public bool RandomOrientation
      {
         get { return this.randomOrientationField;  }
         set { this.randomOrientationField = value; }
      }

      /// <remarks/>
      [Description("Enables Tumbling of Particles"), Category("Tumble")]
      public bool UseTumble
      {
         get { return this.tumbleField;  }
         set { this.tumbleField = value; }
      }

      /// <remarks/>
      [Description("Minimum Angle Velocity for tumbling particles"), Category("Tumble")]
      public double MinAngularTumbleVelocity
      {
         get { return this.minAngularVelocityField;  }
         set { this.minAngularVelocityField = value; }
      }

      /// <remarks/>
      public double MaxAngularTumbleVelocity
      {
         get { return this.maxAngularVelocityField;  }
         set { this.maxAngularVelocityField = value; }
      }

      /// <remarks/>
      public bool TumbleBothDirections
      {
         get { return this.tumbleBothDirectionsField;  }
         set { this.tumbleBothDirectionsField = value; }
      }

      /// <remarks/>
      public bool UseInternalGravity
      {
         get { return this.useInternalGravityField;  }
         set { this.useInternalGravityField = value; }
      }

      /// <remarks/>
      public double InternalGravity
      {
         get { return this.internalGravityField;  }
         set { this.internalGravityField = value; }
      }

      /// <remarks/>
      public double InternalGravityVar
      {
         get { return this.internalGravityVarField;  }
         set { this.internalGravityVarField = value; }
      }

      /// <remarks/>
      public bool UseInternalWind
      {
         get { return this.useInternalWindField;  }
         set { this.useInternalWindField = value; }
      }

      /// <remarks/>
      public double InternalWindDirection
      {
         get { return this.internalWindDirectionField;  }
         set { this.internalWindDirectionField = value; }
      }

      /// <remarks/>
      public double InternalWindDirectionVar
      {
         get { return this.internalWindDirectionVarField;  }
         set { this.internalWindDirectionVarField = value; }
      }

      /// <remarks/>
      public double InternalWindSpeed
      {
         get { return this.internalWindSpeedField;  }
         set { this.internalWindSpeedField = value; }
      }

      /// <remarks/>
      public double InternalWindSpeedVar
      {
         get { return this.internalWindSpeedVarField;  }
         set { this.internalWindSpeedVarField = value; }
      }

      /// <remarks/>
      public double InternalWindDelay
      {
         get { return this.internalWindDelayField;  }
         set { this.internalWindDelayField = value; }
      }

      /// <remarks/>
      public double InternalWindDelayVar
      {
         get { return this.internalWindDelayVarField;  }
         set { this.internalWindDelayVarField = value; }
      }

      /// <remarks/>
      public bool UseExternalWind
      {
         get { return this.useExternalWindField; }
         set { useExternalWindField = value; }
      }

      /// <remarks/>
      public double ExternalWindInfluence
      {
         get { return this.externalWindInfluenceField; }
         set { externalWindInfluenceField = value; }
      }

      /// <remarks/>
      public double ExternalWindInfluenceVar
      {
         get { return externalWindInfluenceVarField;  }
         set { externalWindInfluenceVarField = value; }
      }

      /// <remarks/>
      public double ExternalWindDelay
      {
         get {  return this.externalWindDelayField;  }
         set {  this.externalWindDelayField = value; }
      }

      /// <remarks/>
      public double ExternalWindDelayVar
      {
         get { return this.externalWindDelayVarField;  }
         set { this.externalWindDelayVarField = value; }
      }
   }

   /// <remarks/>
   [System.CodeDom.Compiler.GeneratedCodeAttribute("xsd", "2.0.50727.42")]
   [System.SerializableAttribute()]
   [System.Diagnostics.DebuggerStepThroughAttribute()]
   [System.ComponentModel.DesignerCategoryAttribute("code")]
   [System.Xml.Serialization.XmlTypeAttribute(AnonymousType = true)]
   public partial class MagnetData
   {
      private MagnetTypeEnum magnetTypeField = new MagnetTypeEnum();
      private double forceField;
      private double rotationalForceField;
      private double radiusField;
      private double heightField;
      private double dampeningField;
      private double turbulenceField;
      private double xPosOffsetField;
      private double yPosOffsetField;
      private double zPosOffsetField;
      private double xRotField;
      private double yRotField;
      private double zRotField;
      private string nameField;

      public enum MagnetTypeEnum
      {
         eSphere = 0,
         eCylinder,         
         eTypeTotal
      };

      public MagnetData()
      {
         magnetTypeField = MagnetTypeEnum.eSphere;
         forceField = 1.0f;
         radiusField = 1.0f;
         heightField = 1.0f;
         xPosOffsetField = 0.0f;
         yPosOffsetField = 0.0f;
         zPosOffsetField = 0.0f;
         turbulenceField = 0.0f;
         dampeningField = 0.0f;
         xRotField = 0.0f;
         yRotField = 0.0f;
         zRotField = 0.0f;
      }

      public MagnetData clone()
      {
         MagnetData clone = new MagnetData();
         clone.forceField = forceField;
         clone.rotationalForceField = rotationalForceField;
         clone.radiusField = radiusField;
         clone.heightField = heightField;
         clone.turbulenceField = turbulenceField;
         clone.dampeningField = dampeningField;
         clone.xPosOffsetField = xPosOffsetField;
         clone.yPosOffsetField = yPosOffsetField;
         clone.zPosOffsetField = zPosOffsetField;
         clone.magnetTypeField = magnetTypeField;
         clone.xRotField = xRotField;
         clone.yRotField = yRotField;
         clone.zRotField = zRotField;
         clone.Name = Name;
         return clone;
      }

      public void preSerialization()
      {
         Dampening /= 100.0f;
         Turbulence /= 100.0f;
      }

      public void postDeserialization()
      {
         Dampening *= 100.0f;
         Turbulence *= 100.0f;
      }

      public MagnetTypeEnum MagnetType
      {
         get { return this.magnetTypeField; }
            set { this.magnetTypeField = value; }
      }

      [System.Xml.Serialization.XmlAttributeAttribute()]
      public string Name
      {
         get { return this.nameField; }
         set { this.nameField = value; }
      }

      /// <remarks/>
      public double Force
      {
         get { return this.forceField; }
         set { this.forceField = value; }
      }

      public double RotationalForce
      {
         get { return this.rotationalForceField; }
         set { this.rotationalForceField = value; }
      }

      public double Radius
      {
         get { return this.radiusField; }
         set { this.radiusField = value; }
      }

      public double Height
      {
         get { return this.heightField; }
         set { this.heightField = value; }
      }

      public double Turbulence
      {
         get { return this.turbulenceField; }
         set { this.turbulenceField = value; }
      }

      public double Dampening
      {
         get { return this.dampeningField; }
         set { this.dampeningField = value; }
      }

      public double XPosOffset
      {
         get { return this.xPosOffsetField; }
         set { this.xPosOffsetField = value; }
      }

      /// <remarks/>
      public double YPosOffset
      {
         get { return this.yPosOffsetField; }
         set { this.yPosOffsetField = value; }
      }

      /// <remarks/>
      public double ZPosOffset
      {
         get { return this.zPosOffsetField; }
         set { this.zPosOffsetField = value; }
      }

      public double XRotation
      {
         get { return this.xRotField; }
         set { this.xRotField = value; }
      }

      /// <remarks/>
      public double YRotation
      {
         get { return this.yRotField; }
         set { this.yRotField = value; }
      }

      /// <remarks/>
      public double ZRotation
      {
         get { return this.zRotField; }
         set { this.zRotField = value; }
      }      
   }
}