private static BuyReelSummaryData BuyReel(int level, int purchaseReel, ReelGemResult priorSpinResult) { var summData = new BuyReelSummaryData { TotalBet = 0, IsContinuosBuyReel = true, SpinCounter = 1 }; var user = new UserGameKey(-1, GameId) { Level = level }; var requestContext = user.CreateRequestContext <SpinArgs>("monkeysmash"); var bonusRequestcontext = user.CreateRequestContext <BonusArgs>("monkeysmash"); requestContext.Parameters = new SpinArgs { LineBet = 1, Multiplier = 1 }; summData.TotalBet = priorSpinResult.ReelRespinCredits[purchaseReel]; var result = ReelGemsEngine.BuyReel(level, purchaseReel, priorSpinResult, requestContext); summData.TotalWin = result.Win; if (result.HasBonus) { var freeSpinResult = ExecuteFreeSpin(level, bonusRequestcontext, result); summData.FSTotalWin += freeSpinResult.TotalWin; summData.IsContinuosBuyReel = false; } return(summData); }
public void ReSpinMode(int level, int purchaseReel, int numItrPerUser, string stringWheel) { var sdt = DateTime.Now; var summData = new SummaryData { SpinCounter = numItrPerUser, TotalBet = 0 }; var spin = new SpinArgs { LineBet = 1, Multiplier = 1 }; var user = new UserGameKey(-1, GameId) { Level = level }; var requestContext = user.CreateRequestContext <SpinArgs>("monkeysmash"); requestContext.Parameters = spin; var bonusRequestcontext = user.CreateRequestContext <BonusArgs>("monkeysmash"); var reels = Utilities.Encoding(stringWheel); var priorSpinResult = new ReelGemResult() { Wheel = Utilities.Encoding(stringWheel, 5, 3), ReelRespinCredits = ReelGemsEngine.CalcWagerCost(level, reels) }; foreach (var item in new sbyte[numItrPerUser]) { summData.TotalBet += priorSpinResult.ReelRespinCredits[purchaseReel]; var result = ReelGemsEngine.BuyReel(level, purchaseReel, priorSpinResult, requestContext); Assert.NotNull(result); summData.TotalWin += result.Win; if (result.HasBonus) { var freeSpinResult = ExecuteFreeSpin(level, bonusRequestcontext, result); summData.FSTotalWin += freeSpinResult.TotalWin; } } PrintResult(level, sdt, DateTime.Now, summData, TestContext.CurrentContext.Test.Name); }