Exemple #1
0
        // Serialize / deserialize (passive: this doesn't record)
        internal void ReadWrite(IReadWriteStream s)
        {
            if (!s.IsWriting)
            {
                BeforePropsChange();
                updateneeded = true;
            }

            base.ReadWrite(s);

            // villsa
            if (s.IsWriting)
            {
                s.wInt(flags.Count);

                foreach (KeyValuePair <string, bool> f in flags)
                {
                    s.wString(f.Key);
                    s.wBool(f.Value);
                }
            }
            else
            {
                int c; s.rInt(out c);

                flags = new Dictionary <string, bool>(c);
                for (int i = 0; i < c; i++)
                {
                    string t; s.rString(out t);
                    bool   b; s.rBool(out b);
                    flags.Add(t, b);
                }
            }

            s.rwInt(ref fixedindex);
            s.rwInt(ref floorheight);
            s.rwInt(ref ceilheight);
            s.rwString(ref floortexname);
            s.rwString(ref ceiltexname);
            s.rwLong(ref longfloortexname);
            s.rwLong(ref longceiltexname);
            s.rwInt(ref effect);
            s.rwInt(ref tag);
            s.rwInt(ref brightness);
            // villsa
            if (General.Map.FormatInterface.InDoom64Mode)
            {
                s.rwLight(ref ceilColor);
                s.rwLight(ref flrColor);
                s.rwLight(ref thingColor);
                s.rwLight(ref topColor);
                s.rwLight(ref lwrColor);
            }
        }