예제 #1
0
    public void Init()
    {
        rng = new Rng();
        paylineEvaluator = new PaylineEvaluator();
        paytable         = new Paytable();

        // Reels
        ReelGroup reels = new ReelGroup();

        ReelStrip reel = new ReelStrip();

        reel.AddSymbol(new Symbol(0, "AA"));
        reel.AddSymbol(new Symbol(1, "BB"));
        reel.AddSymbol(new Symbol(2, "CC"));

        reels.AddReel(reel);
        reels.AddReel(reel);
        reels.AddReel(reel);
        reels.AddReel(reel);
        reels.AddReel(reel);

        // Paylines
        PaylineGroup paylines = new PaylineGroup();

        Payline payline1 = new Payline();

        payline1.AddPaylineCoord(new PaylineCoord {
            ReelIndex = 0, Offset = 0
        });
        payline1.AddPaylineCoord(new PaylineCoord {
            ReelIndex = 1, Offset = 0
        });
        payline1.AddPaylineCoord(new PaylineCoord {
            ReelIndex = 2, Offset = 0
        });
        payline1.AddPaylineCoord(new PaylineCoord {
            ReelIndex = 3, Offset = 0
        });
        payline1.AddPaylineCoord(new PaylineCoord {
            ReelIndex = 4, Offset = 0
        });

        Payline payline2 = new Payline();

        payline2.AddPaylineCoord(new PaylineCoord {
            ReelIndex = 0, Offset = 1
        });
        payline2.AddPaylineCoord(new PaylineCoord {
            ReelIndex = 1, Offset = 1
        });
        payline2.AddPaylineCoord(new PaylineCoord {
            ReelIndex = 2, Offset = 1
        });
        payline2.AddPaylineCoord(new PaylineCoord {
            ReelIndex = 3, Offset = 1
        });
        payline2.AddPaylineCoord(new PaylineCoord {
            ReelIndex = 4, Offset = 1
        });

        Payline payline3 = new Payline();

        payline3.AddPaylineCoord(new PaylineCoord {
            ReelIndex = 0, Offset = 2
        });
        payline3.AddPaylineCoord(new PaylineCoord {
            ReelIndex = 1, Offset = 2
        });
        payline3.AddPaylineCoord(new PaylineCoord {
            ReelIndex = 2, Offset = 2
        });
        payline3.AddPaylineCoord(new PaylineCoord {
            ReelIndex = 3, Offset = 2
        });
        payline3.AddPaylineCoord(new PaylineCoord {
            ReelIndex = 4, Offset = 2
        });

        Payline payline4 = new Payline();

        payline4.AddPaylineCoord(new PaylineCoord {
            ReelIndex = 0, Offset = 0
        });
        payline4.AddPaylineCoord(new PaylineCoord {
            ReelIndex = 1, Offset = 1
        });
        payline4.AddPaylineCoord(new PaylineCoord {
            ReelIndex = 2, Offset = 2
        });
        payline4.AddPaylineCoord(new PaylineCoord {
            ReelIndex = 3, Offset = 1
        });
        payline4.AddPaylineCoord(new PaylineCoord {
            ReelIndex = 4, Offset = 0
        });

        Payline payline5 = new Payline();

        payline5.AddPaylineCoord(new PaylineCoord {
            ReelIndex = 0, Offset = 2
        });
        payline5.AddPaylineCoord(new PaylineCoord {
            ReelIndex = 1, Offset = 1
        });
        payline5.AddPaylineCoord(new PaylineCoord {
            ReelIndex = 2, Offset = 0
        });
        payline5.AddPaylineCoord(new PaylineCoord {
            ReelIndex = 3, Offset = 1
        });
        payline5.AddPaylineCoord(new PaylineCoord {
            ReelIndex = 4, Offset = 2
        });

        paylines.AddPayline(payline1);
        paylines.AddPayline(payline2);
        paylines.AddPayline(payline3);
        paylines.AddPayline(payline4);
        paylines.AddPayline(payline5);

        // PayCombos
        ISymbolComparer comparer = new SymbolComparer();

        comparer.Substitute(new Symbol(0, "AA"), new Symbol(3, "MX"));
        comparer.Substitute(new Symbol(1, "BB"), new Symbol(3, "MX"));
        PayComboGroup payCombos = new PayComboGroup(comparer);

        // AA
        payCombos.AddPayCombo(new PayCombo(new Symbol(0, "AA"), 5, 200));
        payCombos.AddPayCombo(new PayCombo(new Symbol(0, "AA"), 4, 150));
        payCombos.AddPayCombo(new PayCombo(new Symbol(0, "AA"), 3, 100));

        // BB
        payCombos.AddPayCombo(new PayCombo(new Symbol(1, "BB"), 5, 175));
        payCombos.AddPayCombo(new PayCombo(new Symbol(1, "BB"), 4, 125));
        payCombos.AddPayCombo(new PayCombo(new Symbol(1, "BB"), 3, 85));

        // CC
        payCombos.AddPayCombo(new PayCombo(new Symbol(2, "CC"), 5, 130));
        payCombos.AddPayCombo(new PayCombo(new Symbol(2, "CC"), 4, 80));
        payCombos.AddPayCombo(new PayCombo(new Symbol(2, "CC"), 3, 30));

        // MX
        payCombos.AddPayCombo(new PayCombo(new Symbol(3, "MX"), 5, 44));
        payCombos.AddPayCombo(new PayCombo(new Symbol(3, "MX"), 4, 33));
        payCombos.AddPayCombo(new PayCombo(new Symbol(3, "MX"), 3, 22));

        paytable.BaseGameReelGroup = reels;
        paytable.PaylineGroup      = paylines;
        paytable.PayComboGroup     = payCombos;
    }
