Beispiel #1
0
        public IActionResult IndexPost(string Pin)
        {
            if (ModelState.IsValid)
            {
                Game.Roll(Convert.ToInt32(Pin));
            }

            frames = Game.Scores();
            var framesView = FrameViewBuilder.FrameView(frames);
            var frame      = framesView.Find(f => f.IsReset == true && f.FrameId == 10);

            if (frame != null && frame.IsReset)
            {
                TempData[Keys.IsVisible] = false;
            }

            return(View(framesView));
        }
Beispiel #2
0
        public IActionResult Index()
        {
            var reset = false;

            TempData[Keys.IsVisible] = true;

            if (TempData.ContainsKey(Keys.Reset))
            {
                reset = Convert.ToBoolean(TempData[Keys.Reset]);
            }

            if (reset)
            {
                _cacheProvider.ClearCache(Keys.Frames);
            }

            Game   = new Game(_cacheProvider);
            frames = Game.Scores();
            return(View(FrameViewBuilder.FrameView(frames)));
        }