Beispiel #1
0
        private void AddMonster()
        {
            var selectedIndex = listBox.SelectedIndex;
            var location      = new TileLocation(0, 0);

            if (selectedIndex > -1)
            {
                location = _owner.Level.MonsterLocations[selectedIndex];
            }
            using (var dialog = new AddMonsterDialog(location))
                if (dialog.ShowDialog() == DialogResult.OK)
                {
                    _owner.AddMonster(dialog.TileLocation);
                    listBox.SelectedIndex = _owner.Level.MonsterLocations.Count - 1;
                    UpdateTitle();
                }
        }