Пример #1
0
        public static AudioElement fromXML(XmlNode audioSegment)
        {
            AudioElement element = new AudioElement();

            foreach (XmlNode subnode in audioSegment.ChildNodes)
            {
                if (subnode.Name.Equals("audioPath"))
                {
                    element.audioPath = subnode.FirstChild.Value;
                }
                else if (subnode.Name.Equals("startTime"))
                {
                    element.startTime = int.Parse(subnode.FirstChild.Value);
                }
            }
            return(element);
        }
Пример #2
0
        public static StoryElement fromXML(XmlNode node, Game gameref)
        {
            StoryElement element = new StoryElement();

            element.pathSegments     = new List <CameraPathSegment>();
            element.audioElements    = new List <AudioElement>();
            element.beingControllers = new List <BeingController>();
            foreach (XmlNode subnode in node.ChildNodes)
            {
                if (subnode.Name.Equals("aveXTrigger"))
                {
                    element.aveXTrigger = int.Parse(subnode.FirstChild.Value);
                }
                else if (subnode.Name.Equals("startX"))
                {
                    element.startX = float.Parse(subnode.FirstChild.Value);
                }
                else if (subnode.Name.Equals("cutsceneLength"))
                {
                    element.cutsceneLength = int.Parse(subnode.FirstChild.Value);
                }
                else if (subnode.Name.Equals("pathSegments"))
                {
                    foreach (XmlNode pathSegment in subnode.ChildNodes)
                    {
                        element.pathSegments.Add(CameraPathSegment.fromXML(pathSegment));
                    }
                }
                else if (subnode.Name.Equals("audioElements"))
                {
                    foreach (XmlNode audioSegment in subnode.ChildNodes)
                    {
                        element.audioElements.Add(AudioElement.fromXML(audioSegment));
                    }
                }
                else if (subnode.Name.Equals("animations"))
                {
                    foreach (XmlElement anim in subnode.ChildNodes)
                    {
                        element.beingControllers.Add(BeingController.fromXML(anim, gameref));
                    }
                }
            }
            return(element);
        }