Exemplo n.º 1
0
 public IActionResult Index()
 {
     Cards = new Models.CardsModel();
     Cards.Count++;
     //switch (Cards.Count)
     //{
     //    case 1:
     //        return View(Cards);
     //    //case 6:
     //    //    Cards = CardsModel.AddCard(Cards, data);
     //    //    ScoreModel Results = ScoreModel.CalculateScore(Cards.Cards);
     //    //    if (Results.Valid)
     //    //    {
     //    //        return View("Results", Results);
     //    //    }
     //    //    else
     //    //    {
     //    //        return View("Invalid", Results);
     //    //    }
     //    //default:
     //    //    Cards = CardsModel.AddCard(Cards, data);
     //    //    return View(Cards);
     //}
     return(View(Cards));
 }
Exemplo n.º 2
0
        public IActionResult Index(List <int> data)
        {
            Cards = CardsModel.AddCard(Cards, data);

            ScoreModel Results = ScoreModel.CalculateScore(Cards.Cards);

            if (Results.Valid)
            {
                return(View("Results", Results));
            }
            else
            {
                return(View("Invalid", Results));
            }
        }
Exemplo n.º 3
0
        public static Models.CardsModel AddCard(Models.CardsModel data, int card)
        {
            data.Cards.Add(card);
            switch (data.Count)
            {
            case 2:
                data.CardNumberRequired = "second";
                break;

            case 3:
                data.CardNumberRequired = "third";
                break;

            case 4:
                data.CardNumberRequired = "fourth";
                break;

            case 5:
                data.CardNumberRequired = "fith";
                break;
            }

            return(data);
        }
Exemplo n.º 4
0
 public static Models.CardsModel AddCard(Models.CardsModel data, List <int> cards)
 {
     data.Cards.AddRange(cards);
     return(data);
 }