コード例 #1
0
ファイル: Utils.cs プロジェクト: RichardRanft/Importer
        public void exportReels(BallyReelSet set, String sheetName, Excel.Workbook targetBook)
        {
            int    tableIndex = parseInteger(sheetName);
            String tableName  = "";

            tableName = "Paytable" + tableIndex.ToString();

            // copy the match sheet template to a new worksheet
            copyMatchSheet(tableName, targetBook);
            // copy the pay sheet template to a new worksheet
            copyPaySheet(tableName, targetBook);

            Globals.Program.Application.ScreenUpdating = false;

            tableIndex++;
            Excel.Worksheet newSheet = createSheet(tableName, targetBook);
            set.SendToWorksheet(newSheet, "A1");

            // copy the reel data to the corresponding match and pay sheets
            //updateMatchLinks(newSheet, targetBook, tableName);
            //updatePayLinks(newSheet, targetBook, tableName);

            // get this baby out from under foot - move it to the end of the workbook
            moveSheetToEnd(newSheet, targetBook);

            // let the user see that we're working
            Globals.Program.Application.ScreenUpdating = true;
        }
コード例 #2
0
        public BallyReelGame()
        {
            m_baseReelset    = new BallyReelSet();
            m_freeReelset    = new BallyReelSet();
            m_baseModReelset = new BallyReelSet();
            m_freeModReelset = new BallyReelSet();
            m_currentSet     = null;

            m_parseState = new ParserState();

            m_util = new Utils();

            m_setIndex         = 7;
            m_reelWidth        = m_baseReelset.Count;
            m_isValid          = false;
            m_hasModifierReels = false;
            m_hasFreeReels     = false;
            m_hasFreeModReels  = false;
        }
コード例 #3
0
        public BallyReelGame()
        {
            m_baseReelset = new BallyReelSet();
            m_freeReelset = new BallyReelSet();
            m_baseModReelset = new BallyReelSet();
            m_freeModReelset = new BallyReelSet();
            m_currentSet = null;

            m_parseState = new ParserState();

            m_util = new Utils();

            m_setIndex = 7;
            m_reelWidth = m_baseReelset.Count;
            m_isValid = false;
            m_hasModifierReels = false;
            m_hasFreeReels = false;
            m_hasFreeModReels = false;
        }
コード例 #4
0
ファイル: Utils.cs プロジェクト: RichardRanft/Importer
        public void updateMatchLinks(BallyReelSet set, Excel.Worksheet sheet, Excel.Workbook target, String name)
        {
            // Notes:
            // Reel columns start at Q8
            // This also needs to update all links to point to the new target worksheet.
            String matchSheetName = trimName(name) + " Match";

            Excel.Worksheet matchSheet = null;
            int             index      = getSheetIndex("Game Info", target);

            Excel.Worksheet info     = target.Worksheets[index];
            String          link     = "='" + matchSheetName + "'!$G$4";
            String          nameCell = "B" + set.ToString();
            String          linkCell = "C" + set.ToString();

            info.Range[nameCell].Value = matchSheetName;
            info.Range[linkCell].Value = link;

            // find the parsed reel worksheet
            int sheetIndex = getSheetIndex(matchSheetName, target);

            if (sheetIndex > 0)
            {
                matchSheet = target.Worksheets[getSheetIndex(matchSheetName, target)];

                // copy the parsed reels to the match sheet
                copyRange(sheet, matchSheet, "A1", "A300", "Q8");
                copyRange(sheet, matchSheet, "B1", "B300", "R8");
                copyRange(sheet, matchSheet, "C1", "C300", "S8");
                copyRange(sheet, matchSheet, "D1", "D300", "T8");
                copyRange(sheet, matchSheet, "E1", "E300", "U8");
            }
            else
            {
                return;
            }
        }
