Beispiel #1
0
        public ActionResult AddSlice()
        {
            var tempSlice = new WheelSliceContainer();

            tempWheels.Add(tempSlice);
            return(PartialView("WheelSlice", tempSlice));
        }
Beispiel #2
0
        public SpinTheWheelController(ApplicationDbContext applicationDbContext, SignInManager <ApplicationUser> signInManager)
        {
            _applicationDbContext = applicationDbContext;
            _signInManager        = signInManager;

            //should be replcaed with DB.getCurrentWHeel.
            tempWheel = new Wheel();

            #region Code that should execute when admin creates and saves a wheel. MOVE IT AWAY FROM HERE.
            //Mock Data. This should be Generated by the Admin.CreateWheels UI.
            List <WheelSliceContainer> createdSlices = new List <WheelSliceContainer>();
            var lol = new WheelSliceContainer()
            {
                probability = 25, resultText = "Wow, you won!", type = "string", userData = new WheelSlice_UserData()
                {
                    SliceMultiplier = 2
                }, value = "Win x2", win = true
            };
            var lol1 = new WheelSliceContainer()
            {
                probability = 25, resultText = "Yay, you won!", type = "string", userData = new WheelSlice_UserData()
                {
                    SliceMultiplier = 3
                }, value = "Win x3", win = true
            };
            var lol2 = new WheelSliceContainer()
            {
                probability = 25, resultText = "Oh noes! Better luck next Roll", type = "string", userData = new WheelSlice_UserData()
                {
                    SliceMultiplier = -1
                }, value = "Loose placed amount", win = false
            };
            var lol3 = new WheelSliceContainer()
            {
                probability = 25, resultText = "Oops! Try again?", type = "string", userData = new WheelSlice_UserData()
                {
                    SliceMultiplier = -1
                }, value = "Loose placed amount", win = false
            };
            createdSlices.AddRange(new WheelSliceContainer[] { lol, lol1, lol2, lol3, lol1, lol3 });
            tempWheel.Id = 1;
            tempWheel.WheelSlices_ToString(createdSlices);
            #endregion
        }