Esempio n. 1
0
        public static TimeAnimationStruct fromXML(XmlElement animationElement)
        {
            TimeAnimationStruct str = new TimeAnimationStruct();

            str.animationName = animationElement.FirstChild.Value;
            str.time          = int.Parse(animationElement.GetAttribute("time"));
            return(str);
        }
Esempio n. 2
0
        public static BeingController fromXML(XmlElement element, Game gameref)
        {
            BeingController controller = new BeingController();

            controller.entranceMS          = int.Parse(element.GetAttribute("entranceMS"));
            controller.startDepth          = int.Parse(element.GetAttribute("startDepth"));
            controller.animationController = gameref.animationManager.getController(element.GetAttribute("animationName"));
            foreach (XmlElement locElement in element.GetElementsByTagName("startLocation"))
            {
                controller.startLocation = XMLUtil.fromXMLVector2(locElement);
            }
            foreach (XmlElement animationElement in element.GetElementsByTagName("timeAnimationStruct"))
            {
                controller.animations.Add(TimeAnimationStruct.fromXML(animationElement));
            }
            foreach (XmlElement actionElement in element.GetElementsByTagName("action"))
            {
                controller.actions.Add(ActionStruct.fromXML(actionElement));
            }
            return(controller);
        }