예제 #1
0
파일: Info.cs 프로젝트: Ceeeeed/TFT-BOT
    public static void UpdateStore()
    {
        List <Bitmap> list = Manager.bitmaps.championList;

        for (int s = 0; s < store.Length; s++)
        {
            Rectangle rect;
            if (s == 0 || s == 1 || s == 2)
            {
                rect = new Rectangle(613 + storeSlotOffset * s, 958, 25, 25);
            }
            else
            {
                rect = new Rectangle(614 + storeSlotOffset * s, 958, 25, 25);
            }

            for (int i = 0; i < list.Count; i++)
            {
                if (ImageFinder.FindOnScreen(list[i], rect))
                {
                    store[s] = Champions.allChampionsFindByName((ChampionName)i);
                    break;
                }
            }
        }
    }
        public Tuple <SceneMetadata, SceneInfo, ImageCollection> Read(string tag, bool image)
        {
            // Read plant information from an xml file.
            if (!fileMappings.ContainsKey(tag))
            {
                return(null);
            }

            List <PlantInfo> plants = new List <PlantInfo>();

            // Load document
            XmlDocument doc = new XmlDocument();

            doc.Load(fileMappings[tag]);

            XmlNode metadataNode = doc.SelectSingleNode("/rsml/metadata");

            SceneMetadata metadata = ReadMetadata(metadataNode);

            XmlNode   sceneNode = doc.SelectSingleNode("/rsml/scene");
            SceneInfo scene     = ReadScene(sceneNode);

            var imageGroup = new ImageCollection();

            if (image)
            {
                imageGroup = ImageFinder.ImageSearch(Path.GetDirectoryName(fileMappings[tag]), tag);
            }

            return(new Tuple <SceneMetadata, SceneInfo, ImageCollection>(metadata, scene, imageGroup));
        }
예제 #3
0
        public async Task FindAsync_FindRecent()
        {
            var imageFinder = new ImageFinder();
            var files       = await imageFinder.FindAsync();

            Assert.IsTrue(files.Count > 0);
        }
예제 #4
0
        public void Find_FindRecent()
        {
            var imageFinder = new ImageFinder();
            var files       = imageFinder.Find();

            Assert.IsTrue(files.Count > 0);
        }
예제 #5
0
        // TODO: organise Screen.cs

        /// <summary>
        /// Searches a region of the screen for an image.
        /// </summary>
        /// <param name="OutputVarX">
        /// The X and Y coordinates of the upper left corner of the rectangle to search, which can be expressions. Coordinates are relative to the active window unless CoordMode was used to change that.
        /// </param>
        /// <param name="OutputVarY">See <paramref name="OutputVarX"/>.</param>
        /// <param name="X1">The X and Y coordinates of the upper left corner of the rectangle to search, which can be expressions. Coordinates are relative to the active window unless CoordMode was used to change that.</param>
        /// <param name="Y1">See <paramref name="X1"/>.</param>
        /// <param name="X2">The X and Y coordinates of the lower right corner of the rectangle to search, which can be expressions. Coordinates are relative to the active window unless CoordMode was used to change that.</param>
        /// <param name="Y2">See <paramref name="X2"/>.</param>
        /// <param name="OptionsImageFile">
        /// <para>The file name of an image, which is assumed to be in %A_WorkingDir% if an absolute path isn't specified. All operating systems support GIF, JPG, BMP, ICO, CUR, and ANI images (BMP images must be 16-bit or higher). Other sources of icons include the following types of files: EXE, DLL, CPL, SCR, and other types that contain icon resources. On Windows XP or later, additional image formats such as PNG, TIF, Exif, WMF, and EMF are supported. Operating systems older than XP can be given support by copying Microsoft's free GDI+ DLL into the AutoHotkey.exe folder (but in the case of a compiled script, copy the DLL into the script's folder). To download the DLL, search for the following phrase at www.microsoft.com: gdi redistributable</para>
        /// <para>Options: Zero or more of the following strings may be also be present immediately before the name of the file. Separate each option from the next with a single space or tab. For example: *2 *w100 *h-1 C:\Main Logo.bmp</para>
        /// <para>*IconN: To use an icon group other than the first one in the file, specify *Icon followed immediately by the number of the group. For example, *Icon2 would load the default icon from the second icon group.</para>
        /// <para>*n (variation): Specify for n a number between 0 and 255 (inclusive) to indicate the allowed number of shades of variation in either direction for the intensity of the red, green, and blue components of each pixel's color. For example, *2 would allow two shades of variation. This parameter is helpful if the coloring of the image varies slightly or if ImageFile uses a format such as GIF or JPG that does not accurately represent an image on the screen. If you specify 255 shades of variation, all colors will match. The default is 0 shades.</para>
        /// <para>*TransN: This option makes it easier to find a match by specifying one color within the image that will match any color on the screen. It is most commonly used to find PNG, GIF, and TIF files that have some transparent areas (however, icons do not need this option because their transparency is automatically supported). For GIF files, *TransWhite might be most likely to work. For PNG and TIF files, *TransBlack might be best. Otherwise, specify for N some other color name or RGB value (see the color chart for guidance, or use PixelGetColor in its RGB mode). Examples: *TransBlack, *TransFFFFAA, *Trans0xFFFFAA</para>
        /// <para>*wn and *hn: Width and height to which to scale the image (this width and height also determines which icon to load from a multi-icon .ICO file). If both these options are omitted, icons loaded from ICO, DLL, or EXE files are scaled to the system's default small-icon size, which is usually 16 by 16 (you can force the actual/internal size to be used by specifying *w0 *h0). Images that are not icons are loaded at their actual size. To shrink or enlarge the image while preserving its aspect ratio, specify -1 for one of the dimensions and a positive number for the other. For example, specifying *w200 *h-1 would make the image 200 pixels wide and cause its height to be set automatically.</para>
        /// </param>
        public static void ImageSearch(out int? OutputVarX, out int? OutputVarY, string X1, string Y1, string X2, string Y2, string OptionsImageFile)
        {
            OutputVarX = null;
            OutputVarY = null;

            var optsItems = new Dictionary<string, Regex>();
            optsItems.Add(Keyword_Icon, new Regex(@"\*icon([0-9]*)"));
            optsItems.Add(Keyword_Trans, new Regex(@"\*trans([0-9]*)"));
            optsItems.Add(Keyword_Variation, new Regex(@"\*([0-9]*)"));
            optsItems.Add("w", new Regex(@"\*w([-0-9]*)"));
            optsItems.Add("h", new Regex(@"\*h([-0-9]*)"));

            var opts = ParseOptionsRegex(ref OptionsImageFile, optsItems, true);
            OptionsImageFile = OptionsImageFile.Trim();

            Point start;
            Size bound;
            Bitmap find;

            try
            {
                start = new Point(int.Parse(X1), int.Parse(Y1));
                bound = new Size(int.Parse(X2) - start.X, int.Parse(Y2) - start.Y);
                find = (Bitmap)Bitmap.FromFile(OptionsImageFile);
            }
            catch (FormatException)
            {
                ErrorLevel = 2;
                return;
            }

            var source = GetScreen(new Rectangle(start, bound));
            byte variation = 0;

            if (opts.ContainsKey(Keyword_Variation))
                byte.TryParse(opts[Keyword_Variation], out variation);

            var SearchImg = new ImageFinder(source) { Variation = variation };

            Point? location;

            try
            {
                location = SearchImg.Find(find);
            }
            catch
            {
                ErrorLevel = 2;
                return;
            }

            if (location.HasValue)
            {
                OutputVarX = location.Value.X;
                OutputVarY = location.Value.Y;
                ErrorLevel = 0;
            }
            else
                ErrorLevel = 1;
        }
