예제 #1
0
        private void slotbutton_Click(object sender, EventArgs e)
        {
            int slot = int.Parse((sender as Button).Name.Substring(4, 1));

            using (PlayerSelectorForm form = new PlayerSelectorForm())
            {
                if (form.ShowDialog(this) == DialogResult.OK && form.SelectedPlayer != null)
                {
                    var player = form.SelectedPlayer;
                    slots[slot - 1] = player;
                    Button slotRemoveButton = Controls["slot" + slot + "RemoveButton"] as Button;
                    Label  slotLabel        = Controls["slot" + slot + "Label"] as Label;
                    slotLabel.Text           = player.Name;
                    slotRemoveButton.Visible = true;
                }
            }
        }
예제 #2
0
        public void PlayerMan(Player player)
        {
            PlayerSelectorForm selectorForm = new PlayerSelectorForm(_players.Values.ToArray());

            player.OpenForm(selectorForm);
        }