示例#1
0
    public void Evaluation_SlotResult4()
    {
        paytable.ScatterComboGroup.Combos.Clear();
        paytable.ScatterComboGroup.AddPayCombo(new PayCombo(new Symbol(1, "BB"), 4, 1000));

        ReelWindow reelWindow = new ReelWindow(paytable.BaseGameReelGroup, new List <int> {
            0, 0, 0
        });
        SlotResult results   = scatterEvaluator.Evaluate(paytable, reelWindow, rng);
        var        component = results.GetComponent <ScattersComponent>();

        Assert.IsNull(component);
    }
示例#2
0
    public void Evaluation_SlotResult1()
    {
        rng = new DummyRng(new List <int> {
            7
        });

        SlotResult results = pickEvaluator.Evaluate(paytable, null, rng);

        var component = results.GetComponent <PickComponent>();

        Assert.IsNotNull(component);
        Assert.AreEqual(1, component.PickResults.Count);
        Assert.AreEqual("Free Spins", component.PickResults[0].Trigger);
    }
示例#3
0
    public void Evaluation_SlotResult1()
    {
        paytable.ScatterComboGroup.Combos.Clear();
        paytable.ScatterComboGroup.AddPayCombo(new PayCombo(new Symbol(0, "AA"), 3, 1000));

        ReelWindow reelWindow = new ReelWindow(paytable.BaseGameReelGroup, new List <int> {
            0, 0, 0
        });
        SlotResult results   = scatterEvaluator.Evaluate(paytable, reelWindow, rng);
        var        component = results.GetComponent <ScattersComponent>();

        Assert.IsNotNull(component);
        Assert.AreEqual(1, component.PayResults.Count);
        Assert.AreEqual(1000, component.PayResults[0].PayCombo.PayAmount);
    }
示例#4
0
    public void Evaluation_Payline4()
    {
        // Reel Window
        // AA AA WW BB BB
        // BB BB AA CC CC
        // CC CC BB WW WW

        ReelWindow reelWindow = new ReelWindow(paytable.BaseGameReelGroup, new List <int> {
            0, 0, 3, 1, 1
        });
        SlotResult results   = paylineEvaluator.Evaluate(paytable, reelWindow, rng);
        var        component = results.GetComponent <PaylinesComponent>();

        Assert.IsNotNull(component);
        Assert.AreEqual(1, component.PayResults.Count);

        Assert.AreEqual(10, component.PayResults[0].PayCombo.PayAmount);  // 3 x AA
    }
示例#5
0
    public void Evaluation_SlotResult3()
    {
        // Reel Window
        // CC CC CC
        // DD DD DD
        // EE EE EE

        ReelWindow reelWindow = new ReelWindow(paytable.BaseGameReelGroup, new List <int> {
            2, 2, 2
        });
        SlotResult results = paylineEvaluator.Evaluate(paytable, reelWindow, rng);

        var component = results.GetComponent <PaylinesComponent>();

        Assert.IsNotNull(component);
        Assert.AreEqual(1, component.PayResults.Count);
        Assert.AreEqual(20, component.PayResults[0].PayCombo.PayAmount);  // 3 x CC
    }
示例#6
0
    public void Evaluation_SlotResult5()
    {
        // Reel Window
        // FF FF FF
        // GG GG GG
        // AA AA AA

        ReelWindow reelWindow = new ReelWindow(paytable.BaseGameReelGroup, new List <int> {
            5, 5, 5
        });
        SlotResult results = paylineEvaluator.Evaluate(paytable, reelWindow, rng);

        var component = results.GetComponent <PaylinesComponent>();

        Assert.IsNotNull(component);
        Assert.AreEqual(1, component.PayResults.Count);
        Assert.AreEqual(100, component.PayResults[0].PayCombo.PayAmount); // 3 x AA
    }
示例#7
0
    public void Evaluation_SlotResult8()
    {
        paytable.ScatterComboGroup.Combos.Clear();
        paytable.ScatterComboGroup.AddPayCombo(new PayCombo(new Symbol(0, "AA"), 3, 100, "Free Spins"));

        ReelWindow reelWindow = new ReelWindow(paytable.BaseGameReelGroup, new List <int> {
            0, 0, 0
        });
        SlotResult results = scatterEvaluator.Evaluate(paytable, reelWindow, rng);

        var     component = results.GetComponent <ScattersComponent>();
        Payline payline   = component.PayResults[0].Payline;

        Assert.AreEqual(0, payline.PaylineCoords[0].ReelIndex);
        Assert.AreEqual(0, payline.PaylineCoords[0].Offset);
        Assert.AreEqual(1, payline.PaylineCoords[1].ReelIndex);
        Assert.AreEqual(0, payline.PaylineCoords[1].Offset);
        Assert.AreEqual(2, payline.PaylineCoords[2].ReelIndex);
        Assert.AreEqual(0, payline.PaylineCoords[2].Offset);
    }
