Example #1
0
        public static bool SelectCard(CardColour colour, CardValue value)
        {
            int card = GetInfo.GetPlayerCardSelection();

            try
            {
                if (Deck.playerHand.Contains(Deck.playerHand[card]))
                {
                    if (Deck.playerHand[card].Colour == colour || Deck.playerHand[card].Value == value)
                    {
                        Deck.playDeck.Add(Deck.playerHand[card]);
                        Deck.playerHand.Remove(Deck.playerHand[card]);

                        return(true);
                    }
                    else
                    {
                        Console.WriteLine("That was an invalid selction. Press enter to try again");
                        return(false);
                    }
                }
            }
            catch (Exception)
            {
                Console.WriteLine("That was an invalid selction. Please try again");
                return(false);
            }

            return(false);
        }
Example #2
0
        public static void GameSetUp()
        {
            GameMessages.DisplayStart();

            GetInfo.GetPlayerName();

            Deck.CreateDoubleDeck();
            Deck.ShuffleDeck();
            Deck.CreatePlayDeck();
            Deck.DealCards();
        }
Example #3
0
        static void Main(string[] args)
        {
            bool playAgain;

            do
            {
                Console.Clear();

                GamePlay.ClearCards();

                GamePlay.GameSetUp();

                GamePlay.Play();

                playAgain = GetInfo.DoYouWantToPlayAgain();
            } while (playAgain == true);

            Console.WriteLine();
            Console.WriteLine("THANKS FOR PLAYING!");

            Console.ReadLine();
        }