예제 #1
0
        private void GetGinner()
        {
            int isplayer = _BJController.GetWinner();

            if (isplayer == 0)
            {
                lbl_playerWin.Show();
            }
            else if (isplayer == 1)
            {
                lbl_playerWin.Show();
                lbl_pcWin.Show();
            }
            else
            {
                lbl_pcWin.Show();
            }
            btn_MainMenu.Show();
            Btn_newGame.Show();
        }
예제 #2
0
        private void NewGame()
        {
            btn_getCard.Show();
            btn_enought.Show();
            lbl_playerWin.Hide();
            lbl_pcWin.Hide();
            btn_MainMenu.Hide();
            Btn_newGame.Hide();

            if (_playerHand_PBx.Count == 0 || _PCHand_PBx.Count == 0)
            {
                createPBList();
            }

            else
            {
                for (int i = 0; i < _playerHand_PBx.Count; i++)
                {
                    _playerHand_PBx[i].Image = null;
                    _PCHand_PBx[i].Image     = null;
                }
            }


            _BJController.StartNewGame();

            int pbx_index = FoundEmptyPbox(_playerHand_PBx);

            _playerHand_PBx[pbx_index].Image = GetImage(_BJController.GetCard());

            _BJController.GetPCCard();
            pbx_index = FoundEmptyPbox(_PCHand_PBx);
            using (FileStream fs = new FileStream(@"E:\\C#\\BlackJack\\Resourses\\Deck\\shirt.png", FileMode.Open))
            {
                _PCHand_PBx[pbx_index].Image = System.Drawing.Image.FromStream(fs);
            }
        }