Beispiel #1
0
        public void Init()
        {
            score     = 0;
            roundType = 0;
            president = 0;

            fourburn  = false;
            passTimes = 0;

            leftWin   = false;
            rightWin  = false;
            playerWin = false;
            won       = false;

            playerCards = new List <Card>();
            rightCards  = new List <Card>();
            leftCards   = new List <Card>();
            deckLogic   = new DeckLogic();
            for (int i = 0; i < 52; i++)
            {
                if (i <= 17)
                {
                    playerCards.Add(deckLogic.getdeck.cardsA[i]);
                }
                else if (i <= 34)
                {
                    rightCards.Add(deckLogic.getdeck.cardsA[i]);
                }
                else if (i <= 51)
                {
                    leftCards.Add(deckLogic.getdeck.cardsA[i]);
                }
            }



            KupaUI kupaUI = gameBoard.KupaUI;

            kupaLogic = new KupaLogic(kupaUI);

            ComputerHand computerHandRight = gameBoard.RightHand;

            compLogicRight = new ComputerLogic(computerHandRight);
            compLogicRight.AddCardsToComputerHand(rightCards);


            ComputerHand computerHandLeft = gameBoard.LeftHand;

            compLogicLeft = new ComputerLogic(computerHandLeft);
            compLogicLeft.AddCardsToComputerHand(leftCards);

            PlayerHand playerHand = gameBoard.PlayerHand;

            playerLogic = new PlayerLogic(playerHand);
            playerLogic.AddCardsToPlayerHand(playerCards);

            playerLogic.PlayerCardsClickable = false;
            playerLogic.HighestCardType      = Card.CardTypeEnum.Ace;
        }
Beispiel #2
0
        private void ResetBoard()
        {
            gameBoard.btnShowHide.Enabled = false;
            won       = false;
            roundType = 0; //save

            president = 0;

            fourburn  = false; //save
            passTimes = 0;     //save

            leftWin   = false;
            rightWin  = false;
            playerWin = false;

            playerCards = new List <Card>(); //save
            rightCards  = new List <Card>(); //save
            leftCards   = new List <Card>(); //save
            deckLogic   = new DeckLogic();   //save

            gameBoard.btnStart.Enabled      = true;
            gameBoard.btnPlayerDone.Enabled = false;

            for (int i = 0; i < 52; i++)
            {
                if (i <= 17)
                {
                    playerCards.Add(deckLogic.getdeck.cardsA[i]);
                }
                else if (i <= 34)
                {
                    rightCards.Add(deckLogic.getdeck.cardsA[i]);
                }
                else if (i <= 51)
                {
                    leftCards.Add(deckLogic.getdeck.cardsA[i]);
                }
            }

            kupaLogic.DeleteAllKupaCards();
            KupaUI kupaUI = gameBoard.KupaUI;

            kupaLogic = new KupaLogic(kupaUI);

            ComputerHand computerHandRight = gameBoard.RightHand;

            compLogicRight = new ComputerLogic(computerHandRight);
            compLogicRight.AddCardsToComputerHand(rightCards);


            ComputerHand computerHandLeft = gameBoard.LeftHand;

            compLogicLeft = new ComputerLogic(computerHandLeft);
            compLogicLeft.AddCardsToComputerHand(leftCards);

            PlayerHand playerHand = gameBoard.PlayerHand;

            playerLogic = new PlayerLogic(playerHand);
            playerLogic.AddCardsToPlayerHand(playerCards);

            playerLogic.PlayerCardsClickable = false;

            gameBoard.txtMessages.Text        = "";
            gameBoard.lblPlayerNameLabel.Text = "";

            gameBoard.Refresh();
        }