Пример #1
0
        private void lstEnemies_MouseDoubleClick(object sender, MouseEventArgs e)
        {
            if (lstEnemies.SelectedIndex > -1)
            {
                DataTypes.EnemyProfile EditEnemy = new DataTypes.EnemyProfile();
                EditEnemy = Event.Enemies[lstEnemies.SelectedIndex];
                frmEnemyEditor NewForm = new frmEnemyEditor(EditEnemy);
                NewForm.ShowDialog();

                EditEnemy = NewForm.Enemy;
                Event.Enemies[lstEnemies.SelectedIndex] = (EditEnemy);
                GetAllEnemies();
            }
        }
Пример #2
0
        private void cmdAddEnemy_Click(object sender, EventArgs e)
        {
            DataTypes.EnemyProfile NewEnemy = new DataTypes.EnemyProfile();
            frmEnemyEditor         NewForm  = new frmEnemyEditor(NewEnemy);

            NewForm.ShowDialog();

            NewEnemy = NewForm.Enemy;
            if (NewEnemy.name != null)
            {
                if (Event.Enemies == null)
                {
                    Event.Enemies = new List <DataTypes.EnemyProfile>();
                }
                Event.Enemies.Add(NewEnemy);
            }
            GetAllEnemies();
        }