Пример #1
0
        public shipyardForm(List<Ship> inShipList, List<Weapon> inWeaponList, Character inPlayer)
        {
            ShipList = inShipList;
            WeaponList = inWeaponList;
            Player = inPlayer;

            InitializeComponent();

            // disable maximize button
            this.MaximizeBox = false;

            // Fill ship combobox
            foreach (Ship s in ShipList)
            {
                shipComboBox.Items.Add(s.Name);
            }

            shipComboBox.SelectedIndex = 0;
            // Fill weapon combobox
            foreach (Weapon s in WeaponList)
            {
                weaponComboBox.Items.Add(s.Name);
            }

            weaponComboBox.SelectedIndex = 0;
        }
Пример #2
0
        public FactoryForm(Character inPlayer)
        {
            Player = inPlayer;

            InitializeComponent();

            // disable maximize button
            this.MaximizeBox = false;

            UpdateLabels();
            UpdateCargoListBox();
        }
Пример #3
0
        // starts a new game with the player with cash and upgraded to the level 5 weapon and ship
        private void quickStartToolStripMenuItem_Click(object sender, EventArgs e)
        {
            // Ensure timer thread suspended
            if ((patrolThread.ThreadState == System.Threading.ThreadState.WaitSleepJoin)
                || (patrolThread.ThreadState == System.Threading.ThreadState.Running))
            {
                patrolThread.Suspend();
            }

            try
            {
                Player = new Character("Bruce C. Miller", 200.00f, WeaponList.ToArray()[4], ShipList.ToArray()[4].Copy());
                inPort = true;
                inCombat = false;
                isDead = false;
                gameStarted = true;

                statusTextBox.Clear();
                AddStatusLine("New Quickstart Game Started!");
                AddStatusLine("You are docked at Hyannis Port, Massachusetts in the Nantucket Sound.");

                UpdateLabels();
                UpdateControls();
            }
            catch (Exception ex)
            {
                MessageBox.Show("Resource Corruption: " + ex.Message);
                statusToolStripStatusLabel.ForeColor = Color.Red;
                statusToolStripStatusLabel.Text = "Resource Corruption!";
            }
        }