Exemplo n.º 1
0
        public void Play()
        {
            SetUpGame();

            for (var turn = 0; turn < turnNumber; turn++)
            {
                foreach (Player player in players)
                {
                    Console.Clear();

                    Console.WriteLine("Ready " + player.name);

                    WaitForEnter();

                    Console.Clear();

                    Console.WriteLine(player.name + " turn: " + (turn + 1));

                    player.DisplayHand();

                    WaitForEnter();

                    Discarding(player);
                }
            }

            //preparing end game
            var finalHands = new Hand[numberPlayers];

            for (var i = 0; i < numberPlayers; i++)
            {
                finalHands[i] = players[i].hand;
            }
            CalculateScore.RemoveFaceCards(finalHands, deck);

            foreach (Player player in players)
            {
                GameOver(player);
            }

            Console.ForegroundColor = ConsoleColor.Green;
            var winner = DetermineWinner.WhoWon(players);

            WaitForEnter();


            ScrollingText.ScrollUp(winner.name + " won! with points: " + winner.currentScore + "\n");
            ScrollingText.ScrollUp(winner.name + " won! with points: " + winner.currentScore + "\n");

            Console.ForegroundColor = ConsoleColor.White;
            Console.WriteLine("Bye, bye now.");

            WaitForEnter();
        }
Exemplo n.º 2
0
 public void DiscardSingleCardByValue(int value, Deck deck)
 {
     foreach (Card card in cards)
     {
         if (card.value == value)
         {
             DiscardSingleCard(card, deck);
             ScrollingText.ScrollUp("Royal Family Assassination: " + card.name);
             return;
         }
     }
 }
Exemplo n.º 3
0
        public static void Main(string[] args)
        {
            //40[] in writeLine

            Console.WriteLine("\t\t\tCliff's Game");
            Game.WaitForEnter();

            ScrollingText.ScrollUp("Cliff's Game");
            ScrollingText.ScrollUp("Programmed by Isaac Colson");

            var game = new Game();

            game.Play();
        }
Exemplo n.º 4
0
        public void SetUpGame()
        {
            Console.WriteLine("Press Enter to Shuffle and Deal out 8 cards per player.");

            WaitForEnter();

            //Initial Set Up
            deck.Shuffle();

            ScrollingText.ScrollUp("Shuffle shuffle shuffle");

            foreach (Player player in players)
            {
                //Deal
                player.hand = deck.Deal(handLimit);

                //Sort
                player.hand = Hand.SortHand(player.hand);
            }

            ScrollingText.ScrollUp("Deal deal deal");
        }