public static void Serialize(XmlWriter xWrite, Castable contents) { XmlSerializer Writer = new XmlSerializer(contents.GetType()); XmlSerializerNamespaces ns = new XmlSerializerNamespaces(); ns.Add("", "http://www.hybrasyl.com/XML/Actions"); Writer.Serialize(xWrite, contents, ns); }
public static Castable Deserialize(XmlReader reader, Castable contents = null) { if (contents == null) { contents = new Castable(); } //reader.Settings.IgnoreWhitespace = false; XmlSerializer XmlSerial = new XmlSerializer(contents.GetType()); if (XmlSerial.CanDeserialize(reader)) { var xContents = XmlSerial.Deserialize(reader); contents = (Castable)xContents; } return(contents); }
public override void Attack(Castable castObject) { //do monster aoe }