예제 #6
0
        public void Find_FindAll()
        {
            var imageFinder = new ImageFinder();
            var files       = imageFinder.Find(false);

            Assert.IsTrue(files.Count > 0);
        }
        /// <summary>
        ///     Convert images used in blog posts into WebP format.
        /// </summary>
        /// <param name="imageFinder"></param>
        /// <param name="imageConverter"></param>
        private static void ConvertAssets(ImageFinder imageFinder, IImageConverter imageConverter)
        {
            var blogAssetsConverter = new BlogAssetConversionJob(imageFinder, imageConverter);

            blogAssetsConverter.Convert(@"d:\Projekty\Taurit.Blog\input\assets\img\posts\",
                                        @"d:\Projekty\Taurit.Blog\input\",
                                        @"/assets/img/posts/");
        }
예제 #8
0
        public void TestMethod1()
        {
            var imageFinder    = new ImageFinder();
            var imageFileInfos = imageFinder.Find(false);
            var imageCopier    = new ImageCopier(@"G:\OneDrive\Documents\WallPapers\BingWallpaper", imageFileInfos);

            imageCopier.CopyMissingImages();
        }
예제 #9
0
        private void Initialise(string folder)
        {
            _imageFinder = new ImageFinder();
            var fileInfos = _imageFinder.Find();

            _imageCopier = new ImageCopier(folder, fileInfos);
            _checksum    = new Checksum(_imageCopier);
        }
예제 #10
0
        public async Task<IEnumerable<NewsFeedCommentRow>> CommentSelect(ToracGolfContext dbContext, int userId, int id, NewsFeedItemModel.NewsFeedTypeId newsFeedTypeId, ImageFinder userImageFinder)
        {
            var data = await CommentRepository.GetComments().AsNoTracking()
                         .Where(x => x.AreaId == id && x.NewsFeedTypeId == (int)newsFeedTypeId)
                         .OrderByDescending(x => x.CreatedDate)
                         .Select(CommentRepository.SelectCommand).ToListAsync().ConfigureAwait(false);

            data.ForEach(x => x.UserProfileUrl = userImageFinder.FindImage(x.UserIdThatMadeComment));

            return data;
        }
예제 #11
0
파일: Info.cs 프로젝트: Ceeeeed/TFT-BOT
 public static void UpdatePlanning()
 {
     if (ImageFinder.FindOnScreen(Manager.bitmaps.planning, new Rectangle(901, 120, 2, 2)))
     {
         planning = true;
     }
     else
     {
         planning = false;
     }
 }
        public void FullPath_ShouldBeAProperWindowsPath()
        {
            ImageFinder sut = new ImageFinder();
            var         alternativePaths =
                sut.GetPotentialInstances("d:\\Projekty\\Taurit.Blog\\input\\", "/assets/img/image.jpg");

            var firstGeneratedPath = alternativePaths.First().FullPath;

            Console.WriteLine(firstGeneratedPath);
            Assert.IsTrue(firstGeneratedPath.StartsWith("d:\\Projekty\\Taurit.Blog\\input\\"));
            Assert.IsTrue(!firstGeneratedPath.Contains("/"));
        }
예제 #13
0
        public async Task<NewsFeedQueryResult> NewsFeedPostSelect(int userId, NewsFeedItemModel.NewsFeedTypeId? newsFeedTypeIdFilter, string searchFilterText, ImageFinder courseImageFinder, ImageFinder userImageLocator)
        {
            const int takeAmount = 20;

            var newsFeedItems = new List<NewsFeedItemModel>();

            int newCourseCount;
            int newRoundCount;

            //grab the user's friends
            var usersFriendIds = await FriendsDataProvider.GetUsersFriendList(DbContext, userId).ToArrayAsync();

            //let's go grab the round query
            var roundQuery = RoundGet().AsNoTracking()
                            .Where(x => x.UserId == userId || usersFriendIds.Contains(x.UserId))
                            .OrderByDescending(x => x.RoundDate)
                            .Take(takeAmount);

            //go build the course query
            var courseQuery = CourseGet().AsNoTracking()
                              .OrderByDescending(x => x.CreatedDate)
                              .Take(takeAmount);

            //add the filters now
            if (!string.IsNullOrEmpty(searchFilterText))
            {
                //round query filter
                roundQuery = roundQuery.Where(x => x.User.FirstName.Contains(searchFilterText) || x.User.LastName.Contains(searchFilterText) || x.Course.Name.Contains(searchFilterText));

                //course query filter
                courseQuery = courseQuery.Where(x => x.Name.Contains(searchFilterText) || x.Description.Contains(searchFilterText) || x.City.Contains(searchFilterText));
            }

            //grab the count of records we have before we go filter by news feed filter type, we always want the count of all items
            newRoundCount = await roundQuery.CountAsync();
            newCourseCount = await courseQuery.CountAsync();

            //do they want to filter one or the other?
            //only rounds?
            if (ShouldRunQuery(NewsFeedItemModel.NewsFeedTypeId.NewRound, newsFeedTypeIdFilter))
            {
                newsFeedItems.AddRange(await RoundSelect(roundQuery, userId, courseImageFinder, userImageLocator));
            }

            if (ShouldRunQuery(NewsFeedItemModel.NewsFeedTypeId.NewCourse, newsFeedTypeIdFilter))
            {
                newsFeedItems.AddRange(await CourseSelect(courseQuery, userId, courseImageFinder));
            }

            //now return the model
            return new NewsFeedQueryResult(newsFeedItems.OrderByDescending(x => x.PostDate).ToArray(), newRoundCount, newCourseCount, usersFriendIds.Length);
        }
