//This should return the percentage to multiply with the bet. It could be negative multiplier. private float ResolveRestingSliceValue(int _restingSlice) { //Get the user value to multiply it with the bet. return(WheelJsonHelper.GetWheelSlicesFromString(tempWheel.AllWheelSlices)[_restingSlice].userData.SliceMultiplier); }
//This will take the Admin's created wheel and store it to WheelJson property in order to store the object in DB //Admin Creates wheelSlices. //Admin wheelSlices.Save --> server.CreatedWheel = new wheel(); //Server CreatedWheel.AllWheelSlices = CreatedWheel.WheelSlices_ToString(wheelSlices); //Server.dbContext.save(CreatedWheel) ; //Admin goto wheelUI and Select active Wheel. //Done public void WheelSlices_ToString(List <WheelSliceContainer> createdSlices) { AllWheelSlices = WheelJsonHelper.AppendWheelSlices_ToString(createdSlices); }
private int GetNextRestingWheelSlice() { //Converts slices in a string to a json then deserializes and then based on the probability of each it retruns an int. return(RndGen.probabilityBasedRnd(WheelJsonHelper.GetWheelSlicesFromString(tempWheel.AllWheelSlices) .Select <WheelSliceContainer, string>(x => x.probability.ToString()).ToArray())); }
//This will provide the json to feed it to JS client public JsonResult GenerateWheelJson() { return(WheelJsonHelper.CreateClientWheel_Json(AllWheelSlices)); }