예제 #1
0
        private void RemoveCurrentMonster()
        {
            var index = listBox.SelectedIndex;

            if (index > -1)
            {
                listBox.BeginUpdate();
                _owner.RemoveMonsterAt(index);
                if (index < _owner.Level.MonsterLocations.Count)
                {
                    listBox.SelectedIndex = index;
                }
                else if (index > 0)
                {
                    listBox.SelectedIndex = index - 1;
                }
                listBox.EndUpdate();
            }
            UpdateTitle();
        }