コード例 #1
0
        public int Evaluate(List <int[]> slotColumns, Paytable pPayTable, List <int> wildList, int iBetAmount, List <int> iExtraWilds = null)
        {
            m_SlotColumns = slotColumns;
            m_PayTable    = pPayTable;
            m_WildList    = wildList;
            m_iExtraWilds = iExtraWilds;

            m_AddedSymbols.Clear();
            m_WinLines.Clear();

            if (m_ColumnCount.Count != slotColumns.Count)
            {
                m_ColumnCount.Clear();
                for (int i = 0; i < slotColumns.Count; i++)
                {
                    m_ColumnCount.Add(0);
                }
            }

            for (int i = 0; i < m_SlotColumns[0].Length; i++)
            {
                if (!m_AddedSymbols.Contains(m_SlotColumns[0][i]))
                {
                    m_AddedSymbols.Add(m_SlotColumns[0][i]);
                }
            }

            for (int i = 0; i < m_AddedSymbols.Count; i++)
            {
                Search(m_AddedSymbols[i]);
            }

            for (int i = 0; i < m_WinLines.Count; i++)
            {
                m_WinLines[i].applyBetLevel(iBetAmount);
            }

            int iTotalWinAmount = 0;

            for (int i = 0; i < m_WinLines.Count; i++)
            {
                iTotalWinAmount += m_WinLines[i].getWinAmount();
            }

            return(iTotalWinAmount);
        }
コード例 #2
0
ファイル: Winlines.cs プロジェクト: Sukhveer9/SlotEngine
        public int Evaluate(List <int[]> slotColumns, int spinNumber, Paytable pPayTable, List <int> wildList, int iBetAmount, List <int> iExtraWilds = null)
        {
            m_SlotColumns = slotColumns;
            m_PayTable    = pPayTable;
            m_WildList    = wildList;
            m_iExtraWilds = iExtraWilds;
            PaylineNode node = m_RootNode;

            m_WinLines.Clear();
            m_SearchSymbols.Clear();
            //m_PayoutLines.Clear();

            for (int i = 0; i < m_SlotColumns[0].Length; i++)
            {
                if (!m_SearchSymbols.Contains(m_SlotColumns[0][i]))
                {
                    m_SearchSymbols.Add(m_SlotColumns[0][i]);
                }
            }

            for (int i = 0; i < m_SlotColumns[0].Length; i++)
            {
                Search(node.getChild(node.getChildIndex(i)), m_SlotColumns[0][i], false, isWildSymbol(i, 0) /*m_SlotColumns[0][0] == 0 ? true : false*/);
            }
            //Search(node.getChild(node.getChildIndex(0)), m_SlotColumns[0][0], false, isWildSymbol(0,0)/*m_SlotColumns[0][0] == 0 ? true : false*/);
            //Search(node.getChild(node.getChildIndex(1)), m_SlotColumns[0][1], false, isWildSymbol(1,0)/*m_SlotColumns[0][1] == 0? true : false*/);
            //Search(node.getChild(node.getChildIndex(2)), m_SlotColumns[0][2], false, isWildSymbol(2,0)/*m_SlotColumns[0][2] == 0 ? true : false*/);


            for (int i = 0; i < m_WinLines.Count; i++)
            {
                m_WinLines[i].applyBetLevel(iBetAmount);
            }
            //VerifyWinLines();

            int iTotalWinAmount = 0;

            for (int i = 0; i < m_WinLines.Count; i++)
            {
                iTotalWinAmount += m_WinLines[i].getWinAmount();
            }

            return(iTotalWinAmount);
        }
