Esempio n. 1
0
        //Serialization stuff:

        public void WriteData(MyData.Writer writer)
        {
            writer.Int(NIterations, "nIterations");
            writer.Float(TileVariation, "tileVariation");

            KeyframeSerializer kfs = new KeyframeSerializer();

            writer.Collection(
                TileChangeChances.keys, "tileChangeChances",
                (MyData.Writer w, Keyframe k, string name) =>
                { kfs.Kf = k; w.Structure(kfs, name); });
        }
Esempio n. 2
0
        public void ReadData(MyData.Reader reader)
        {
            NIterations   = reader.Int("nIterations");
            TileVariation = reader.Float("tileVariation");

            KeyframeSerializer kfs = new KeyframeSerializer();

            Keyframe[] keyframes = reader.Collection(
                "tileChangeChances",
                (MyData.Reader r, ref Keyframe outVal, string name) =>
                { r.Structure(kfs, name); outVal = kfs.Kf; },
                (size) => new Keyframe[size],
                (i, _kfs, kf) => _kfs[i] = kf);
            TileChangeChances.keys       = keyframes;
        }