コード例 #5
0
ファイル: Utils.cs プロジェクト: RichardRanft/Importer
        public void updateMatchLinks(BallyReelSet set, Excel.Worksheet sheet, Excel.Workbook target, String name)
        {
            // Notes:
            // Reel columns start at Q8
            // This also needs to update all links to point to the new target worksheet.
            String matchSheetName = trimName(name) + " Match";
            Excel.Worksheet matchSheet = null;
            int index = getSheetIndex("Game Info", target);
            Excel.Worksheet info = target.Worksheets[index];
            String link = "='" + matchSheetName + "'!$G$4";
            String nameCell = "B" + set.ToString();
            String linkCell = "C" + set.ToString();
            info.Range[nameCell].Value = matchSheetName;
            info.Range[linkCell].Value = link;

            // find the parsed reel worksheet
            int sheetIndex = getSheetIndex(matchSheetName, target);
            if (sheetIndex > 0)
            {
                matchSheet = target.Worksheets[getSheetIndex(matchSheetName, target)];

                // copy the parsed reels to the match sheet
                copyRange(sheet, matchSheet, "A1", "A300", "Q8");
                copyRange(sheet, matchSheet, "B1", "B300", "R8");
                copyRange(sheet, matchSheet, "C1", "C300", "S8");
                copyRange(sheet, matchSheet, "D1", "D300", "T8");
                copyRange(sheet, matchSheet, "E1", "E300", "U8");
            }
            else
                return;
        }
コード例 #6
0
ファイル: Utils.cs プロジェクト: RichardRanft/Importer
        public void exportReels(BallyReelSet set, String sheetName, Excel.Workbook targetBook)
        {
            int tableIndex = parseInteger(sheetName);
            String tableName = "";

            tableName = "Paytable" + tableIndex.ToString();

            // copy the match sheet template to a new worksheet
            copyMatchSheet(tableName, targetBook);
            // copy the pay sheet template to a new worksheet
            copyPaySheet(tableName, targetBook);

            Globals.Program.Application.ScreenUpdating = false;

            tableIndex++;
            Excel.Worksheet newSheet = createSheet(tableName, targetBook);
            set.SendToWorksheet(newSheet, "A1");

            // copy the reel data to the corresponding match and pay sheets
            //updateMatchLinks(newSheet, targetBook, tableName);
            //updatePayLinks(newSheet, targetBook, tableName);

            // get this baby out from under foot - move it to the end of the workbook
            moveSheetToEnd(newSheet, targetBook);

            // let the user see that we're working
            Globals.Program.Application.ScreenUpdating = true;
        }
コード例 #7
0
        protected List <BallyReelSet> getSubSets(BallyReelSet set)
        {
            if (set.Count < 1)
            {
                return(null);
            }
            List <BallyReelSet> inSet  = new List <BallyReelSet>();
            List <BallyReelSet> subset = new List <BallyReelSet>();
            BallyReelSet        temp;

            int        stride = 0;
            List <int> setStartIndices;

            switch (set.Type)
            {
            case ReelType.NONE:
                break;

            case ReelType.BASEREEL:
                stride = 1;
                inSet.Add(set);
                break;

            case ReelType.FREEREEL:
                // need to find out if we have one, two or possibly more freegame sets and divide them up correctly.
                // this only works for two sets - it won't even work if there is only one set.
                // the same needs to be addressed for freegame modifier reels.
                temp = new BallyReelSet();
                m_freeReelset.SetCount = m_freeReelset.Count / m_baseReelset.Count;
                setStartIndices        = new List <int>();
                for (int c = 0; c < m_freeReelset.SetCount; c++)
                {
                    setStartIndices.Add(c * (m_freeReelset.Count / m_freeReelset.SetCount));
                }
                for (int i = 0; i < setStartIndices.Count; i++)
                {
                    temp = new BallyReelSet();
                    for (int j = setStartIndices[i]; j < (setStartIndices[i] + (m_freeReelset.Count / m_freeReelset.SetCount)); j++)
                    {
                        temp.AddReel(set.Reels[j]);
                    }
                    inSet.Add(temp);
                }
                stride = temp.Count / m_reelWidth;
                break;

            case ReelType.BASEMODREEL:
                stride = set.Count / m_reelWidth;
                inSet.Add(set);
                break;

            case ReelType.FREEMODREEL:
                temp = new BallyReelSet();
                m_freeModReelset.SetCount = m_freeModReelset.Count / m_freeReelset.SetCount;
                setStartIndices           = new List <int>();
                for (int c = 0; c < m_freeReelset.SetCount; c++)
                {
                    setStartIndices.Add(c * (m_freeModReelset.Count / m_freeReelset.SetCount));
                }
                for (int i = 0; i < setStartIndices.Count; i++)
                {
                    temp = new BallyReelSet();
                    for (int j = setStartIndices[i]; j < (setStartIndices[i] + (m_freeModReelset.Count / m_freeReelset.SetCount)); j++)
                    {
                        temp.AddReel(set.Reels[j]);
                    }
                    inSet.Add(temp);
                }
                stride = temp.Count / m_reelWidth;
                break;
            }
            int sets = inSet.Count;

            set.SetCount = sets;
            int subIndex = 1;

            foreach (BallyReelSet group in inSet)
            {
                sets = group.Count / m_reelWidth;
                int count = 0;
                do
                {
                    temp      = new BallyReelSet();
                    temp.Name = set.Name + (count + 1).ToString() + "_" + subIndex.ToString() + "_";
                    subIndex++;
                    for (int index = count; index < group.Count; index += sets)
                    {
                        temp.AddReel(group.Reels[index]);
                    }
                    subset.Add(temp);
                    count++;
                } while (count < sets);
            }

            return(subset);
        }
