Beispiel #1
0
        private void btnWeapPartSavePart_Click(object sender, EventArgs e)
        {
            string Name = tbxWeapPartName.Text;
            int HP = int.Parse(nudWeapPartHP.Value.ToString());
            double Mass = Convert.ToDouble(nudWeapPartMass.Value);
            int Dmg = int.Parse(nudWeapPartWeaponDamage.Value.ToString());
            int Crit = int.Parse(nudWeapPartCritMultiplier.Value.ToString());
            int Reload = int.Parse(nudWeapPartReload.Value.ToString());
            string DamageType = cbxDamageTypes.SelectedItem.ToString();
            string FiringType = cbxFiringTypes.SelectedItem.ToString();
            double WeaponRange = double.Parse(nudWeaponRange.Value.ToString());
            Part = new WeaponPart(new Ship(), Name, HP, Mass, Dmg,WeaponRange, DamageType, FiringType, Crit, Reload, PartActions);

            Part.GetObjectXML(doc);
            doc.Save(filename);
            Part = null;
            LoadParts();
        }
Beispiel #2
0
        private void btnLoadPart_Click(object sender, EventArgs e)
        {
            Part = (ShipPart)cbxExistingParts.SelectedItem;
            if (Part is WeaponPart)
                LoadWeaponPart();
            else if (Part is DefensePart)
                LoadDefensePart();
            else if (Part is ActionPart)
                LoadActionPart();
            else if (Part is EnginePart)
                LoadEnginePart();

            Part = null;
        }
Beispiel #3
0
        private void btnDefPartSavePart_Click(object sender, EventArgs e)
        {
            string Name = tbxDefPartName.Text;
            int HP = int.Parse(nudDefPartHP.Value.ToString());
            double Mass = Convert.ToDouble(nudDefPartMass.Value);
            int DR = int.Parse(nudDefPartDR.Value.ToString());
            string Down = tbxDefPartDownAdjective.Text;
            string Pen = tbxDefPartPenetrateVerb.Text;
            Part = new DefensePart(new Ship(),Name, HP, Mass, DR, Down, Pen, PartActions);

            Part.GetObjectXML(doc);
            doc.Save(filename);
            Part = null;
            LoadParts();
        }
Beispiel #4
0
        private void btnEngPartSavePart_Click(object sender, EventArgs e)
        {
            string Name = tbxEngPartName.Text;
            int HP = int.Parse(nudEngPartHP.Value.ToString());
            double Mass = Convert.ToDouble(nudEngPartMass.Value);
            double Thrust = double.Parse(nudEngPartThrust.Value.ToString());
            Part = new EnginePart(new Ship(), Name, HP, Mass, Thrust, PartActions);

            Part.GetObjectXML(doc);
            doc.Save(filename);
            Part = null;
            LoadParts();
        }
Beispiel #5
0
        private void btnActPartSavePart_Click(object sender, EventArgs e)
        {
            string Name = tbxActPartName.Text;
            int HP = int.Parse(nudActPartHP.Value.ToString());
            double Mass = Convert.ToDouble(nudActPartMass.Value);
            string Descr = tbxActPartDescr.Text;
            Part = new ActionPart(new Ship(), Name, HP, Mass, Descr, PartActions);

            Part.GetObjectXML(doc);
            doc.Save(filename);
            Part = null;
            LoadParts();
        }