示例#1
0
        /// <summary>
        /// Generates the list of the expansion cards stored in config file
        /// </summary>
        /// <returns>List of the modules</returns>
        public List <CardSettingsBase> GetCardList()
        {
            List <CardSettingsBase> cards = new List <CardSettingsBase>();

            // check if the settings exists in the XML
            if (m_xml_doc != null)
            {
                XmlElement root_node = m_xml_doc.DocumentElement;

                if (root_node != null && root_node.Name == RootElementName)
                {
                    XmlNodeList modules_node = root_node.SelectNodes('/' + RootElementName + '/' + TVCSettingsElementName + "[@Active = 'true']" + "/*");

                    for (int i = 0; i < modules_node.Count; i++)
                    {
                        CardSettingsBase settings_base = new CardSettingsBase(SettingsBase.SettingsCategory.TVC, modules_node[i].Name);

                        DeserializeEntry(modules_node[i], settings_base);

                        if (settings_base.ExpansionIndex >= 0 && settings_base.SlotIndex >= 0 && settings_base.Active)
                        {
                            cards.Add(settings_base);
                        }
                    }
                }
            }

            return(cards);
        }
示例#2
0
        /// <summary>
        /// Generates the list of the modules stored in config file
        /// </summary>
        /// <returns>List of the modules</returns>
        public List <ExpansionSettingsBase> GetExpansionList()
        {
            List <ExpansionSettingsBase> expansions = new List <ExpansionSettingsBase>();

            // check if the settings exists in the XML
            if (m_xml_doc != null)
            {
                XmlElement root_node = m_xml_doc.DocumentElement;

                if (root_node != null && root_node.Name == RootElementName)
                {
                    XmlNodeList modules_node = root_node.SelectNodes('/' + RootElementName + '/' + TVCSettingsElementName + "[@Active = 'true']" + "/*");

                    for (int i = 0; i < modules_node.Count; i++)
                    {
                        // try to deserialize card
                        CardSettingsBase card_settings = new CardSettingsBase(SettingsBase.SettingsCategory.TVC, modules_node[i].Name);

                        DeserializeEntry(modules_node[i], card_settings);

                        if (card_settings.ExpansionIndex >= 0 && card_settings.SlotIndex >= 0)
                        {
                            if (card_settings.Active)
                            {
                                expansions.Add(card_settings);
                            }
                        }
                        else
                        {
                            // this is not a card it's an expansion
                            ExpansionSettingsBase settings_base = new ExpansionSettingsBase(SettingsBase.SettingsCategory.TVC, modules_node[i].Name);

                            DeserializeEntry(modules_node[i], settings_base);

                            if (settings_base.ExpansionIndex >= 0)
                            {
                                if (settings_base.Active)
                                {
                                    expansions.Add(settings_base);
                                }
                            }
                        }
                    }
                }
            }

            return(expansions);
        }
示例#3
0
 public CardSettingsBase(CardSettingsBase in_settings_base) : base(in_settings_base.Category, in_settings_base.ModuleName)
 {
     Active         = in_settings_base.Active;
     ExpansionIndex = in_settings_base.ExpansionIndex;
     SlotIndex      = in_settings_base.SlotIndex;
 }