Beispiel #1
0
        /// <summary>
        /// Convert this effect to its XML representation
        /// </summary>
        /// <param name="xml">The target XML document</param>
        /// <param name="dict">The dictionary for variable name support</param>
        /// <returns>The exported XML node</returns>
        public override XmlNode ToXml(XmlDocument xml, PrototypeExporter.Dict dict)
        {
            var node = xml.CreateElement("Script");

            AddParamsToXml(xml, node, dict);
            return(node);
        }
        /// <summary>
        /// Converts this Activation in its XML representation
        /// </summary>
        /// <param name="xml">target xml document</param>
        /// <param name="dict">the exporter dictionary for variable names</param>
        /// <returns>the new XML node</returns>
        public override XmlNode ToXml(XmlDocument xml, PrototypeExporter.Dict dict)
        {
            var node = xml.CreateElement("Channel");

            AddParamToXml(xml, node, Enabled, "enable", dict);
            AddParamToXml(xml, node, Old, "old", dict);
            return(node);
        }
        /// <summary>
        /// Converts this Activation in its XML representation
        /// </summary>
        /// <param name="xml">target xml document</param>
        /// <param name="dict">the exporter dictionary for variable names</param>
        /// <returns>the new XML node</returns>
        public override XmlNode ToXml(XmlDocument xml, PrototypeExporter.Dict dict)
        {
            var node = xml.CreateElement("KeyPress");

            AddParamToXml(xml, node, Enabled, "enable", dict);
            AddParamToXml(xml, node, Char, "char", dict);
            return(node);
        }
        /// <summary>
        /// Converts this Activation in its XML representation
        /// </summary>
        /// <param name="xml">target xml document</param>
        /// <param name="dict">the exporter dictionary for variable names</param>
        /// <returns>the new XML node</returns>
        public override XmlNode ToXml(XmlDocument xml, PrototypeExporter.Dict dict)
        {
            var node = xml.CreateElement("Click");

            AddParamToXml(xml, node, Enabled, "enable", dict);
            AddParamToXml(xml, node, Button, "button", dict);
            return(node);
        }
        /// <summary>
        /// Converts this Activation in its XML representation
        /// </summary>
        /// <param name="xml">target xml document</param>
        /// <param name="dict">the exporter dictionary for variable names</param>
        /// <returns>the new XML node</returns>
        public override XmlNode ToXml(XmlDocument xml, PrototypeExporter.Dict dict)
        {
            var node = xml.CreateElement("AfterAnimation");

            AddParamToXml(xml, node, Enabled, "enable", dict);
            node.Attributes.Append(xml.CreateAttribute("effect-id")).Value = "#" + dict.Groups[Effect].ToString();
            return(node);
        }
 /// <summary>
 /// helper method to add a parameter to this node
 /// </summary>
 /// <param name="xml">the target XML document</param>
 /// <param name="node">the result node</param>
 /// <param name="param">the value</param>
 /// <param name="name">name of the value</param>
 /// <param name="dict">the exporter dictionary for variable names</param>
 protected void AddParamToXml(XmlDocument xml, XmlNode node, IValueWrapper param, string name, PrototypeExporter.Dict dict)
 {
     if (param.Exists)
     {
         node.Attributes.Append(xml.CreateAttribute(name)).Value = PrototypeExporter.GetParamValue(param, dict);
     }
 }
 /// <summary>
 /// Converts this Activation in its XML representation
 /// </summary>
 /// <param name="xml">target xml document</param>
 /// <param name="dict">the exporter dictionary for variable names</param>
 /// <returns>the new XML node</returns>
 public abstract XmlNode ToXml(XmlDocument xml, PrototypeExporter.Dict dict);
Beispiel #8
0
 /// <summary>
 /// Add its own parameters to the xml node
 /// </summary>
 /// <param name="xml">the target XML document</param>
 /// <param name="node">the current XML node</param>
 /// <param name="dict">Dictionary for variable name support</param>
 protected override void AddParamsToXml(XmlDocument xml, XmlNode node, PrototypeExporter.Dict dict)
 {
     base.AddParamsToXml(xml, node, dict);
     AddParamToXml(xml, node, Code, "code", dict);
 }