コード例 #3
0
        public bool LoadXML(XmlNode node)
        {
            XmlNodeList childNodes = node.ChildNodes;

            m_SlotColumns   = new List <int[]>();
            m_WildSymbolsID = new List <int>();
            m_WinningLines  = new List <int[]>();

            int iNumOfColumns = int.Parse(node.Attributes["col"].Value);
            int iNumOfRows    = int.Parse(node.Attributes["row"].Value);

            m_iSlotId = int.Parse(node.Attributes["id"].Value);

            m_iExtraWilds = new List <int>();
            int iNumOfPositions = iNumOfColumns * iNumOfRows;

            for (int i = 0; i < iNumOfPositions; i++)
            {
                m_iExtraWilds.Add(0);
            }

            if (bool.Parse(node.Attributes["freespin"].Value) == true)
            {
                m_FreeSpinProperties = new FreeSpinProperties();
                m_FreeSpinProperties.FreeSpinsTotal = node.Attributes["freespincount"] != null?int.Parse(node.Attributes["freespincount"].Value) : 0;

                m_FreeSpinStopsTickets = new List <string>();
            }

            for (int count = 0; count < iNumOfColumns; count++)
            {
                m_SlotColumns.Add(new int[iNumOfRows]);
                m_iReelStops = new List <int>();//new int[iNumOfColumns];
                for (int i = 0; i < iNumOfColumns; i++)
                {
                    m_iReelStops.Add(0);
                }
            }

            for (int i = 0; i < childNodes.Count; i++)
            {
                switch (childNodes[i].Name)
                {
                case "REELS":
                {
                    m_ReelStripList = new List <int[]>();
                    if (!CreateReelStips(childNodes[i]))
                    {
                        return(false);
                    }
                }
                break;

                case "WINNING_LINES":
                {
                    if (!m_bWayPay)
                    {
                        m_WinningLines = new List <int[]>();
                        if (!CreateWinningLines(childNodes[i]))
                        {
                            return(false);
                        }

                        m_Winlines = new Winlines();
                        m_Winlines.CreateWinLines(m_WinningLines);
                        m_Winlines.BuildTree();
                    }
                }
                break;

                case "PAYTABLE":
                {
                    m_Paytable = new Paytable(childNodes[i]);
                }
                break;

                case "WILDS":
                {
                    int[] wildList = StringUtility.StringToIntArray(childNodes[i].Attributes["id"].Value, ' ');
                    for (int wildcount = 0; wildcount < wildList.Length; wildcount++)
                    {
                        m_WildSymbolsID.Add(wildList[wildcount]);
                    }
                }
                break;

                case "TRIGGER":
                {
                    TriggerSymbol triggerSym = new TriggerSymbol();
                    if (childNodes[i].Attributes["triggertype"] != null)
                    {
                        if (childNodes[i].Attributes["triggertype"].Value == "slotfeature")
                        {
                            triggerSym.triggerType = TriggerSymbol.TYPE.SLOT_FEATURE;
                        }
                        else
                        {
                            triggerSym.triggerType = TriggerSymbol.TYPE.BONUS;
                        }
                    }
                    else
                    {
                        triggerSym.triggerType = TriggerSymbol.TYPE.BONUS;
                    }
                    triggerSym.iSymbolId     = int.Parse(childNodes[i].Attributes["symbolid"].Value);
                    triggerSym.iNumOfSymbols = int.Parse(childNodes[i].Attributes["numofsymbol"].Value);
                    if (childNodes[i].Attributes["bonusgame"] != null)
                    {
                        triggerSym.iBonusId = int.Parse(childNodes[i].Attributes["bonusgame"].Value);
                    }
                    if (childNodes[i].Attributes["slotfeature"] != null)
                    {
                        triggerSym.iBonusId = int.Parse(childNodes[i].Attributes["slotfeature"].Value);
                    }
                    m_TriggerSymbols.Add(triggerSym);
                }
                break;

                case "SCATTER":
                {
                    ScatterSymbol scatterSym = new ScatterSymbol();
                    scatterSym.iSymbolId     = int.Parse(childNodes[i].Attributes["symbolid"].Value);
                    scatterSym.iNumOfSymbols = int.Parse(childNodes[i].Attributes["numofsymbol"].Value);
                    scatterSym.iCredits      = int.Parse(childNodes[i].Attributes["extracredits"].Value);
                    scatterSym.iMultiplier   = int.Parse(childNodes[i].Attributes["multiplier"].Value);
                    m_ScatterSymbols.Add(scatterSym);
                }
                break;
                }
            }

#if _SIMULATOR
            List <Symbol> AllSymbols = m_Paytable.GetAllSymbols();
            for (int i = 0; i < AllSymbols.Count; i++)
            {
                SymbolStatistics symStat = new SymbolStatistics();
                symStat.numofSymCountList = new Dictionary <int, int>();
                symStat.iSymbolid         = AllSymbols[i].SymbolId;
                symStat.symbolCount       = 0;
                symStat.iTotalWinAmount   = 0;

                Dictionary <int, int> symbolPaytable = AllSymbols[i].getPayoutList();
                foreach (KeyValuePair <int, int> entry in symbolPaytable)
                {
                    symStat.numofSymCountList.Add(entry.Key, 0);
                }
                m_SymbolStats.Add(symStat);
            }
            for (int i = 0; i < m_WinningLines.Count; i++)
            {
                m_WinLineFoundCount.Add(0);
            }

            for (int i = 0; i < m_ScatterSymbols.Count; i++)
            {
                if (StatsContainSymbol(m_ScatterSymbols[i].iSymbolId))
                {
                    SymbolStatistics stat = getSymbolStat(m_ScatterSymbols[i].iSymbolId);
                    stat.numofSymCountList.Add(m_ScatterSymbols[i].iNumOfSymbols, 0);
                }
                else
                {
                    SymbolStatistics symStat = new SymbolStatistics();
                    symStat.numofSymCountList = new Dictionary <int, int>();
                    symStat.iSymbolid         = m_ScatterSymbols[i].iSymbolId;
                    symStat.symbolCount       = 0;
                    symStat.iTotalWinAmount   = 0;
                    symStat.numofSymCountList.Add(m_ScatterSymbols[i].iNumOfSymbols, 0);
                    m_SymbolStats.Add(symStat);
                }
            }
#endif
            return(true);
        }