예제 #2
0
    public void Init()
    {
        rng = new Rng();
        paylineEvaluator = new PaylineEvaluator();
        paytable         = new Paytable();

        // Reels
        ReelGroup reels = new ReelGroup();

        ReelStrip reel = new ReelStrip();

        reel.AddSymbol(new Symbol(0, "AA"));
        reel.AddSymbol(new Symbol(1, "BB"));
        reel.AddSymbol(new Symbol(2, "CC"));
        reel.AddSymbol(new Symbol(3, "WW"));

        reels.AddReel(reel);
        reels.AddReel(reel);
        reels.AddReel(reel);
        reels.AddReel(reel);
        reels.AddReel(reel);

        // Paylines
        PaylineGroup paylines = new PaylineGroup();

        Payline payline1 = new Payline();

        payline1.AddPaylineCoord(new PaylineCoord {
            ReelIndex = 0, Offset = 0
        });
        payline1.AddPaylineCoord(new PaylineCoord {
            ReelIndex = 1, Offset = 0
        });
        payline1.AddPaylineCoord(new PaylineCoord {
            ReelIndex = 2, Offset = 0
        });
        payline1.AddPaylineCoord(new PaylineCoord {
            ReelIndex = 3, Offset = 0
        });
        payline1.AddPaylineCoord(new PaylineCoord {
            ReelIndex = 4, Offset = 0
        });

        paylines.AddPayline(payline1);

        // PayCombos
        ISymbolComparer comparer = new SymbolComparer();

        comparer.Substitute(new Symbol(3, "WW"), new Symbol(0, "AA"));
        comparer.Substitute(new Symbol(3, "WW"), new Symbol(0, "BB"));
        comparer.Substitute(new Symbol(3, "WW"), new Symbol(0, "CC"));
        PayComboGroup payCombos = new PayComboGroup(comparer);

        // WW
        payCombos.AddPayCombo(new PayCombo(new Symbol(3, "WW"), 5, 1000));
        payCombos.AddPayCombo(new PayCombo(new Symbol(3, "WW"), 4, 500));
        payCombos.AddPayCombo(new PayCombo(new Symbol(3, "WW"), 3, 100));

        // AA
        payCombos.AddPayCombo(new PayCombo(new Symbol(0, "AA"), 5, 50));
        payCombos.AddPayCombo(new PayCombo(new Symbol(0, "AA"), 4, 25));
        payCombos.AddPayCombo(new PayCombo(new Symbol(0, "AA"), 3, 10));

        // BB
        payCombos.AddPayCombo(new PayCombo(new Symbol(1, "BB"), 5, 15));
        payCombos.AddPayCombo(new PayCombo(new Symbol(1, "BB"), 4, 10));
        payCombos.AddPayCombo(new PayCombo(new Symbol(1, "BB"), 3, 5));

        // CC
        payCombos.AddPayCombo(new PayCombo(new Symbol(2, "CC"), 5, 10));
        payCombos.AddPayCombo(new PayCombo(new Symbol(2, "CC"), 4, 5));
        payCombos.AddPayCombo(new PayCombo(new Symbol(2, "CC"), 3, 1));

        paytable.BaseGameReelGroup = reels;
        paytable.PaylineGroup      = paylines;
        paytable.PayComboGroup     = payCombos;
    }