예제 #14
0
파일: Screen.cs 프로젝트: pschuegr/IronAHK
        /// <summary>
        /// Searches a region of the screen for a pixel of the specified color.
        /// </summary>
        /// <param name="OutputVarX">
        /// <para>The names of the variables in which to store the X and Y coordinates of the first pixel that matches ColorID (if no match is found, the variables are made blank). Coordinates are relative to the active window unless CoordMode was used to change that.</para>
        /// <para>Either or both of these parameters may be left blank, in which case ErrorLevel (see below) can be used to determine whether a match was found.</para>
        /// </param>
        /// <param name="OutputVarY">See <paramref name="OutputVarX"/>.</param>
        /// <param name="X1">The X and Y coordinates of the upper left corner of the rectangle to search, which can be expressions. Coordinates are relative to the active window unless CoordMode was used to change that.</param>
        /// <param name="Y1">See <paramref name="X1"/>.</param>
        /// <param name="X2">The X and Y coordinates of the lower right corner of the rectangle to search, which can be expressions. Coordinates are relative to the active window unless CoordMode was used to change that.</param>
        /// <param name="Y2">See <paramref name="X2"/>.</param>
        /// <param name="ColorID">The decimal or hexadecimal color ID to search for, in Blue-Green-Red (BGR) format, which can be an expression. Color IDs can be determined using Window Spy (accessible from the tray menu) or via PixelGetColor. For example: 0x9d6346</param>
        /// <param name="Variation">A number between 0 and 255 (inclusive) to indicate the allowed number of shades of variation in either direction for the intensity of the red, green, and blue components of the color (can be an expression). This parameter is helpful if the color sought is not always exactly the same shade. If you specify 255 shades of variation, all colors will match. The default is 0 shades.</param>
        /// <param name="Fast_RGB">
        /// <para>This parameter may contain the word Fast, RGB, or both (if both are present, separate them with a space; that is, Fast RGB).</para>
        /// <para>Fast: Uses a faster searching method that in most cases dramatically reduces the amount of CPU time used by the search. Although color depths as low as 8-bit (256-color) are supported, the fast mode performs much better in 24-bit or 32-bit color. If the screen's color depth is 16-bit or lower, the Variation parameter might behave slightly differently in fast mode than it does in slow mode. Finally, the fast mode searches the screen row by row (top down) instead of column by column. Therefore, it might find a different pixel than that of the slow mode if there is more than one matching pixel.</para>
        /// <para>RGB: Causes ColorID to be interpreted as an RGB value instead of BGR. In other words, the red and blue components are swapped.</para>
        /// <para>ARGB: Causes ColorID to be interpreted as an ARGB value instead of BGR. In other words, the red and blue components are swapped and also alpha chanel is recognized.</para>
        /// </param>
        public static void PixelSearch(out int?OutputVarX, out int?OutputVarY, int X1, int Y1, int X2, int Y2, int ColorID, int Variation, string Fast_RGB)
        {
            OutputVarX = null;
            OutputVarY = null;
            Variation  = Math.Max(byte.MinValue, Math.Min(byte.MaxValue, Variation));
            Fast_RGB   = Fast_RGB.ToLowerInvariant();
            var region = new Rectangle(X1, Y1, X2 - X1, Y2 - Y1);
            var finder = new ImageFinder(GetScreen(region))
            {
                Variation = (byte)Variation
            };
            Color needle;

            if (Fast_RGB.Contains(Keyword_ARGB))
            {
                needle = Color.FromArgb(ColorID);
            }
            else if (Fast_RGB.Contains(Keyword_RGB))
            {
                needle = Color.FromArgb((int)((ColorID | (0xff << 24)) & 0xffffffff));
            }
            else
            {
                needle = Color.FromArgb(0xff, ColorID & 0xff, (ColorID >> 8) & 0xff, (ColorID >> 16) & 0xff);
            }

            Point?location;

            try
            {
                location = finder.Find(needle);
            }
            catch
            {
                ErrorLevel = 2;
                return;
            }

            if (location.HasValue)
            {
                OutputVarX = location.Value.X;
                OutputVarY = location.Value.Y;
                ErrorLevel = 0;
            }
            else
            {
                ErrorLevel = 1;
            }
        }
예제 #15
0
파일: Info.cs 프로젝트: Ceeeeed/TFT-BOT
    public static void UpdateExp()
    {
        List <Bitmap> list = Manager.bitmaps.expList;

        for (int i = 0; i < list.Count; i++)
        {
            if (ImageFinder.FindOnScreen(list[i], new Rectangle(282, 1044, 31, 24)))
            {
                exp = i * 2;
                return;
            }
        }

        Console.WriteLine("Nie znaleziono bitmapy z expem!");
    }
예제 #16
0
        private static void Main(string[] args)
        {
            ImageFinder sut = new ImageFinder();
            var         alternativePaths = sut.GetPotentialInstances("d:\\Projekty\\Taurit.Blog.input", "/assets/img/posts/pavlovs-dogs-mark-stivers.png");


            //var sut = new FigTagFinder(HtmlFragment);
            //var tags = sut.FoundTags;
            //Debug.Assert(tags.Count == 1);
            //Debug.Assert(tags[0].Width == 6);

            //var renderedHtml = new FigTagRenderer(tags[0], new ImageFinder()).Render(123, "/");
            //Console.WriteLine(renderedHtml);
            //Console.ReadLine();
        }
예제 #17
0
        public async Task<IEnumerable<NewsFeedCommentRow>> CommentAdd(ToracGolfContext dbContext, int userId, int id, NewsFeedItemModel.NewsFeedTypeId newsFeedTypeId, string commentToAdd, ImageFinder userImageFinder)
        {
            //lets go add the row
            await CommentRepository.Add(new NewsFeedComment
            {
                AreaId = id,
                NewsFeedTypeId = (int)newsFeedTypeId,
                UserIdThatCommented = userId,
                CreatedDate = DateTime.Now,
                Comment = commentToAdd
            });

            //go return this posts comment
            return await CommentSelect(dbContext, userId, id, newsFeedTypeId, userImageFinder);
        }
