예제 #1
0
        public ActionResult Lower(Card dealtCard, string command)
        {
            var model = new CardDecks();

            var current = new CardsInPlay();

            model.OriginalDeck = model.CreateCardDeck();

            current.DealtCard = dealtCard;
            current.PlayerCard = model.RandomCard(model.OriginalDeck);

            current.CardDisplay = new Card[2];

            current.CardDisplay[0] = current.DealtCard;
            current.CardDisplay[1] = current.PlayerCard;

            switch (CompareCards(current.CardDisplay[0], current.CardDisplay[1], command))
            {
                case 1:
                    current.Message = "It's a tie!:(";
                    break;
                case 2:
                    current.Message = "You win!";
                    break;
                case 3:
                    current.Message = "You lose!";
                    break;
            }

            return View("Lower", current);
        }
예제 #2
0
        //
        // GET: /Home/
        public ActionResult Index()
        {
            var deck = new CardDecks();

            //Session["wins"] = deck.Wins;
            //Session["losses"] = deck.Losses;
            //Session["draws"] = deck.Draws;

            var model = deck.RandomCard(deck.OriginalDeck);

            return View(model);
        }