Ejemplo n.º 1
0
        public void startHand()
        {
            //Initialize gamewindow
            gamewindow = currentgame.getGameWindow();
            //Shuffle the deck on starthand
            getDeck().shuffleDeck();
            //Pick two cards from the top of the deck and give them to the players
            currentgame.getPlayer().addToHand(getDeck().getTopCard());
            currentgame.getPlayer().addToHand(getDeck().getTopCard());
            currentgame.getAiPlayer().addToHand(getDeck().getTopCard());
            currentgame.getAiPlayer().addToHand(getDeck().getTopCard());
            //Get the two cards from the starthand of the player
            Card playercard1 = currentgame.getPlayer().getHand()[0];
            Card playercard2 = currentgame.getPlayer().getHand()[1];

            Console.WriteLine("Human player cards:");
            Console.WriteLine(playercard1.getValue() + playercard1.getSuit());
            Console.WriteLine(playercard2.getValue() + playercard2.getSuit());
            Card aiplayercard1 = currentgame.getAiPlayer().getHand()[0];
            Card aiplayercard2 = currentgame.getAiPlayer().getHand()[1];

            Console.WriteLine("AI player cards: ");
            Console.WriteLine(aiplayercard1.getValue() + aiplayercard1.getSuit());
            Console.WriteLine(aiplayercard2.getValue() + aiplayercard2.getSuit());

            //Add filepath of each card
            string file_playercard1   = playercard1.getValue() + "of" + playercard1.getSuit() + ".png";
            string file_playercard2   = playercard2.getValue() + "of" + playercard2.getSuit() + ".png";
            string path_playercard1   = Path.Combine(path, file_playercard1);
            string path_playercard2   = Path.Combine(path, file_playercard2);
            string file_aiplayercard1 = aiplayercard1.getValue() + "of" + aiplayercard1.getSuit() + ".png";
            string file_aiplayercard2 = aiplayercard2.getValue() + "of" + aiplayercard2.getSuit() + ".png";
            string path_aiplayercard1 = Path.Combine(path, file_aiplayercard1);
            string path_aiplayercard2 = Path.Combine(path, file_aiplayercard2);

            gamewindow.changePictureBox(gamewindow.player_card1, path_playercard1);
            gamewindow.changePictureBox(gamewindow.player_card2, path_playercard2);
            gamewindow.changePictureBox(gamewindow.ai_card1, path_aiplayercard1);
            gamewindow.changePictureBox(gamewindow.ai_card2, path_aiplayercard2);
            currentgame.playSession("player");
        }
Ejemplo n.º 2
0
        public void river()
        {
            //Pick a card from the top of the deck and set rivercard as that card so we can access it later.
            rivercard = getDeck().getTopCard();

            //Add filepath for that card
            string file_river     = rivercard.getValue() + "of" + rivercard.getSuit() + ".png";
            string filepath_river = Path.Combine(path, file_river);

            //Return the filepath
            gamewindow.changePictureBox(gamewindow.river, filepath_river);
        }