private void PlayBouncerButton_Click(object sender, EventArgs e) { List <int> selectedIndices = SelectEndlessOneDialog.SelectEndlessOneIndicesFromDialog( mPlayer.EnemyEndlessOneList, false, mPlayer.BouncerName + "の対象を選択"); if (selectedIndices.Count > 0) { mPlayer.PlayBouncer(selectedIndices[0]); PlayerDoSomething?.Invoke(this, EventArgs.Empty); } }
static public List <int> SelectEndlessOneIndicesFromDialog( List <EndlessOne> srcEndlessOneList, bool multiSelect, String infoText) { var dialog = new SelectEndlessOneDialog(srcEndlessOneList); dialog.mListView.MultiSelect = multiSelect; dialog.InfoText = infoText; dialog.ShowDialog(); List <int> selected = dialog.mSelectedIndices; dialog.Dispose(); return(selected); }