예제 #1
0
        /// <summary>
        /// New ship class button
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void NewButton_Click(object sender, EventArgs e)
        {
            ShipClassTN oNewShipClass = new ShipClassTN("New Class", VM.CurrentFaction);
            oNewShipClass.AddCrewQuarters(_CurrnetFaction.ComponentList.CrewQuarters[0], 1);
            oNewShipClass.AddFuelStorage(_CurrnetFaction.ComponentList.FuelStorage[0], 1);
            oNewShipClass.AddEngineeringSpaces(_CurrnetFaction.ComponentList.EngineeringSpaces[0], 1);
            oNewShipClass.AddOtherComponent(_CurrnetFaction.ComponentList.OtherComponents[0], 1);

            int ArmorTech = _CurrnetFaction.FactionTechLevel[(int)Faction.FactionTechnology.ArmourProtection];

#warning throw error here if this happens instead of just capping at 12?
            if (ArmorTech > 12)
                ArmorTech = 12;

            String Title = UIConstants.Armor.ArmorTypes[ArmorTech];

            oNewShipClass.NewArmor(Title, (ushort)Constants.MagazineTN.MagArmor[ArmorTech], oNewShipClass.ShipArmorDef.depth);

            _CurrnetFaction.ShipDesigns.Add(oNewShipClass);

            m_oOptionsPanel.ClassComboBox.SelectedIndex = m_oOptionsPanel.ClassComboBox.Items.Count - 1;
            _CurrnetShipClass = _CurrnetFaction.ShipDesigns[m_oOptionsPanel.ClassComboBox.SelectedIndex];

            UpdateDisplay();


        }
예제 #2
0
        /// <summary>
        /// New ship class button
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void NewButton_Click(object sender, EventArgs e)
        {
            ShipClassTN oNewShipClass = new ShipClassTN("New Class", VM.CurrentFaction);
            oNewShipClass.AddCrewQuarters(_CurrnetFaction.ComponentList.CrewQuarters[0], 1);
            oNewShipClass.AddFuelStorage(_CurrnetFaction.ComponentList.FuelStorage[0], 1);
            oNewShipClass.AddEngineeringSpaces(_CurrnetFaction.ComponentList.EngineeringSpaces[0], 1);
            oNewShipClass.AddOtherComponent(_CurrnetFaction.ComponentList.OtherComponents[0], 1);

            int ArmorTech = _CurrnetFaction.FactionTechLevel[(int)Faction.FactionTechnology.ArmourProtection];

            if (ArmorTech > 12)
                ArmorTech = 12;
#warning more armor names to move to constants.UI
            #region Armor Tech names
            String Title = "N/A";
            switch (ArmorTech)
            {
                case 0:
                    Title = "Conventional";
                    break;
                case 1:
                    Title = "Duranium";
                    break;
                case 2:
                    Title = "High Density Duranium";
                    break;
                case 3:
                    Title = "Composite";
                    break;
                case 4:
                    Title = "Ceramic Composite";
                    break;
                case 5:
                    Title = "Laminate Composite";
                    break;
                case 6:
                    Title = "Compressed Carbon";
                    break;
                case 7:
                    Title = "Biphased Carbide";
                    break;
                case 8:
                    Title = "Crystaline Composite";
                    break;
                case 9:
                    Title = "Superdense";
                    break;
                case 10:
                    Title = "Bonded Superdense";
                    break;
                case 11:
                    Title = "Coherent Superdense";
                    break;
                case 12:
                    Title = "Collapsium";
                    break;
            }
            #endregion

            oNewShipClass.NewArmor(Title, (ushort)Constants.MagazineTN.MagArmor[ArmorTech], oNewShipClass.ShipArmorDef.depth);

            _CurrnetFaction.ShipDesigns.Add(oNewShipClass);

            m_oOptionsPanel.ClassComboBox.SelectedIndex = m_oOptionsPanel.ClassComboBox.Items.Count - 1;
            _CurrnetShipClass = _CurrnetFaction.ShipDesigns[m_oOptionsPanel.ClassComboBox.SelectedIndex];

            UpdateDisplay();


        }