Example #1
0
        public YAMLNode ExportYAML(IExportContainer container)
        {
            YAMLMappingNode node   = new YAMLMappingNode();
            GradientLayout  layout = container.ExportLayout.Serialized.Gradient;

            node.AddSerializedVersion(layout.Version);
            if (layout.Version == 1)
            {
                node.Add(layout.Key0Name, Key0_32.ExportYAML(container));
                node.Add(layout.Key1Name, Key1_32.ExportYAML(container));
                node.Add(layout.Key2Name, Key2_32.ExportYAML(container));
                node.Add(layout.Key3Name, Key3_32.ExportYAML(container));
                node.Add(layout.Key4Name, Key4_32.ExportYAML(container));
                node.Add(layout.Key5Name, Key5_32.ExportYAML(container));
                node.Add(layout.Key6Name, Key6_32.ExportYAML(container));
                node.Add(layout.Key7Name, Key7_32.ExportYAML(container));
            }
            else
            {
                node.Add(layout.Key0Name, Key0.ExportYAML(container));
                node.Add(layout.Key1Name, Key1.ExportYAML(container));
                node.Add(layout.Key2Name, Key2.ExportYAML(container));
                node.Add(layout.Key3Name, Key3.ExportYAML(container));
                node.Add(layout.Key4Name, Key4.ExportYAML(container));
                node.Add(layout.Key5Name, Key5.ExportYAML(container));
                node.Add(layout.Key6Name, Key6.ExportYAML(container));
                node.Add(layout.Key7Name, Key7.ExportYAML(container));
            }

            node.Add(layout.Ctime0Name, Ctime0);
            node.Add(layout.Ctime1Name, Ctime1);
            node.Add(layout.Ctime2Name, Ctime2);
            node.Add(layout.Ctime3Name, Ctime3);
            node.Add(layout.Ctime4Name, Ctime4);
            node.Add(layout.Ctime5Name, Ctime5);
            node.Add(layout.Ctime6Name, Ctime6);
            node.Add(layout.Ctime7Name, Ctime7);
            node.Add(layout.Atime0Name, Atime0);
            node.Add(layout.Atime1Name, Atime1);
            node.Add(layout.Atime2Name, Atime2);
            node.Add(layout.Atime3Name, Atime3);
            node.Add(layout.Atime4Name, Atime4);
            node.Add(layout.Atime5Name, Atime5);
            node.Add(layout.Atime6Name, Atime6);
            node.Add(layout.Atime7Name, Atime7);
            if (layout.HasMode)
            {
                node.Add(layout.ModeName, (int)Mode);
            }

            node.Add(layout.NumColorKeysName, NumColorKeys);
            node.Add(layout.NumAlphaKeysName, NumAlphaKeys);
            return(node);
        }
Example #2
0
        public void Write(AssetWriter writer)
        {
            GradientLayout layout = writer.Layout.Serialized.Gradient;

            if (layout.Version == 1)
            {
                Key0_32.Write(writer);
                Key1_32.Write(writer);
                Key2_32.Write(writer);
                Key3_32.Write(writer);
                Key4_32.Write(writer);
                Key5_32.Write(writer);
                Key6_32.Write(writer);
                Key7_32.Write(writer);
            }
            else
            {
                Key0.Write(writer);
                Key1.Write(writer);
                Key2.Write(writer);
                Key3.Write(writer);
                Key4.Write(writer);
                Key5.Write(writer);
                Key6.Write(writer);
                Key7.Write(writer);
            }

            writer.Write(Ctime0);
            writer.Write(Ctime1);
            writer.Write(Ctime2);
            writer.Write(Ctime3);
            writer.Write(Ctime4);
            writer.Write(Ctime5);
            writer.Write(Ctime6);
            writer.Write(Ctime7);
            writer.Write(Atime0);
            writer.Write(Atime1);
            writer.Write(Atime2);
            writer.Write(Atime3);
            writer.Write(Atime4);
            writer.Write(Atime5);
            writer.Write(Atime6);
            writer.Write(Atime7);
            if (layout.HasMode)
            {
                writer.Write((int)Mode);
            }

            writer.Write(NumColorKeys);
            writer.Write(NumAlphaKeys);
            writer.AlignStream();
        }