Example #1
0
        public void SetEnemy(string enemyName)
        {
            int index = SCommon.IndexOf(EnemyCatalog.GetNames(), enemyName);

            if (index == -1)
            {
                index = 0;                 // 2bs
            }
            this.Enemy.SelectedIndex = index;
        }
Example #2
0
        private void LevelEditorDlg_Shown(object sender, EventArgs e)
        {
            this.Tile.Items.Clear();
            this.Enemy.Items.Clear();

            foreach (string tileName in TileCatalog.GetNames())
            {
                this.Tile.Items.Add(tileName);
            }

            foreach (string enemyName in EnemyCatalog.GetNames())
            {
                this.Enemy.Items.Add(enemyName);
            }

            this.Tile.SelectedIndex  = 0;
            this.Enemy.SelectedIndex = 0;

            this.TileEnemySw.Text = TEXT_MODE_TILE;
        }
Example #3
0
        public void SetEnemy(string enemyName)
        {
            int index = SCommon.IndexOf(EnemyCatalog.GetNames(), name => name == enemyName);

            if (index == -1)
            {
                throw new DDError();
            }

            for (int groupIndex = 0; groupIndex < LevelEditor.EnemyGroups.Count; groupIndex++)
            {
                for (int memberIndex = 0; memberIndex < LevelEditor.EnemyGroups[groupIndex].Members.Count; memberIndex++)
                {
                    if (LevelEditor.EnemyGroups[groupIndex].Members[memberIndex].Index == index)
                    {
                        this.EnemyGroup.SelectedIndex  = groupIndex;
                        this.EnemyMember.SelectedIndex = memberIndex;
                        return;
                    }
                }
            }
            throw new DDError();
        }
Example #4
0
 public string GetEnemy()
 {
     return(EnemyCatalog.GetNames()[this.Enemy.SelectedIndex]);
 }
Example #5
0
 public string GetEnemy()
 {
     return(EnemyCatalog.GetNames()[LevelEditor.EnemyGroups[this.EnemyGroup.SelectedIndex].Members[this.EnemyMember.SelectedIndex].Index]);
 }