예제 #1
0
        //resets game
        public void ResetGame()
        {
            lblHumanAttacking.Visible    = true;
            lblComputerAttacking.Visible = false;
            lblHumanPlayer.Text          = myPlayerOne.getName().ToString();
            lblComputerPlayer.Text       = myPlayerTwo.getName().ToString();
            flpDeck.Controls.Clear();
            flpComputerHand.Controls.Clear();
            flpHumanHand.Controls.Clear();
            flpRiver.Controls.Clear();
            flpTrumpCard.Controls.Clear();
            flpDiscardPile.Controls.Clear();
            CardImageControl startingCardControl = new CardImageControl();

            flpDeck.Controls.Add(startingCardControl);
            myDeck               = new GameDeck(deckSize);
            myRiver              = new GameRiver();
            myHandOne            = new PlayerHand();
            myHandTwo            = new PlayerHand();
            myPlayerOne          = new Player("PlayerOne", myHandOne, true, false);
            myPlayerTwo          = new PlayerAI("PlayerTwo", myHandTwo, false, true);
            DeckDisplayList      = new CardList();
            HandOneDisplayList   = new CardList();
            HandTwoDisplayList   = new CardList();
            PlayerOneDisplayList = new CardList();
            PlayerTwoDisplayList = new CardList();
            RiverDisplayList     = new CardList();
            trumpCardDisplayList = new CardList();
            discardDisplayList   = new CardList();
            myDeck.Shuffle(deckSize);

            txtDeckCardsRemaining.Text   = myDeck.getCardsRemaining().ToString();
            txtRiverCardsRemaning.Text   = myRiver.getCardsRemaining().ToString();
            txtDicardCardsRemaining.Text = discardDisplayList.Count().ToString();
            txtRoundNumber.Text          = roundNumber.ToString();

            btnPickUp.Enabled      = false;
            btnCeaseAttack.Enabled = true;

            roundNumber = 0;
            GameLog.Log("\nNEW GAME");
            GameLog.Log("\n PlayerOne Win/Loss Ratio " + playerOneWins.ToString() + "/" + playerOneLosses.ToString());
            GameLog.Log("\n PlayerTwo Win/Loss Ratio " + playerTwoWins.ToString() + "/" + playerTwoLosses.ToString() + "\n");
        }