Exemple #1
0
        // ----------------------
        // Constructor
        // ---------------------
        public NavigationControlEffectEditor()
        {
            effect             = new NavigationControlEffect();
            possibleReferences = new List <string>();

            Controller.Instance.SelectedChapterDataControl.getObjects <GeoElement>().ForEach(g => possibleReferences.Add(g.getId()));
            Controller.Instance.SelectedChapterDataControl.getItemsList().getItems().ForEach(i => possibleReferences.Add(i.getId()));
            Controller.Instance.SelectedChapterDataControl.getAtrezzoList().getAtrezzoList().ForEach(a => possibleReferences.Add(a.getId()));
            Controller.Instance.SelectedChapterDataControl.getNPCsList().getNPCs().ForEach(npc => possibleReferences.Add(npc.getId()));
        }
        public object DOMParse(XmlElement element, params object[] parameters)
        {
            var navControlEff = new NavigationControlEffect();

            navControlEff.Type = element.GetAttribute("type").ToEnum <NavigationControlEffect.ControlType>();
            switch (navControlEff.Type)
            {
            case NavigationControlEffect.ControlType.Index:
                navControlEff.Index = int.Parse(element.GetAttribute("index"));
                break;

            case NavigationControlEffect.ControlType.ReferenceId:
                navControlEff.Reference = element.GetAttribute("reference");
                break;
            }

            return(navControlEff);
        }