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

            if (index == -1)
            {
                index = 0;                 // 2bs
            }
            this.Enemy.SelectedIndex = index;
        }
예제 #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;
        }
예제 #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();
        }
예제 #4
0
 public string GetEnemy()
 {
     return(EnemyCatalog.GetNames()[this.Enemy.SelectedIndex]);
 }
예제 #5
0
 public string GetEnemy()
 {
     return(EnemyCatalog.GetNames()[LevelEditor.EnemyGroups[this.EnemyGroup.SelectedIndex].Members[this.EnemyMember.SelectedIndex].Index]);
 }