private static SummaryData ExecuteMainGameCollapsing(int level, RequestContext <BonusArgs> bonusRequestcontext, WolvesResult result) { var bonus = module.CreateBonus(result); var summData = new SummaryData(); var freeSpinBonus = bonus.Value as WolvesBonus; do { var freeSpinResult = BonusReducer.dispatch(level, freeSpinBonus, bonusRequestcontext) as WolvesSeqFreeSpinResult; summData.MgRollingWin += freeSpinResult.Win; if (freeSpinResult.SpinResult.HasBonus) { if (freeSpinResult.SpinResult.Bonus.ClientId == 4) { summData.MgFHit++; summData += ExecuteFreeSpin(level, bonusRequestcontext, freeSpinResult.SpinResult); break; } } if (freeSpinResult.IsCompleted) { break; } freeSpinBonus = freeSpinResult.Bonus as WolvesBonus; } while (true); return(summData); }
private static SummaryData ExecuteFreeSpin(int level, RequestContext <BonusArgs> bonusRequestcontext, SevenWondersResult result) { var bonus = module.CreateBonus(result); var summData = new SummaryData(); var sevenWondersBonus = bonus.Value as SevenWondersBonus; ISevenWondersAction action(BonusState state) { return(new FreeSpinAction(level, bonusRequestcontext.Platform, sevenWondersBonus.SpinBet)); } do { summData.FSpinCounter++; var freeSpinResult = BonusReducer.Dispatch(sevenWondersBonus, action); summData.FSTotalWin += freeSpinResult.Win; if (freeSpinResult.SpinResult.HasBonus) { summData.FgFHit++; } if (freeSpinResult.IsCompleted) { break; } } while (true); return(summData); }
private static SummaryData ExecuteFreeSpinBonus(int level, RequestContext <BonusArgs> requestContext, BikiniBeachResult result) { var bonus = module.CreateBonus(result); var bikiniBeachBonus = bonus.Value as BikiniBeachBonus; var summData = new SummaryData(); IBikiniBeachAction action(BonusState state) { switch (state) { default: return(new FreeSpinAction(level, requestContext.Platform, bikiniBeachBonus.SpinBet, () => Config.FreeGameReelStrip)); } } do { var bonusSpinResult = BonusReducer.Dispatch(bikiniBeachBonus, action); summData.FSpinCounter++; summData.FSTotalWin += bonusSpinResult.Win; if (bonusSpinResult.IsCompleted) { break; } bikiniBeachBonus = bonusSpinResult.Bonus as BikiniBeachBonus; } while (true); return(summData); }
private static decimal ExecuteBonus(int level, RequestContext <BonusArgs> requestContext, BikiniBeachResult result) { var bonus = module.CreateBonus(result); var bikiniBeachBonus = bonus.Value as BikiniBeachBonus; var accumulate = 0m; IBikiniBeachAction action(BonusState state) { switch (state) { case SwimWear _: return(new SwimWearAction(level, requestContext.Platform, bikiniBeachBonus.SpinBet)); default: return(new BodyPartChooseAction(level, requestContext.Platform, bikiniBeachBonus.SpinBet, requestContext.Parameters.Param)); } } do { var bonusSpinResult = BonusReducer.Dispatch(bikiniBeachBonus, action); accumulate += bonusSpinResult.Win; if (bonusSpinResult.IsCompleted) { break; } bikiniBeachBonus = bonusSpinResult.Bonus as BikiniBeachBonus; } while (true); return(accumulate); }
private static SummaryData ExecuteFreeSpin(int level, RequestContext <BonusArgs> bonusRequestcontext, WolvesResult result) { var bonus = module.CreateBonus(result); var summData = new SummaryData(); var freeSpinBonus = bonus.Value as WolvesBonus; var totalFreeSpin = 0; var fscouter = 0; switch (result.Wheel.Reels.Sum(ele => ele.Count(item => item == 9))) { case 3: totalFreeSpin = 10; break; case 4: totalFreeSpin = 15; break; case 5: totalFreeSpin = 20; break; } do { var freeSpinResult = BonusReducer.dispatch(level, freeSpinBonus, bonusRequestcontext) as WolvesSeqFreeSpinResult; var spinResult = freeSpinResult.SpinResult; if (spinResult.Wheel.Type == 4) { summData.FgRollingWin += spinResult.Win; } else { summData.FSpinCounter++; fscouter++; summData.FSTotalWin += spinResult.Win; } if (spinResult.HasBonus) { summData.FgRollingHit++; Assert.True(spinResult.Win > 0); } if (freeSpinResult.IsCompleted) { break; } freeSpinBonus = freeSpinResult.Bonus as WolvesBonus; } while (true); Assert.AreEqual(totalFreeSpin, fscouter); return(summData); }
private static SummaryData ExecuteMainGameHoney(int level, RequestContext <BonusArgs> bonusRequestcontext, BearResult result) { var bonus = module.CreateBonus(result); var summData = new SummaryData(); var freeSpinBonus = bonus.Value as BearBonus; do { var freeSpinResult = BonusReducer.dispatch(level, freeSpinBonus, bonusRequestcontext); summData.MgHoneyWin += freeSpinResult.Win; if (freeSpinResult.IsCompleted) { break; } freeSpinBonus = freeSpinResult.Bonus as BearBonus; } while (true); return(summData); }
private static SummaryData ExecuteFreeSpin(int level, RequestContext <BonusArgs> bonusRequestcontext, BearResult result) { var bonus = module.CreateBonus(result); var summData = new SummaryData(); var freeSpinBonus = bonus.Value as BearBonus; do { summData.FSpinCounter++; var freeSpinResult = BonusReducer.dispatch(level, freeSpinBonus, bonusRequestcontext); var spinResult = freeSpinResult.SpinResult; if (spinResult.HasBonus) { var additionBonus = spinResult.Bonus; if (additionBonus.ClientId == 4) { summData.FgHoneyHit++; } else if (additionBonus.ClientId == 3) { summData.FgFHit++; } } if (spinResult.Type == "b") { summData.FgHoneyWin += spinResult.Win; } else { summData.FSTotalWin += spinResult.Win; } if (freeSpinResult.IsCompleted) { break; } freeSpinBonus = freeSpinResult.Bonus as BearBonus; } while (true); return(summData); }
private static SummaryData ExecuteBonus(int level, RequestContext <BonusArgs> requestContext, DragonRichesResult result) { var bonus = module.CreateBonus(result); var dragonBonus = bonus.Value as DragonRichesBonus; var summData = new SummaryData(); IDragonAction action(BonusState state) { if (state is HoldSpin) { return(new HoldSpinAction(level, requestContext.Platform, dragonBonus.SpinBet)); } if (state is FreeSpin) { return(new FreeSpinAction(level, requestContext.Platform, dragonBonus.SpinBet, () => Config.FreeGameReelStrip[1])); } if (state is HoldFreeSpin) { return(new HoldFreeSpinAction(level, requestContext.Platform, dragonBonus.SpinBet)); } return(new NonAction()); } do { var bonusSpinResult = BonusReducer.Dispatch(dragonBonus, action); var spinResult = bonusSpinResult.SpinResult; if (spinResult.HasBonus) { var additionBonus = spinResult.Bonus; if (additionBonus.ClientId == 4) { summData.FgHoldSpinHit++; } else if (additionBonus.ClientId == 3) { summData.FgFHit++; } } switch (bonusSpinResult.Type) { case "fs": summData.FSpinCounter++; summData.FSTotalWin += spinResult.Win; break; case "cs": if (spinResult.Win > 0) { var wheel = result.Wheel.Reels; if (result.Wheel.Coins.SelectMany(c => c).Select((v, i) => new { v, i }).Any(item => item.v > 0 && wheel[item.i / 3][item.i % 3] != 11)) { throw new Exception(); } } summData.MgHoldSpinWin += spinResult.Win; break; case "fscs": if (spinResult.Win > 0) { var wheel = result.Wheel.Reels; if (result.Wheel.Coins.SelectMany(c => c).Select((v, i) => new { v, i }).Any(item => item.v > 0 && wheel[item.i / 3][item.i % 3] != 11)) { throw new Exception(); } } summData.FgHoldSpinWin += spinResult.Win; break; } if (bonusSpinResult.IsCompleted) { break; } dragonBonus = bonusSpinResult.Bonus as DragonRichesBonus; } while (true); return(summData); }