Exemplo n.º 1
0
        /// <summary>
        /// Refreshes cards information
        /// </summary>
        public void SetupRefreshCardInfo()
        {
            ExpansionBase main_class;

            List <CardSettingsBase> card_settings = m_settings_file.GetCardList();

            CardSetupInfo.Clear();
            for (int i = 0; i < TVComputerConstants.ExpansionCardCount; i++)
            {
                CardSetupInfo.Add(new ExpansionSetupCardInfo(string.Empty, string.Empty, i));
            }

            // add cards
            for (int i = 0; i < card_settings.Count; i++)
            {
                if (card_settings[i].SlotIndex >= 0 && card_settings[i].SlotIndex < TVComputerConstants.ExpansionCardCount && card_settings[i].Active)
                {
                    if (LoadExpansionMainClass(card_settings[i].ModuleName, out main_class))
                    {
                        ExpansionInfo expansion_info = new ExpansionInfo();

                        main_class.GetExpansionInfo(expansion_info);

                        CardSetupInfo[card_settings[i].SlotIndex] = new ExpansionSetupCardInfo(expansion_info.Description, card_settings[i].ModuleName, card_settings[i].SlotIndex);
                    }
                }
            }
        }