예제 #18
0
파일: Info.cs 프로젝트: Ceeeeed/TFT-BOT
 public static void UpdateHP()
 {
     if (!lowHp)
     {
         ImageFinder.FindOnScreen(Manager.bitmaps.hp, new Rectangle(1858, 161, 1, 648), out List <Point> points);
         if (points.Count > 0)
         {
             Color emptyCol = Color.FromArgb(255, 22, 24, 33);
             if (ImageFinder.screen.GetPixel(points[0].X, points[0].Y + 55) == emptyCol)
             {
                 lowHp = true;
             }
         }
     }
 }
예제 #19
0
        private string FixImages(string contentBefore, string rootPathOfTheBlog)
        {
            var newContent   = contentBefore;
            var foundFigTags = new FigTagFinder(contentBefore).FoundTags;
            var ordinal      = 1;
            var imageFinder  = new ImageFinder();

            foreach (var figTag in foundFigTags)
            {
                var renderer        = new FigTagRenderer(figTag, imageFinder);
                var renderedPicture = renderer.Render(ordinal++, rootPathOfTheBlog);
                newContent = newContent.Replace(figTag.RawHtml, renderedPicture);
            }
            return(newContent);
        }
예제 #20
0
파일: Info.cs 프로젝트: Ceeeeed/TFT-BOT
    public static void UpdateGold()
    {
        List <Bitmap> list = Manager.bitmaps.goldList;

        for (int i = 0; i < list.Count; i++)
        {
            if (ImageFinder.FindOnScreen(list[i], new Rectangle(875, 888, 27, 17)))
            {
                gold = i;
                return;
            }
        }

        Console.WriteLine("Nie znaleziono bitmapy z goldem!");
    }
예제 #21
0
        public override void Body()
        {
            Bitmap      mainImage   = Logger.Slideshow.ScreenCapturer.Capture(false);
            Bitmap      subImage    = Bitmap.FromFile(file) as Bitmap;
            ImageFinder imageFinder = new ImageFinder(mainImage, subImage);

            Rectangle r;
            double    correlation = imageFinder.Find(out r);

            if (correlation < 0.85)
            {
                LogFailedByExpectedResult("Couldn't find the image within the desktop", "");
                ActualResult = QAliber.RemotingModel.TestCaseResult.Failed;
            }
            else
            {
                int x = r.X + r.Width / 2;
                int y = r.Y + r.Height / 2;
                switch (actionType)
                {
                case ControlActionType.MoveMouse:
                    QAliber.Engine.Controls.Desktop.UIA.MoveMouseTo(new System.Windows.Point(x, y));
                    break;

                case ControlActionType.Click:
                    QAliber.Engine.Controls.Desktop.UIA.Click(button, new System.Windows.Point(x, y));
                    break;

                case ControlActionType.DoubleClick:
                    QAliber.Engine.Controls.Desktop.UIA.DoubleClick(button, new System.Windows.Point(x, y));
                    break;

                case ControlActionType.Drag:
                    QAliber.Engine.Controls.Desktop.UIA.Drag(button, new System.Windows.Point(x, y), new System.Windows.Point(x + dragOffset.Width, y + dragOffset.Height));
                    break;

                case ControlActionType.Write:
                    QAliber.Engine.Controls.Desktop.UIA.Click(MouseButtons.Left, new System.Windows.Point(x, y));
                    QAliber.Engine.Controls.Desktop.UIA.Write(keys);
                    break;

                default:
                    throw new ArgumentException("Can't understand action " + actionType);
                }

                ActualResult = QAliber.RemotingModel.TestCaseResult.Passed;
            }
        }
        public void FileWithAddedWebpExtension_ShouldBeFound()
        {
            ImageFinder sut = new ImageFinder();
            var         alternativePaths = sut.GetPotentialInstances("d:\\Projekty\\Taurit.Blog\\input\\", "/assets/img/image.jpg");

            Assert.AreEqual(1, alternativePaths.Count(path => path.ServerRelativePath == "/assets/img/image.jpg.webp"));
            Assert.AreEqual(1, alternativePaths.Count(path => path.ServerRelativePath == "/assets/img/image.webp"));
            Assert.AreEqual(1,
                            alternativePaths.Count(path => path.ServerRelativePath == "/assets/img/webp/image.jpg.webp"));
            Assert.AreEqual(1,
                            alternativePaths.Count(path => path.ServerRelativePath == "/assets/img/webp/image.webp"));

            Console.WriteLine("Found paths:");
            foreach (var path in alternativePaths)
            {
                Console.WriteLine(path.ServerRelativePath);
            }
        }
예제 #23
0
        public override void Body()
        {
            // Fix up a relative path
            string path = Path.Combine(Path.GetDirectoryName(Scenario.Filename), file);

            if (!System.IO.File.Exists(path))
            {
                Log.Error("Could not find image file",
                          "Could not find image file at " + path, EntryVerbosity.Normal);
                ActualResult = TestCaseResult.Failed;
                return;
            }

            Bitmap      mainImage   = Logger.Slideshow.ScreenCapturer.Capture(false);
            Bitmap      subImage    = new Bitmap(Image.FromFile(path));
            ImageFinder imageFinder = new ImageFinder(mainImage, subImage);

            double correlation;

            Stopwatch watch = new Stopwatch();

            watch.Start();

            do
            {
                correlation = imageFinder.Find(out rect);

                if (Math.Round(correlation, 4) + 0.00005 >= (_correlationPercent / 100.0))
                {
                    LogPassedByExpectedResult("Image was found at " + rect, string.Format("Match percentage: {0:p}", correlation));
                    ActualResult = TestCaseResult.Passed;
                    return;
                }

                mainImage   = Logger.Slideshow.ScreenCapturer.Capture(false);
                imageFinder = new ImageFinder(mainImage, subImage);
            } while(watch.ElapsedMilliseconds < timeout + 3000);

            LogFailedByExpectedResult("Couldn't find the image within the desktop in the timeout given", "");
            Log.Info("Best match", string.Format(
                         "Best match was at {0}, but only matched {1:p} (expected {2})", rect, correlation, _correlationPercent));
            ActualResult = TestCaseResult.Failed;
        }
