Exemple #1
0
        public BallyGamePays()
        {
            m_linePays        = new BallyLinePayData();
            m_scatterPays     = new BallyScatterPayData();
            m_freeLinePays    = new BallyFreeLinePayData();
            m_freeScatterPays = new BallyFreeScatterPayData();
            m_symbolList      = new List <String>();

            m_parseState = new PayParserState();
            m_util       = new Utils();
        }
        public BallyGamePays()
        {
            m_linePays = new BallyLinePayData();
            m_scatterPays = new BallyScatterPayData();
            m_freeLinePays = new BallyFreeLinePayData();
            m_freeScatterPays = new BallyFreeScatterPayData();
            m_symbolList = new List<String>();

            m_parseState = new PayParserState();
            m_util = new Utils();
        }
Exemple #3
0
        public void Parse(String fileName)
        {
            if (m_parseState == null)
            {
                m_parseState = new PayParserState();
            }

            String       line     = "";
            StreamReader inStream = new StreamReader(fileName);

            while ((line = inStream.ReadLine()) != null)
            {
                if (line == "linepays")
                {
                    break;
                }
            }
            m_parseState.EnterLinePay();
            m_linePays.Parse(inStream, line, m_parseState);

            inStream = new StreamReader(fileName);
            while ((line = inStream.ReadLine()) != null)
            {
                if (line == "freegame_linepays")
                {
                    break;
                }
            }
            m_parseState.EnterFreeLinePay();
            m_freeLinePays.Parse(inStream, line, m_parseState);

            inStream = new StreamReader(fileName);
            while ((line = inStream.ReadLine()) != null)
            {
                if (line == "scatterpays")
                {
                    break;
                }
            }
            m_parseState.EnterScatterPay();
            m_scatterPays.Parse(inStream, line, m_parseState);

            inStream = new StreamReader(fileName);
            while ((line = inStream.ReadLine()) != null)
            {
                if (line == "freegame_scatterpays")
                {
                    break;
                }
            }
            m_parseState.EnterFreeScatterPay();
            m_freeScatterPays.Parse(inStream, line, m_parseState);
        }
Exemple #4
0
        public void LoadSymbols(StreamReader inStream)
        {
            if (m_parseState == null)
            {
                m_parseState = new PayParserState();
            }

            String line = "";

            using (inStream)
            {
                while (line != null)
                {
                    try
                    {
                        line = inStream.ReadLine();
                    }
                    catch (ObjectDisposedException ex)
                    {
                        break;
                    }
                    // strip comments
                    if (line.Contains("/"))
                    {
                        int pos = line.IndexOf("/");
                        line = line.Remove(pos);
                    }

                    line = line.Trim();

                    if (line.Length == 0 || line == "")
                    {
                        continue;
                    }

                    // look for symbols
                    if (line == "symbols")
                    {
                        m_parseState.EnterSymbols();
                        parseSymbols(inStream, line);
                    }
                }
            }
        }
        public override void Parse(StreamReader inStream, String line, PayParserState parseState)
        {
            bool lineHasOpenBrace  = false;
            bool lineHasCloseBrace = false;

            PaylineDescription payline;

            using (inStream)
            {
                while ((line = inStream.ReadLine()) != null)
                {
                    // strip comments
                    if (line.Contains("/"))
                    {
                        int pos = line.IndexOf("/");
                        line = line.Remove(pos);
                    }

                    line = line.Trim();

                    if (line.Length == 0 || line == "")
                    {
                        continue;
                    }

                    // check for braces
                    if (line == m_util.openBrace)
                    {
                        parseState.EnterArrayLevel();
                        continue;
                    }

                    lineHasOpenBrace  = line.Contains(m_util.openBrace);
                    lineHasCloseBrace = line.Contains(m_util.closeBrace);

                    if (!lineHasOpenBrace && !lineHasCloseBrace)
                    {
                        continue;
                    }

                    if (lineHasCloseBrace)
                    {
                        if (line == m_util.closeBrace)
                        {
                            parseState.LeaveArrayLevel();
                            if (parseState.FreeLinePayStart)
                            {
                                if (parseState.StateEnteredLevel[(int)PayReadState.FREEGAME_LINEPAYSTART] == parseState.ArrayDepth)
                                {
                                    parseState.LeaveFreeLinePay();
                                }
                            }
                            break;
                        }

                        // could be end of a reelstop definition, or moving up a level
                        if (line == m_util.arrayEnd)
                        {
                            parseState.LeaveArrayLevel();
                            if (parseState.FreeLinePayStart)
                            {
                                if (parseState.StateEnteredLevel[(int)PayReadState.FREEGAME_LINEPAYSTART] == parseState.ArrayDepth)
                                {
                                    parseState.LeaveFreeLinePay();
                                }
                            }
                            break;
                        }
                    }

                    payline = new PaylineDescription();
                    payline.Add(line, m_util);
                    if (parseState.FreeLinePayStart)
                    {
                        m_freeLinePays.Add(payline);
                    }
                    else
                    {
                        parseState.ResetFreeLinePay();
                        break;
                    }
                }
            }

            IComparer <PaylineDescription> payComparer = new PaylineSorter();

            m_freeLinePays.Sort(payComparer);
        }
        public override void Parse(StreamReader inStream, String line, PayParserState parseState)
        {
            bool lineHasOpenBrace = false;
            bool lineHasCloseBrace = false;

            PaylineDescription payline;

            using (inStream)
            {
                while ((line = inStream.ReadLine()) != null)
                {
                    // strip comments
                    if (line.Contains("/"))
                    {
                        int pos = line.IndexOf("/");
                        line = line.Remove(pos);
                    }

                    line = line.Trim();

                    if (line.Length == 0 || line == "")
                        continue;

                    // check for braces
                    if (line == m_util.openBrace)
                    {
                        parseState.EnterArrayLevel();
                        continue;
                    }

                    lineHasOpenBrace = line.Contains(m_util.openBrace);
                    lineHasCloseBrace = line.Contains(m_util.closeBrace);

                    if (!lineHasOpenBrace && !lineHasCloseBrace)
                        continue;

                    if (lineHasCloseBrace)
                    {
                        if (line == m_util.closeBrace)
                        {
                            parseState.LeaveArrayLevel();
                            if (parseState.FreeLinePayStart)
                            {
                                if (parseState.StateEnteredLevel[(int)PayReadState.FREEGAME_LINEPAYSTART] == parseState.ArrayDepth)
                                    parseState.LeaveFreeLinePay();
                            }
                            break;
                        }

                        // could be end of a reelstop definition, or moving up a level
                        if (line == m_util.arrayEnd)
                        {
                            parseState.LeaveArrayLevel();
                            if (parseState.FreeLinePayStart)
                            {
                                if (parseState.StateEnteredLevel[(int)PayReadState.FREEGAME_LINEPAYSTART] == parseState.ArrayDepth)
                                    parseState.LeaveFreeLinePay();
                            }
                            break;
                        }
                    }

                    payline = new PaylineDescription();
                    payline.Add(line, m_util);
                    if (parseState.FreeLinePayStart)
                    {
                        m_freeLinePays.Add(payline);
                    }
                    else
                    {
                        parseState.ResetFreeLinePay();
                        break;
                    }
                }
            }

            IComparer<PaylineDescription> payComparer = new PaylineSorter();
            m_freeLinePays.Sort(payComparer);
        }
