Example #1
0
        /// <summary>
        /// Handles adding a new FC to the list.
        /// </summary>
        /// <param name="Comp">Fire control component to add</param>
        /// <param name="Ship">Ship the FC is on.</param>
        /// <param name="Type">Type of FC.</param>
        public void AddComponent(ComponentTN Comp, ShipTN Ship, bool Type)
        {
            if (PointDefenseFC.ContainsKey(Comp) == false)
            {
                PointDefenseFC.Add(Comp, Ship);
            }

            if (PointDefenseType.ContainsKey(Comp) == false)
            {
                PointDefenseType.Add(Comp, Type);
            }
        }
Example #2
0
        /// <summary>
        /// Handles removing an existing FC from the list.
        /// </summary>
        /// <param name="Comp">Fire control component to remove</param>
        /// <param name="Ship">Ship the FC is on.</param>
        /// <param name="Type">Type of FC.</param>
        public void RemoveComponent(ComponentTN Comp)
        {
            if (PointDefenseFC.ContainsKey(Comp) == true)
            {
                PointDefenseFC.Remove(Comp);
            }

            if (PointDefenseType.ContainsKey(Comp) == true)
            {
                PointDefenseType.Remove(Comp);
            }
        }
Example #3
0
        /// <summary>
        /// Handle Fire control selection and its various kludges.
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void SFCComboBox_SelectedIndexChanged(object sender, EventArgs e)
        {
            if (_CurrnetShip != null && m_oDetailsPanel.SFCComboBox.SelectedIndex != -1)
            {
                if (m_oDetailsPanel.SFCComboBox.SelectedIndex < _CurrnetShip.ShipBFC.Count)
                {
                    _CurrnetFC = _CurrnetShip.ShipBFC[m_oDetailsPanel.SFCComboBox.SelectedIndex];
                    isBFC = true;
                }
                else
                {
                    int newIndex = m_oDetailsPanel.SFCComboBox.SelectedIndex - _CurrnetShip.ShipBFC.Count;
                    _CurrnetFC = _CurrnetShip.ShipMFC[newIndex];
                    isBFC = false;
                }
            }

            RefreshFCInfo();
        }