예제 #24
0
파일: Manager.cs 프로젝트: Ceeeeed/TFT-BOT
    public void Run()
    {
        sw.Start();
        mainClock.Start();
        while (true)
        {
            if (mainClock.ElapsedMilliseconds > 30000)
            {
                ImageFinder.CaptureScreen();
                Info.UpdatePlanning();


                if (Info.planning)
                {
                    NewRound();
                }
            }
            else if (mainClock.ElapsedMilliseconds > 25000)
            {
                if (run == true)
                {
                    Pickupable.PickupAll();
                }

                run = false;
            }

            if (run)
            {
                ImageFinder.CaptureScreen();
                Info.UpdateAll();
            }

            Console.WriteLine($"LowHp: {Info.lowHp}\nMain clock: {mainClock.ElapsedMilliseconds}\nRound: {round}\nGold: {Info.gold}\nExp: {Info.exp}\nLevel: {Info.level}\nCzas skanowania (ms): {sw.ElapsedMilliseconds}\nSklep:\n   {Info.store[0].name}\n   {Info.store[1].name}\n   {Info.store[2].name}\n   {Info.store[3].name}\n   {Info.store[4].name}\n-----------------------");
            sw.Restart();
        }
    }
 public FieldProblem_Wendy()
 {
     _searchPatternBuilder = MockRepository.Mock <ISearchPatternBuilder>();
     _searchPatternBuilder.SetUnexpectedBehavior(UnexpectedCallBehaviors.BaseOrDefault);
     _imageFinder = new ImageFinder(_searchPatternBuilder);
 }
예제 #26
0
파일: Screen.cs 프로젝트: pschuegr/IronAHK
        // TODO: organise Screen.cs

        /// <summary>
        /// Searches a region of the screen for an image.
        /// </summary>
        /// <param name="OutputVarX">
        /// The X and Y coordinates of the upper left corner of the rectangle to search, which can be expressions. Coordinates are relative to the active window unless CoordMode was used to change that.
        /// </param>
        /// <param name="OutputVarY">See <paramref name="OutputVarX"/>.</param>
        /// <param name="X1">The X and Y coordinates of the upper left corner of the rectangle to search, which can be expressions. Coordinates are relative to the active window unless CoordMode was used to change that.</param>
        /// <param name="Y1">See <paramref name="X1"/>.</param>
        /// <param name="X2">The X and Y coordinates of the lower right corner of the rectangle to search, which can be expressions. Coordinates are relative to the active window unless CoordMode was used to change that.</param>
        /// <param name="Y2">See <paramref name="X2"/>.</param>
        /// <param name="OptionsImageFile">
        /// <para>The file name of an image, which is assumed to be in %A_WorkingDir% if an absolute path isn't specified. All operating systems support GIF, JPG, BMP, ICO, CUR, and ANI images (BMP images must be 16-bit or higher). Other sources of icons include the following types of files: EXE, DLL, CPL, SCR, and other types that contain icon resources. On Windows XP or later, additional image formats such as PNG, TIF, Exif, WMF, and EMF are supported. Operating systems older than XP can be given support by copying Microsoft's free GDI+ DLL into the AutoHotkey.exe folder (but in the case of a compiled script, copy the DLL into the script's folder). To download the DLL, search for the following phrase at www.microsoft.com: gdi redistributable</para>
        /// <para>Options: Zero or more of the following strings may be also be present immediately before the name of the file. Separate each option from the next with a single space or tab. For example: *2 *w100 *h-1 C:\Main Logo.bmp</para>
        /// <para>*IconN: To use an icon group other than the first one in the file, specify *Icon followed immediately by the number of the group. For example, *Icon2 would load the default icon from the second icon group.</para>
        /// <para>*n (variation): Specify for n a number between 0 and 255 (inclusive) to indicate the allowed number of shades of variation in either direction for the intensity of the red, green, and blue components of each pixel's color. For example, *2 would allow two shades of variation. This parameter is helpful if the coloring of the image varies slightly or if ImageFile uses a format such as GIF or JPG that does not accurately represent an image on the screen. If you specify 255 shades of variation, all colors will match. The default is 0 shades.</para>
        /// <para>*TransN: This option makes it easier to find a match by specifying one color within the image that will match any color on the screen. It is most commonly used to find PNG, GIF, and TIF files that have some transparent areas (however, icons do not need this option because their transparency is automatically supported). For GIF files, *TransWhite might be most likely to work. For PNG and TIF files, *TransBlack might be best. Otherwise, specify for N some other color name or RGB value (see the color chart for guidance, or use PixelGetColor in its RGB mode). Examples: *TransBlack, *TransFFFFAA, *Trans0xFFFFAA</para>
        /// <para>*wn and *hn: Width and height to which to scale the image (this width and height also determines which icon to load from a multi-icon .ICO file). If both these options are omitted, icons loaded from ICO, DLL, or EXE files are scaled to the system's default small-icon size, which is usually 16 by 16 (you can force the actual/internal size to be used by specifying *w0 *h0). Images that are not icons are loaded at their actual size. To shrink or enlarge the image while preserving its aspect ratio, specify -1 for one of the dimensions and a positive number for the other. For example, specifying *w200 *h-1 would make the image 200 pixels wide and cause its height to be set automatically.</para>
        /// </param>
        public static void ImageSearch(out int?OutputVarX, out int?OutputVarY, string X1, string Y1, string X2, string Y2, string OptionsImageFile)
        {
            OutputVarX = null;
            OutputVarY = null;

            var optsItems = new Dictionary <string, Regex>();

            optsItems.Add(Keyword_Icon, new Regex(@"\*icon([0-9]*)"));
            optsItems.Add(Keyword_Trans, new Regex(@"\*trans([0-9]*)"));
            optsItems.Add(Keyword_Variation, new Regex(@"\*([0-9]*)"));
            optsItems.Add("w", new Regex(@"\*w([-0-9]*)"));
            optsItems.Add("h", new Regex(@"\*h([-0-9]*)"));

            var opts = ParseOptionsRegex(ref OptionsImageFile, optsItems, true);

            OptionsImageFile = OptionsImageFile.Trim();

            Point  start;
            Size   bound;
            Bitmap find;

            try
            {
                start = new Point(int.Parse(X1), int.Parse(Y1));
                bound = new Size(int.Parse(X2) - start.X, int.Parse(Y2) - start.Y);
                find  = (Bitmap)Bitmap.FromFile(OptionsImageFile);
            }
            catch (FormatException)
            {
                ErrorLevel = 2;
                return;
            }

            var  source    = GetScreen(new Rectangle(start, bound));
            byte variation = 0;

            if (opts.ContainsKey(Keyword_Variation))
            {
                byte.TryParse(opts[Keyword_Variation], out variation);
            }

            var SearchImg = new ImageFinder(source)
            {
                Variation = variation
            };

            Point?location;

            try
            {
                location = SearchImg.Find(find);
            }
            catch
            {
                ErrorLevel = 2;
                return;
            }

            if (location.HasValue)
            {
                OutputVarX = location.Value.X;
                OutputVarY = location.Value.Y;
                ErrorLevel = 0;
            }
            else
            {
                ErrorLevel = 1;
            }
        }