コード例 #8
0
        protected List<BallyReelSet> getSubSets(BallyReelSet set)
        {
            if (set.Count < 1)
                return null;
            List<BallyReelSet> inSet = new List<BallyReelSet>();
            List<BallyReelSet> subset = new List<BallyReelSet>();
            BallyReelSet temp;

            int stride = 0;
            List<int> setStartIndices;
            switch(set.Type)
            {
                case ReelType.NONE:
                    break;
                case ReelType.BASEREEL:
                    stride = 1;
                    inSet.Add(set);
                    break;
                case ReelType.FREEREEL:
                    // need to find out if we have one, two or possibly more freegame sets and divide them up correctly.
                    // this only works for two sets - it won't even work if there is only one set.
                    // the same needs to be addressed for freegame modifier reels.
                    temp = new BallyReelSet();
                    m_freeReelset.SetCount = m_freeReelset.Count / m_baseReelset.Count;
                    setStartIndices = new List<int>();
                    for (int c = 0; c < m_freeReelset.SetCount; c++)
                    {
                        setStartIndices.Add(c * (m_freeReelset.Count / m_freeReelset.SetCount));
                    }
                    for (int i = 0; i < setStartIndices.Count; i++)
                    {
                        temp = new BallyReelSet();
                        for (int j = setStartIndices[i]; j < (setStartIndices[i] + (m_freeReelset.Count / m_freeReelset.SetCount)); j++)
                        {
                            temp.AddReel(set.Reels[j]);
                        }
                        inSet.Add(temp);
                    }
                    stride = temp.Count / m_reelWidth;
                    break;
                case ReelType.BASEMODREEL:
                    stride = set.Count / m_reelWidth;
                    inSet.Add(set);
                    break;
                case ReelType.FREEMODREEL:
                    temp = new BallyReelSet();
                    m_freeModReelset.SetCount = m_freeModReelset.Count / m_freeReelset.SetCount;
                    setStartIndices = new List<int>();
                    for (int c = 0; c < m_freeReelset.SetCount; c++)
                    {
                        setStartIndices.Add(c * (m_freeModReelset.Count / m_freeReelset.SetCount));
                    }
                    for (int i = 0; i < setStartIndices.Count; i++)
                    {
                        temp = new BallyReelSet();
                        for (int j = setStartIndices[i]; j < (setStartIndices[i] + (m_freeModReelset.Count / m_freeReelset.SetCount)); j++)
                        {
                            temp.AddReel(set.Reels[j]);
                        }
                        inSet.Add(temp);
                    }
                    stride = temp.Count / m_reelWidth;
                    break;
            }
            int sets = inSet.Count;
            set.SetCount = sets;
            int subIndex = 1;
            foreach (BallyReelSet group in inSet)
            {
                sets = group.Count / m_reelWidth;
                int count = 0;
                do
                {
                    temp = new BallyReelSet();
                    temp.Name = set.Name + (count + 1).ToString() + "_" + subIndex.ToString() + "_";
                    subIndex++;
                    for (int index = count; index < group.Count; index += sets)
                    {
                        temp.AddReel(group.Reels[index]);
                    }
                    subset.Add(temp);
                    count++;
                } while (count < sets);
            }

            return subset;
        }