示例#8
0
    public void Evaluation_SlotResult3()
    {
        rng = new DummyRng(new List <int> {
            0, 0, 0, 0, 0, 0, 0, 0
        });
        SlotResult results = pickEvaluator.Evaluate(paytable, null, rng);

        var component = results.GetComponent <PickComponent>();

        Assert.IsNotNull(component);
        Assert.AreEqual(8, component.PickResults.Count);
        Assert.AreEqual("Prize_10", component.PickResults[0].Name);
        Assert.AreEqual("Prize_10", component.PickResults[1].Name);
        Assert.AreEqual("Prize_10", component.PickResults[2].Name);
        Assert.AreEqual("Prize_10", component.PickResults[3].Name);
        Assert.AreEqual("Prize_20", component.PickResults[4].Name);
        Assert.AreEqual("Prize_20", component.PickResults[5].Name);
        Assert.AreEqual("Prize_30", component.PickResults[6].Name);
        Assert.AreEqual("PickComplete", component.PickResults[7].Name);
    }
示例#9
0
文件: GameMath.cs 项目: lfwelove/GDK
    /// <summary>
    /// The theme specific game evaluation logic.
    /// </summary>
    public SlotResults RunOneGame(int bet)
    {
        // Create the slot results.
        SlotResults slotResults = new SlotResults();

        // Create the evaluators for the base game.
        PaylineEvaluator bgPaylineEval = new PaylineEvaluator();
        ScatterEvaluator bgScatterEval = new ScatterEvaluator();

        // Create the evaluators for the free games.
        PaylineEvaluator fgPaylineEval = new PaylineEvaluator();
        ScatterEvaluator fgScatterEval = new ScatterEvaluator();

        // Generate the random numbers.
        List <int> randomNumbers = new List <int>();

        for (int reel = 0; reel < paytable.BaseGameReelGroup.Reels.Count; ++reel)
        {
            ReelStrip reelStrip = paytable.BaseGameReelGroup.Reels[reel].ReelStrip;
            randomNumbers.Add(rng.GetRandomNumber(reelStrip.Symbols.Count));
        }

        ReelWindow reelWindow = new ReelWindow(paytable.BaseGameReelGroup, randomNumbers);

        // Evaluate the base game (payline and scatter evaluation).
        SlotResult paylineResults = bgPaylineEval.Evaluate(paytable, reelWindow, rng);
        SlotResult scatterResults = bgScatterEval.Evaluate(paytable, reelWindow, rng);

        slotResults.Results.Add(paylineResults);
        slotResults.Results.Add(scatterResults);

        slotResults.TotalWin += paylineResults.TotalWin;
        slotResults.TotalWin += scatterResults.TotalWin;

        // Evaluate the free games (if any).
        if (scatterResults.GetComponent <ScattersComponent>() != null)
        {
            // Add total number of free games.
            int freeGamesAwarded = 5;

            for (int i = 0; i < freeGamesAwarded; ++i)
            {
                // Generate the random numbers.
                randomNumbers = new List <int>();
                for (int reel = 0; reel < paytable.FreeGamesReelGroup.Reels.Count; ++reel)
                {
                    ReelStrip reelStrip = paytable.FreeGamesReelGroup.Reels[reel].ReelStrip;
                    randomNumbers.Add(rng.GetRandomNumber(reelStrip.Symbols.Count));
                }

                reelWindow = new ReelWindow(paytable.FreeGamesReelGroup, randomNumbers);

                // Evaluate the free game (payline and scatter evaluation).
                SlotResult fgPaylineResults = fgPaylineEval.Evaluate(paytable, reelWindow, rng);
                SlotResult fgScatterResults = fgScatterEval.Evaluate(paytable, reelWindow, rng);
                slotResults.Results.Add(fgPaylineResults);
                slotResults.Results.Add(fgScatterResults);

                slotResults.TotalWin += paylineResults.TotalWin;
                slotResults.TotalWin += scatterResults.TotalWin;
            }
        }

        return(slotResults);
    }