Exemple #7
0
 public abstract void Parse(StreamReader inStream, String line, PayParserState parseState);
        public void Parse(String fileName)
        {
            if (m_parseState == null)
                m_parseState = new PayParserState();

            String line = "";
            StreamReader inStream = new StreamReader(fileName);

            while((line = inStream.ReadLine()) != null)
            {
                if (line == "linepays")
                    break;
            }
            m_parseState.EnterLinePay();
            m_linePays.Parse(inStream, line, m_parseState);

            inStream = new StreamReader(fileName);
            while ((line = inStream.ReadLine()) != null)
            {
                if (line == "freegame_linepays")
                    break;
            }
            m_parseState.EnterFreeLinePay();
            m_freeLinePays.Parse(inStream, line, m_parseState);

            inStream = new StreamReader(fileName);
            while ((line = inStream.ReadLine()) != null)
            {
                if (line == "scatterpays")
                    break;
            }
            m_parseState.EnterScatterPay();
            m_scatterPays.Parse(inStream, line, m_parseState);

            inStream = new StreamReader(fileName);
            while ((line = inStream.ReadLine()) != null)
            {
                if (line == "freegame_scatterpays")
                    break;
            }
            m_parseState.EnterFreeScatterPay();
            m_freeScatterPays.Parse(inStream, line, m_parseState);
        }
        public void LoadSymbols(StreamReader inStream)
        {
            if (m_parseState == null)
                m_parseState = new PayParserState();

            String line = "";

            using (inStream)
            {
                while (line != null)
                {
                    try
                    {
                        line = inStream.ReadLine();
                    }
                    catch (ObjectDisposedException ex)
                    {
                        break;
                    }
                    // strip comments
                    if (line.Contains("/"))
                    {
                        int pos = line.IndexOf("/");
                        line = line.Remove(pos);
                    }

                    line = line.Trim();

                    if (line.Length == 0 || line == "")
                        continue;

                    // look for symbols
                    if (line == "symbols")
                    {
                        m_parseState.EnterSymbols();
                        parseSymbols(inStream, line);
                    }
                }
            }
        }
Exemple #10
0
 public abstract void Parse(StreamReader inStream, String line, PayParserState parseState);