コード例 #1
0
        public void Search(int iSymbolId)
        {
            int iSymCount = 0;

            m_SymbolPosList.Clear();
            for (int i = 0; i < m_ColumnCount.Count; i++)
            {
                m_ColumnCount[i] = 0;
            }
            for (int i = 0; i < m_SlotColumns.Count; i++)
            {
                for (int j = 0; j < m_SlotColumns[i].Length; j++)
                {
                    if (iSymbolId == m_SlotColumns[i][j] || /*isWildSymbol(m_SlotColumns[i][j])*/ isWildSymbol(j, i))
                    {
                        m_ColumnCount[i]++;
                        int iPos = 0;
                        iPos = (m_SlotColumns.Count * j) + i;
                        m_SymbolPosList.Add(iPos);
                    }
                }
                if (m_ColumnCount[i] == 0)
                {
                    break;
                }
            }

            int iWays = 1;

            for (int i = 0; i < m_ColumnCount.Count; i++)
            {
                if (m_ColumnCount[i] != 0)
                {
                    iSymCount++;
                    iWays *= m_ColumnCount[i];
                }
                else
                {
                    break;
                }
            }
            if (m_PayTable.getWinAmount(iSymbolId, iSymCount) != 0)
            {
                int iWinAmount = m_PayTable.getWinAmount(iSymbolId, iSymCount);
                iWinAmount *= iWays;
                m_WinLines.Add(new WayPayWin(iSymbolId, iSymCount, iWays, iWinAmount, iSymCount, m_SymbolPosList));
            }
        }
コード例 #2
0
ファイル: Winlines.cs プロジェクト: Sukhveer9/SlotEngine
        public void Search(PaylineNode node, int iSymbolID, bool bEnd, bool bStartWild)
        {
            PaylineNode child = null;

            for (int i = 0; i < node.NumberOfChilds; i++)
            {
                child = node.getChild(i);
                //if (getSymbolId(node.Row, node.col) != 0 && bStartWild)
                if (!isWildSymbol(node.Row, node.col) && bStartWild)
                {
                    iSymbolID = getSymbolId(node.Row, node.col); bStartWild = false;
                }
                //if (getSymbolId(child.Row, child.col) == iSymbolID || getSymbolId(child.Row, child.col) == 0 || bStartWild)
                if (getSymbolId(child.Row, child.col) == iSymbolID || isWildSymbol(child.Row, child.col) || bStartWild)
                {
                    bEnd = false;
                    //wild case
                    // if (getSymbolId(node.Row, node.col) == 0) iSymbolID = getSymbolId(child.Row, child.col);
                    Search(child, iSymbolID, bEnd, bStartWild);
                }
                else
                {
                    bEnd = true;
                }
                if (m_PayTable.IsPaySymbol(iSymbolID) /*node.col >= 2*/ && !node.IsRoot && bEnd && node.col != m_SlotColumns.Count)
                {
                    int payline = child.getLastChild().PayLineNum;
                    if (/*(node.col+1) >= m_PayTable.getMinCount(iSymbolID)*/ m_PayTable.getWinAmount(iSymbolID, node.col + 1) != 0)
                    {
                        m_WinLines.Add(new WinLine(payline, iSymbolID, node.col + 1, m_PayTable.getWinAmount(iSymbolID, node.col + 1), m_WinningLines[payline]));
                        //  m_PayoutLines.Add(" Payline# " + payline + " last column: " + node.col + " row: " + node.Row + "\n");
                    }

                    PaylineNode subChild = child.getLastChild();
                    if (subChild.NumberOfChilds > 0) //if there are other winlines that's a child of the winning winline then add payouts to all the children
                    {
                        for (int j = 0; j < subChild.NumberOfChilds; j++)
                        {
                            PaylineNode eachChild  = subChild.getChild(j);
                            int         subPayLine = eachChild.PayLineNum;
                            if (subPayLine != payline && m_PayTable.getWinAmount(iSymbolID, node.col + 1) != 0 /*(node.col+1)>= m_PayTable.getMinCount(iSymbolID)*/)
                            {
                                m_WinLines.Add(new WinLine(subPayLine, iSymbolID, node.col + 1, m_PayTable.getWinAmount(iSymbolID, node.col + 1), m_WinningLines[subPayLine]));
                                //      m_PayoutLines.Add(" Payline# " + subPayLine + " last column: " + node.col + " row: " + node.Row + "\n");
                            }
                        }
                    }
                }
            }
            if (node.col == m_SlotColumns.Count - 1 && !node.IsRoot /*&& (getSymbolId(node.Row, node.col) == iSymbolID || isWildSymbol(node.Row, node.col))*/ && !bEnd)
            {
                if (isWildSymbol(iSymbolID))
                {
                    iSymbolID = getSymbolId(node.Row, node.col);
                }
                if (m_PayTable.IsPaySymbol(iSymbolID) && m_PayTable.getWinAmount(iSymbolID, node.col + 1) != 0)
                {
                    int payline = node.PayLineNum;
                    m_WinLines.Add(new WinLine(payline, iSymbolID, node.col + 1, m_PayTable.getWinAmount(iSymbolID, node.col + 1), m_WinningLines[payline]));
                    //  m_PayoutLines.Add(" Payline# " + payline + " last column: " + node.col + " row: " + node.Row + "\n");
                }
            }
        }