public IActionResult ChickenFight()
        {
            CFViewModel.fight = new Fight();
            CFViewModel model   = new CFViewModel();
            User        newUser = new User();

            try{
                newUser = HttpContext.Session.Get <User>("currentUser");
                newUser.Equals("check");
            }
            catch
            {
                return(RedirectToAction("Login", "User"));
            }

            ViewData["game"] = "bet";

            return(View(model));
        }
        public IActionResult ChickenFight(CFViewModel model, IFormCollection collection, string submitButton)
        {
            model = new CFViewModel();

            ChipHelper ch = new ChipHelper();

            foreach (var item in (new Pocket()).AllChips)
            {
                int intThrow;
                if (Int32.TryParse(collection[item.Type], out intThrow))
                {
                    CFViewModel.fight.GamePocket.AllChips.Add(new Chips()
                    {
                        Amount = Int32.Parse(collection[item.Type]), Type = item.Type
                    });
                }
            }

            ch.pocketSubtraction(model.User.UserPocket, CFViewModel.fight.GamePocket);


            if (submitButton.Equals("bet"))
            {
                foreach (var item in CFViewModel.fight.GamePocket.AllChips)
                {
                    if (item.Amount > 0)
                    {
                        model.Bet.Add(item.Type, item.Amount);
                    }
                }
                model.User.UserPocket.AllChips[0].Amount = 237;
                model.User.UserPocket.AllChips[1].Amount = 314;
                model.User.UserPocket.AllChips[2].Amount = 5798;
                model.User.UserPocket.AllChips[3].Amount = 221;
            }
            else
            {
                model.Bet = HttpContext.Session.Get <IDictionary <string, int> >("bet");

                model.User.UserPocket.AllChips = HttpContext.Session.Get <List <Chips> >("chips");
            }


            if (submitButton == "chickenA")
            {
                CFViewModel.fight.PlaceBetA();
            }
            if (submitButton == "chickenB")
            {
                CFViewModel.fight.PlaceBetB();
            }
            if (submitButton == "chickenA" || submitButton == "chickenB")
            {
                CFViewModel.fight.Engage();
            }

            ViewData["game"] = CFViewModel.fight.status;
            HttpContext.Session.Set <IDictionary <string, int> >("bet", model.Bet);

            if (submitButton.Equals("play"))
            {
                CFViewModel.fight = new Fight();
                CFViewModel x       = new CFViewModel();
                User        newUser = new User();

                try
                {
                    newUser = HttpContext.Session.Get <User>("currentUser");
                    newUser.Equals("check");
                }
                catch
                {
                    return(RedirectToAction("Login", "User"));
                }
                return(View(x));
            }

            //TempData.Put("model", model);

            //HttpContext.Session.Set<List<Chips>>("chips", model.User.UserPocket.AllChips);

            return(View(model));
        }