예제 #27
0
파일: Screen.cs 프로젝트: Tyelpion/IronAHK
        /// <summary>
        /// Searches a region of the screen for a pixel of the specified color.
        /// </summary>
        /// <param name="OutputVarX">
        /// <para>The names of the variables in which to store the X and Y coordinates of the first pixel that matches ColorID (if no match is found, the variables are made blank). Coordinates are relative to the active window unless CoordMode was used to change that.</para>
        /// <para>Either or both of these parameters may be left blank, in which case ErrorLevel (see below) can be used to determine whether a match was found.</para>
        /// </param>
        /// <param name="OutputVarY">See <paramref name="OutputVarX"/>.</param>
        /// <param name="X1">The X and Y coordinates of the upper left corner of the rectangle to search, which can be expressions. Coordinates are relative to the active window unless CoordMode was used to change that.</param>
        /// <param name="Y1">See <paramref name="X1"/>.</param>
        /// <param name="X2">The X and Y coordinates of the lower right corner of the rectangle to search, which can be expressions. Coordinates are relative to the active window unless CoordMode was used to change that.</param>
        /// <param name="Y2">See <paramref name="X2"/>.</param>
        /// <param name="ColorID">The decimal or hexadecimal color ID to search for, in Blue-Green-Red (BGR) format, which can be an expression. Color IDs can be determined using Window Spy (accessible from the tray menu) or via PixelGetColor. For example: 0x9d6346</param>
        /// <param name="Variation">A number between 0 and 255 (inclusive) to indicate the allowed number of shades of variation in either direction for the intensity of the red, green, and blue components of the color (can be an expression). This parameter is helpful if the color sought is not always exactly the same shade. If you specify 255 shades of variation, all colors will match. The default is 0 shades.</param>
        /// <param name="Fast_RGB">
        /// <para>This parameter may contain the word Fast, RGB, or both (if both are present, separate them with a space; that is, Fast RGB).</para>
        /// <para>Fast: Uses a faster searching method that in most cases dramatically reduces the amount of CPU time used by the search. Although color depths as low as 8-bit (256-color) are supported, the fast mode performs much better in 24-bit or 32-bit color. If the screen's color depth is 16-bit or lower, the Variation parameter might behave slightly differently in fast mode than it does in slow mode. Finally, the fast mode searches the screen row by row (top down) instead of column by column. Therefore, it might find a different pixel than that of the slow mode if there is more than one matching pixel.</para>
        /// <para>RGB: Causes ColorID to be interpreted as an RGB value instead of BGR. In other words, the red and blue components are swapped.</para>
        /// <para>ARGB: Causes ColorID to be interpreted as an ARGB value instead of BGR. In other words, the red and blue components are swapped and also alpha chanel is recognized.</para>
        /// </param>
        public static void PixelSearch(out int? OutputVarX, out int? OutputVarY, int X1, int Y1, int X2, int Y2, int ColorID, int Variation, string Fast_RGB)
        {
            OutputVarX = null;
            OutputVarY = null;
            Variation = Math.Max(byte.MinValue, Math.Min(byte.MaxValue, Variation));
            Fast_RGB = Fast_RGB.ToLowerInvariant();
            var region = new Rectangle(X1, Y1, X2 - X1, Y2 - Y1);
            var finder = new ImageFinder(GetScreen(region))
            {
                Variation = (byte) Variation
            };
            Color needle;

            if (Fast_RGB.Contains(Keyword_ARGB))
                needle = Color.FromArgb(ColorID);
            else if (Fast_RGB.Contains(Keyword_RGB))
                needle = Color.FromArgb((int) ((ColorID | (0xff << 24)) & 0xffffffff));
            else
                needle = Color.FromArgb(0xff, ColorID & 0xff, (ColorID >> 8) & 0xff, (ColorID >> 16) & 0xff);

            Point? location;

            try
            {
                location = finder.Find(needle);
            }
            catch
            {
                ErrorLevel = 2;
                return;
            }

            if (location.HasValue)
            {
                OutputVarX = location.Value.X;
                OutputVarY = location.Value.Y;
                ErrorLevel = 0;
            }
            else
                ErrorLevel = 1;
        }
예제 #28
0
 public FieldProblem_Wendy()
 {
     _searchPatternBuilder = MockRepository.GenerateMock<ISearchPatternBuilder>();
     _imageFinder = new ImageFinder(_searchPatternBuilder);
 }
 public BlogAssetConversionJob(ImageFinder imageFinder, IImageConverter imageConverter)
 {
     _imageFinder    = imageFinder;
     _imageConverter = imageConverter;
 }
예제 #30
0
        private async Task<IEnumerable<NewRoundNewsFeed>> RoundSelect(IQueryable<Round> query, int userId, ImageFinder courseImageFinder, ImageFinder userImageFinder)
        {
            int newRoundTypeId = (int)NewsFeedItemModel.NewsFeedTypeId.NewRound;

            return (await query.Select(y => new
            {
                UserId = y.UserId,
                UserName = y.User.FirstName + " " + y.User.LastName,
                RoundId = y.RoundId,
                RoundDate = y.RoundDate,
                Score = y.Score,
                CourseId = y.CourseId,
                CourseName = y.Course.Name,
                TeeBoxDescription = y.CourseTeeLocation.Description,
                Likes = DbContext.NewsFeedLike.Count(x => x.NewsFeedTypeId == newRoundTypeId && x.AreaId == y.RoundId),
                Comments = DbContext.NewsFeedComment.Count(x => x.NewsFeedTypeId == newRoundTypeId && x.AreaId == y.RoundId),
                AdjustedScore = y.Score - y.Handicap.HandicapBeforeRound,
                RoundHandicap = y.RoundHandicap,
                YouLikedItem = DbContext.NewsFeedLike.Any(x => x.AreaId == y.RoundId && x.NewsFeedTypeId == newRoundTypeId && x.UserIdThatLikedItem == userId)
            }).ToArrayAsync()).Select(x => new NewRoundNewsFeed
            {
                Id = x.RoundId,
                CourseId = x.CourseId,
                CourseImagePath = courseImageFinder.FindImage(x.CourseId),
                PostDate = x.RoundDate,
                CommentCount = x.Comments,
                LikeCount = x.Likes,
                YouLikedItem = x.YouLikedItem,
                TitleOfPost = string.Format($"{(x.UserId == userId ? "You" : x.UserName)} Scored A {x.Score} At {x.CourseName} - {x.TeeBoxDescription}"),
                BodyOfPost = new NewRoundBody
                {
                    AdjustedScore = Convert.ToInt32(Math.Round(x.AdjustedScore, 1)),
                    RoundHandicap = Math.Round(x.RoundHandicap, 2),
                    UserImageUrl = userImageFinder.FindImage(x.UserId)
                }
            });
        }
