private void WriteShipViewer(BinaryWriter Writer)
        {
            foreach (GameObject g in Children)
            {
                if (g.GetType().Equals(typeof(ShipViewer)))
                {
                    ShipViewer s = (ShipViewer)g;

                    Writer.Write(s.model.getFullPath());
                    Writer.Write(s.effect.getFullPath());

                    ColorParameter     DrawColor        = (ColorParameter)s.effect.findValueParameter("DrawColor");
                    ColorParameter     SpecularColor    = (ColorParameter)s.effect.findValueParameter("SpecularColor");
                    FloatParameter     SpecularExponent = (FloatParameter)s.effect.findValueParameter("SpecularExponent");
                    Texture2DParameter Texture          = (Texture2DParameter)s.effect.findValueParameter("Texture");

                    Writer.Write(Texture.getFullPath());

                    SaveHelper.Write(DrawColor.get());
                    SaveHelper.Write(SpecularColor.get());
                    Writer.Write((Single)SpecularExponent.get());

                    return;
                }
            }
            throw new Exception("No ShipViewer to save");
        }
        private void WriteParticlePoints(BinaryWriter Writer)
        {
            int ParticleCount = 0;

            foreach (GameObject g in Children)
            {
                if (g.GetType().Equals(typeof(ShipParticlePoint)))
                {
                    ParticleCount++;
                }
            }

            Writer.Write((Int32)ParticleCount);

            foreach (GameObject g in Children)
            {
                if (g.GetType().Equals(typeof(ShipParticlePoint)))
                {
                    ShipParticlePoint s = (ShipParticlePoint)g;
                    SaveHelper.Write(s.Position.get());
                    Writer.Write((Int32)s.Layer.get());
                    Writer.Write((Int32)s.CinematicDelay.get());
                    Writer.Write((Int32)s.GameDelay.get());
                    Writer.Write((Int32)s.ParticleType.get());
                    SaveHelper.Write(s.MaxVelocity.get());
                    SaveHelper.Write(s.MinVelocity.get());
                    SaveHelper.Write(s.MinColor.get());
                    SaveHelper.Write(s.MaxColor.get());
                    Writer.Write((Single)s.MinSize.get());
                    Writer.Write((Single)s.MaxSize.get());
                    Writer.Write(s.CinematicOnly.get());
                }
            }
        }
Пример #3
0
        public override void Write(BinaryWriter Writer)
        {
            SaveHelper.Write(getBase());
            Writer.Write((Single)getMult());

            base.Write(Writer);
        }
        private void WriteWeaponPoints(BinaryWriter Writer)
        {
            int WeaponCount = 0;

            foreach (GameObject g in Children)
            {
                if (g.GetType().Equals(typeof(ShipWeaponPoint)))
                {
                    WeaponCount++;
                }
            }

            Writer.Write((Int32)WeaponCount);

            foreach (GameObject g in Children)
            {
                if (g.GetType().Equals(typeof(ShipWeaponPoint)))
                {
                    ShipWeaponPoint s = (ShipWeaponPoint)g;
                    SaveHelper.Write(s.Position.get());
                    Writer.Write((Int32)s.Layer.get());
                }
            }
        }
Пример #5
0
 public override void Write(BinaryWriter Writer)
 {
     SaveHelper.Write(get());
     base.Write(Writer);
 }