Exemplo n.º 1
0
        public void SerializeScheme(Stream output, SchemeDataBase db)
        {
            using (var writer = new BinaryWriter(output, System.Text.Encoding.UTF8, true))
            {
                writer.Write(SchemeID.ToCharArray());
                writer.Write(db.Version);
            }
            var bin = new BinaryFormatter();

            using (var zs = new ZLibStream(output, CompressionMode.Compress, true))
                bin.Serialize(zs, db);
        }
Exemplo n.º 2
0
        public void SerializeScheme(Stream output)
        {
            var db = new SchemeDataBase {
                Version   = CurrentSchemeVersion,
                SchemeMap = new Dictionary <string, ResourceScheme>(),
                GameMap   = m_game_map,
            };

            foreach (var format in Formats)
            {
                var scheme = format.Scheme;
                if (null != scheme)
                {
                    db.SchemeMap[format.Tag] = scheme;
                }
            }
            SerializeScheme(output, db);
        }
Exemplo n.º 3
0
        public void SerializeScheme(Stream output)
        {
            var db = new SchemeDataBase {
                Version   = CurrentSchemeVersion,
                SchemeMap = new Dictionary <string, ResourceScheme>()
            };

            foreach (var format in Formats)
            {
                var scheme = format.Scheme;
                if (null != scheme)
                {
                    db.SchemeMap[format.Tag] = scheme;
                }
            }
            var bin = new BinaryFormatter();

            bin.Serialize(output, db);
        }