예제 #31
0
 public async Task<NewsFeedQueryResult> NewsFeedPostSelect(int userId, NewsFeedItemModel.NewsFeedTypeId? newsFeedTypeIdFilter, string searchFilterText, ImageFinder courseImageLocator, ImageFinder userImageLocator)
 {
     return await GridQueryRepository.NewsFeedPostSelect(userId, newsFeedTypeIdFilter, searchFilterText, courseImageLocator, userImageLocator).ConfigureAwait(false);
 }
예제 #32
0
        /// <param name="pageId">0 base index that holds what page we are on</param>
        public static async Task<IEnumerable<CourseListingData>> CourseSelect(IListingFactory<CourseListingFactory.CourseListingSortEnum, Course, CourseListingData> courseListingFactory,
                                                                              ToracGolfContext dbContext,
                                                                              int pageId,
                                                                              CourseListingFactory.CourseListingSortEnum sortBy,
                                                                              string courseNameFilter,
                                                                              int? stateFilter,
                                                                              int recordsPerPage,
                                                                              int userId,
                                                                              ImageFinder courseImageFinder)
        {
            //go grab the query
            var queryable = CourseSelectQueryBuilder(dbContext, courseListingFactory, courseNameFilter, stateFilter);

            //go sort the data
            var sortedQueryable = courseListingFactory.SortByConfiguration[sortBy](queryable, new ListingFactoryParameters(dbContext, userId)).ThenBy(x => x.CourseId);

            //go run the query now
            var query = sortedQueryable.Select(x => new CourseListingData
            {
                CourseData = x,
                StateDescription = x.State.Description,
                TeeLocationCount = x.CourseTeeLocations.Count,

                NumberOfRounds = x.Rounds.Count(y => y.UserId == userId),
                TopScore = x.Rounds.Where(y => y.UserId == userId).Min(y => y.Score),
                WorseScore = x.Rounds.Where(y => y.UserId == userId).Max(y => y.Score),
                AverageScore = x.Rounds.Where(y => y.UserId == userId).Average(y => y.Score),

                FairwaysHit = x.Rounds.Where(y => y.UserId == userId).Sum(y => y.FairwaysHit),
                FairwaysHitAttempted = x.Rounds.Where(y => y.UserId == userId).Sum(y => y.CourseTeeLocation.FairwaysOnCourse),
                GreensInRegulation = x.Rounds.Where(y => y.UserId == userId).Average(y => y.GreensInRegulation),
                NumberOfPutts = x.Rounds.Where(y => y.UserId == userId).Average(y => y.Putts)
            });

            //go execute it and return it
            var data = await EFPaging.PageEfQuery(query, pageId, recordsPerPage).ToListAsync().ConfigureAwait(false);

            //go find the course paths
            data.ForEach(x => x.CourseImageLocation = courseImageFinder.FindImage(x.CourseData.CourseId));

            //return the data set
            return data;
        }
예제 #33
0
        public void Input_WithRelativeImageFilePath_ExistsInPdf()
        {
            HtmlToPdfRunner runner = new HtmlToPdfRunner(HtmlToPdfRunner.HtmlToPdfExe);

            using (TempDirectory tempDirectory = new TempDirectory())
            {
                // create image
                string expectedTextInImage = "test";

                using (TempImageFile tempImageFile = new TempImageFile(expectedTextInImage, this.TestContext))
                {
                    tempImageFile.MoveToDirectory(tempDirectory.DirectoryPath);

                    // create HTML file
                    string html = $@"<!DOCTYPE html>
<html>
  <head>
  </head>
  <body>
   <img src=""{tempImageFile.FileName}"" />
  </body>
</html>";

                    using (TempHtmlFile htmlFile = new TempHtmlFile(html))
                    {
                        htmlFile.MoveToDirectory(tempDirectory.DirectoryPath);

                        using (TempPdfFile pdfFile = new TempPdfFile(this.TestContext))
                        {
                            string             commandLine = $"\"{htmlFile.FilePath}\" \"{pdfFile.FilePath}\"";
                            HtmlToPdfRunResult result      = runner.Run(commandLine);
                            Assert.AreEqual(0, result.ExitCode, result.Output);

                            using (PdfReader pdfReader = new PdfReader(pdfFile.FilePath))
                            {
                                using (PdfDocument pdfDocument = new PdfDocument(pdfReader))
                                {
                                    int pageCount = pdfDocument.GetNumberOfPages();
                                    Assert.AreEqual(1, pageCount);

                                    PdfPage page = pdfDocument.GetPage(1);

                                    ImageFinder        imageFinder = new ImageFinder();
                                    PdfCanvasProcessor processor   = new PdfCanvasProcessor(imageFinder);
                                    processor.ProcessPageContent(page);

                                    PdfImage[] images = imageFinder.GetImages().ToArray();
                                    Assert.AreEqual(1, images.Length);
                                    PdfImage pdfImage = images[0];

                                    Assert.AreEqual(ImageType.PNG, pdfImage.ImageType);
                                    using (TempFile bitmapFile = new TempFile(pdfImage.FileExtension, this.TestContext))
                                    {
                                        File.WriteAllBytes(bitmapFile.FilePath, pdfImage.Bytes);

                                        using (Image image = Image.FromFile(bitmapFile.FilePath))
                                        {
                                            string tessDataPath = Path.Combine(
                                                Directory.GetCurrentDirectory(),
                                                "tessdata");
                                            using (var ocrEngine = new TesseractEngine(
                                                       tessDataPath + "\\",
                                                       "eng",
                                                       EngineMode.Default))
                                            {
                                                using (Page ocrPage = ocrEngine.Process(image as Bitmap, PageSegMode.SingleWord))
                                                {
                                                    var actualTextInImage = ocrPage.GetText().Trim();

                                                    Assert.AreEqual(expectedTextInImage, actualTextInImage);
                                                }
                                            }
                                        }
                                    }
                                }
                            }
                        }
                    }
                }
            }
        }
