Esempio n. 1
0
        protected void GenerateLine(IFrameEggPID frame)
        {
            foreach (int columnIndex in selectedColumns)
            {
                if (dataGrid.Columns[columnIndex].Name == "ShinyFlipSequence")
                {
                    sb.AppendFormat("{0:" + dataGrid.Columns[columnIndex].DefaultCellStyle.Format + "}",
                                    frame.GetType().GetProperty(dataGrid.Columns[columnIndex].DataPropertyName).GetValue
                                        (frame, null).ToString().Replace(", ", "\t"));
                    sb.Append("\t");
                }
                else
                {
                    sb.AppendFormat("{0:" + dataGrid.Columns[columnIndex].DefaultCellStyle.Format + "}",
                                    frame.GetType().GetProperty(dataGrid.Columns[columnIndex].DataPropertyName).GetValue
                                        (frame, null));
                    sb.Append("\t");
                }
            }

            sb.Append(Environment.NewLine);
        }
Esempio n. 2
0
        private void Generate4thGenEggPIDJob(uint minEfgh, uint maxEfgh)
        {
            uint searchRange = generator.MaxResults;

            //  Iterate through all AB
            for (uint ab = 0; ab <= 255; ab++)
            {
                waitHandle.WaitOne();
                //  Iterate through all CD
                for (uint cd = 0; cd <= 23; cd++)
                {
                    //  Iterate through delay range + year
                    for (uint efgh = minEfgh; efgh <= maxEfgh; efgh++)
                    {
                        //  First we need to build a seed for this iteration
                        //  based on all of our information.  This should be
                        //  fairly easy since we are not using dates ;)
                        uint seed = (ab << 24) + (cd << 16) + efgh;

                        //  Set this to our seed here
                        generator.InitialSeed = seed;

                        if (iframesEggShiny.Count > 1000000)
                            break;

                        //  This is where we actually go ahead and call our
                        //  generator for a list of egg PIDs based on parameters
                        //  that have been passed in.
                        List<Frame> frames = generator.Generate(frameCompare, id, sid);

                        progressSearched += searchRange;
                        progressFound += (uint) frames.Count;

                        //  Now we need to iterate through each result here
                        //  and create a collection of the information that
                        //  we are going to place into our grid.
                        foreach (Frame frame in frames)
                        {
                            var iframeEgg = new IFrameEggPID();
                            frame.DisplayPrep();

                            iframeEgg.Offset = frame.Number;
                            iframeEgg.Seed = seed;
                            iframeEgg.Pid = frame.Pid;
                            iframeEgg.Shiny = frame.Shiny;

                            lock (threadLock)
                            {
                                iframesEggShiny.Add(iframeEgg);
                            }
                            refreshQueue = true;
                        }
                    }
                }
            }
        }
Esempio n. 3
0
        protected void GenerateLine(IFrameEggPID frame)
        {
            foreach (int columnIndex in selectedColumns)
            {
                if (dataGrid.Columns[columnIndex].Name == "ShinyFlipSequence")
                {
                    sb.AppendFormat("{0:" + dataGrid.Columns[columnIndex].DefaultCellStyle.Format + "}",
                                    frame.GetType().GetProperty(dataGrid.Columns[columnIndex].DataPropertyName).GetValue
                                        (frame, null).ToString().Replace(", ", "\t"));
                    sb.Append("\t");
                }
                else
                {
                    sb.AppendFormat("{0:" + dataGrid.Columns[columnIndex].DefaultCellStyle.Format + "}",
                                    frame.GetType().GetProperty(dataGrid.Columns[columnIndex].DataPropertyName).GetValue
                                        (frame, null));
                    sb.Append("\t");
                }
            }

            sb.Append(Environment.NewLine);
        }