public override void LoadReference() { if (XmlSpriteReference != null && XmlSpriteReference.Sprite == null) { XmlSpriteReference.LoadReference(); } }
internal override void LoadFromXml(XElement xRoot) { /*if (xRoot != null && xRoot.Attribute(XmlConstants.Type).Value == XmlConstants.XmlPointToBrickType) { PointedXmlSpriteReference = new XmlSpriteReference(xRoot.Element(XmlConstants.Object));//.Element(XmlConstants.XmlPointToBrickType)); }*/ if (xRoot.Element(XmlConstants.PointedObject) != null) PointedXmlSpriteReference = new XmlSpriteReference(xRoot.Element(XmlConstants.PointedObject)); }
internal override void LoadFromXml(XElement xRoot) { /*if (xRoot != null && xRoot.Attribute(XmlConstants.Type).Value == XmlConstants.XmlPointToBrickType) * { * PointedXmlSpriteReference = new XmlSpriteReference(xRoot.Element(XmlConstants.Object));//.Element(XmlConstants.XmlPointToBrickType)); * }*/ if (xRoot.Element(XmlConstants.PointedObject) != null) { PointedXmlSpriteReference = new XmlSpriteReference(xRoot.Element(XmlConstants.PointedObject)); } }
internal override XElement CreateXml() { var xRoot = new XElement(XmlConstants.Entry); xRoot.Add(XmlSpriteReference.CreateXml()); if (VariableList.UserVariables.Count > 0) { xRoot.Add(VariableList.CreateXml()); } return(xRoot); }
private static string GetSpriteReferenceString(XmlSpriteReference xmlSpriteReference) { var sprite = xmlSpriteReference.Sprite; var count = 0; foreach (var tempSprite in XmlParserTempProjectHelper.Program.SpriteList.Sprites) { count++; if (tempSprite == sprite) { break; } } foreach (var tempSprite in XmlParserTempProjectHelper.Program.SpriteList.Sprites) { foreach (var script in tempSprite.Scripts.Scripts) { foreach (var brick in script.Bricks.Bricks) { if (brick is XmlPointToBrick) { var pointToBrick = brick as XmlPointToBrick; if ((pointToBrick.PointedXmlSpriteReference == xmlSpriteReference) && (count == 1)) { return("../../../../../../object"); } else if (pointToBrick.PointedXmlSpriteReference == xmlSpriteReference) { return("../../../../../../object[" + count + "]"); } } } } } foreach (var entry in XmlParserTempProjectHelper.Program.VariableList.ObjectVariableList.ObjectVariableEntries) { if ((entry.XmlSpriteReference == xmlSpriteReference) && (count == 1)) { return("../../../../objectList/object"); } else if (entry.XmlSpriteReference == xmlSpriteReference) { return("../../../../objectList/object[" + count + "]"); } } return(""); }
internal override void LoadFromXml(XElement xRoot) { XmlSpriteReference = new XmlSpriteReference(xRoot.Element(XmlConstants.Object)); VariableList = new XmlUserVariableList(xRoot.Element(XmlConstants.List)); }
internal override void LoadFromXml(XElement xRoot) { XmlSpriteReference = new XmlSpriteReference(xRoot.Element(XmlConstants.Object)); VariableList = new XmlUserVariableList(xRoot.Element(XmlConstants.List)); }