예제 #34
0
 public FieldProblem_Wendy()
 {
     _searchPatternBuilder = MockRepository.Mock <ISearchPatternBuilder>();
     _imageFinder          = new ImageFinder(_searchPatternBuilder);
 }
예제 #35
0
        private async Task<IEnumerable<NewCourseNewsFeed>> CourseSelect(IQueryable<Course> query, int userId, ImageFinder courseImageFinder)
        {
            int newCourseTypeId = (int)NewsFeedItemModel.NewsFeedTypeId.NewCourse;

            return (await query.Select(x => new
            {
                CreatedDate = x.CreatedDate,
                CourseName = x.Name,
                CourseId = x.CourseId,
                CourseDescription = x.Description,
                StateTxt = x.State.Description,
                City = x.City,
                Likes = DbContext.NewsFeedLike.Count(y => y.NewsFeedTypeId == newCourseTypeId && y.AreaId == x.CourseId),
                Comments = DbContext.NewsFeedComment.Count(y => y.NewsFeedTypeId == newCourseTypeId && y.AreaId == x.CourseId),
                YouLikedItem = DbContext.NewsFeedLike.Any(y => x.CourseId == y.AreaId && y.NewsFeedTypeId == newCourseTypeId && y.UserIdThatLikedItem == userId)
            }).ToArrayAsync()).Select(x => new NewCourseNewsFeed
            {
                Id = x.CourseId,
                CourseId = x.CourseId,
                CourseImagePath = courseImageFinder.FindImage(x.CourseId),
                CommentCount = x.Comments,
                LikeCount = x.Likes,
                PostDate = x.CreatedDate,
                YouLikedItem = x.YouLikedItem,
                TitleOfPost = string.Format($"{x.CourseName} In {x.City}, {x.StateTxt} Has Been Created."),
                BodyOfPost = new NewCourseBody { NewCourseStory = x.CourseDescription }
            });
        }
예제 #36
0
        public static async Task<CourseStatsModel> CourseStatsSelect(ToracGolfContext dbContext, int courseId, int userId, ImageFinder courseImageFinder)
        {
            var courseRecord = await dbContext.Course.AsNoTracking().Select(x => new CourseStatsModel
            {
                CourseId = x.CourseId,
                CourseCity = x.City,
                CourseDescription = x.Description,
                CourseName = x.Name,
                CourseState = x.State.Description,
                //CourseImage = x.CourseImage.CourseImage,
                TeeBoxLocations = x.CourseTeeLocations.Select(y => new TeeBoxData
                {
                    TeeLocationId = y.CourseTeeLocationId,
                    Name = y.Description,
                    Yardage = y.Yardage,
                    Par = y.Front9Par + y.Back9Par,
                    Rating = y.Rating,
                    Slope = y.Slope
                }).OrderBy(y => y.Yardage)
            }).FirstAsync(x => x.CourseId == courseId).ConfigureAwait(false);

            //set the url path
            courseRecord.CourseImageUrl = courseImageFinder.FindImage(courseRecord.CourseId);

            return courseRecord;
        }
예제 #37
0
        public static async Task<RoundSelectModel> RoundSelect(IListingFactory<RoundListingFactory.RoundListingSortEnum, Round, RoundListingData> roundListingFactory,
                                                               ToracGolfContext dbContext,
                                                               int userId,
                                                               int pageId,
                                                               RoundListingFactory.RoundListingSortEnum sortBy,
                                                               string courseNameFilter,
                                                               int? seasonFilter,
                                                               int recordsPerPage,
                                                               DateTime? roundDateStartFilter,
                                                               DateTime? roundDateEndFilter,
                                                               ImageFinder courseImageFinder,
                                                               bool handicappedRoundOnly)
        {
            //go grab the query
            var queryable = RoundSelectQueryBuilder(dbContext, roundListingFactory, userId, courseNameFilter, seasonFilter, roundDateStartFilter, roundDateEndFilter, handicappedRoundOnly);

            //go sort the data
            var sortedQueryable = roundListingFactory.SortByConfiguration[sortBy](queryable, new ListingFactoryParameters(dbContext, userId)).ThenBy(x => x.RoundId);

            //go return the queryable
            var selectableQuery = sortedQueryable.Select(x => new RoundListingData
            {
                RoundId = x.RoundId,
                CourseId = x.CourseId,
                CourseName = x.Course.Name,
                RoundDate = x.RoundDate,
                Score = x.Score,
                SeasonId = x.SeasonId,
                TeeBoxLocation = x.CourseTeeLocation,
                HandicapBeforeRound = x.Handicap.HandicapBeforeRound,

                Putts = x.Putts,
                FairwaysHit = x.FairwaysHit,
                GreensInRegulation = x.GreensInRegulation,

                RoundHandicap = x.RoundHandicap
            });

            //go run the query now
            var dataSet = await EFPaging.PageEfQuery(selectableQuery, pageId, recordsPerPage).ToListAsync().ConfigureAwait(false);

            //let's loop through the rounds and display the starts
            foreach (var round in dataSet)
            {
                //calculate the adjusted score
                round.AdjustedScore = Convert.ToInt32(Math.Round(round.Score - round.HandicapBeforeRound, 0));

                //go calculate the round performance
                round.RoundPerformance = (int)RoundPerformance.CalculateRoundPerformance(round.TeeBoxLocation.Front9Par + round.TeeBoxLocation.Back9Par, round.AdjustedScore);

                //set the image path
                round.CourseImagePath = courseImageFinder.FindImage(round.CourseId);
            }

            //go return the lookup now
            return new RoundSelectModel(dataSet);
        }
예제 #38
0
 public void SetUp()
 {
     _mocks = new MockRepository();
     _searchPatternBuilder = _mocks.DynamicMock<ISearchPatternBuilder>();
     _imageFinder = new ImageFinder(_searchPatternBuilder);
 }
예제 #39
0
 public FieldProblem_Wendy()
 {
     _mocks = new MockRepository();
     _searchPatternBuilder = _mocks.DynamicMock<ISearchPatternBuilder>();
     _imageFinder = new ImageFinder(_searchPatternBuilder);
 }
예제 #40
0
 public FieldProblem_Wendy()
 {
     _mocks = new MockRepository();
     _searchPatternBuilder = _mocks.DynamicMock <ISearchPatternBuilder>();
     _imageFinder          = new ImageFinder(_searchPatternBuilder);
 }