Example #1
0
            public void WriteXml(XmlWriter writer)
            {
                writer.WriteStartElement("Name");
                writer.WriteString(Name);
                writer.WriteEndElement();

                writer.WriteStartElement("ImagePath");
                writer.WriteString(ImagePath);
                writer.WriteEndElement();

                XmlSerializer serializer = new XmlSerializer(typeof(bool[]));

                writer.WriteStartElement("Pasabilities");
                bool[] pasabilities = DataConversion.FlattenArray3D <bool>(Pasabilities);
                serializer.Serialize(writer, pasabilities);
                writer.WriteEndElement();

                serializer = new XmlSerializer(typeof(int[]));

                writer.WriteStartElement("Priorities");
                int[] priorities = DataConversion.FlattenArray2D <int>(Priorities);
                serializer.Serialize(writer, priorities);
                writer.WriteEndElement();

                writer.WriteStartElement("TerrainTags");
                int[] terrainTags = DataConversion.FlattenArray2D <int>(TerrainTags);
                serializer.Serialize(writer, terrainTags);
                writer.WriteEndElement();

                serializer = new XmlSerializer(typeof(bool[]));

                writer.WriteStartElement("BushFlags");
                bool[] bushFlags = DataConversion.FlattenArray2D <bool>(BushFlags);
                serializer.Serialize(writer, bushFlags);
                writer.WriteEndElement();

                writer.WriteStartElement("CounterFlags");
                bool[] counterFlags = DataConversion.FlattenArray2D <bool>(CounterFlags);
                serializer.Serialize(writer, counterFlags);
                writer.WriteEndElement();

                writer.WriteStartElement("ReflectionFlags");
                bool[] reflectionFlags = DataConversion.FlattenArray2D <bool>(ReflectionFlags);
                serializer.Serialize(writer, reflectionFlags);
                writer.WriteEndElement();

                writer.WriteStartElement("BridgeFlags");
                bool[] bridgeFlags = DataConversion.FlattenArray2D <bool>(BridgeFlags);
                serializer.Serialize(writer, bridgeFlags);
                writer.WriteEndElement();

                writer.WriteStartElement("AutoTiles");
                serializer = new XmlSerializer(typeof(string[]));
                serializer.Serialize(writer, AutoTiles);
                writer.WriteEndElement();

                writer.WriteStartElement("AutoTileTimers");
                serializer = new XmlSerializer(typeof(float[]));
                serializer.Serialize(writer, AutoTileTimers);
                writer.WriteEndElement();
            }