Esempio n. 1
0
        /// <summary>
        /// Finds the closest bank booth in the Edgeville bank out of the northern two booths
        /// </summary>
        /// <param name="bankBooth">returns a blob for a found bank booth</param>
        /// <returns>True if a bank booth is found</returns>
        internal bool LocateBankBoothEdgeville(out Blob bankBooth)
        {
            int         searchRadius = Screen.ArtifactLength(0.1475); //ex 150 pixels on a 1080p screen
            int         left         = Screen.Center.X - searchRadius;
            int         right        = Screen.Center.X + searchRadius;
            int         top          = Screen.Center.Y - searchRadius;
            int         bottom       = Screen.Center.Y + searchRadius;
            List <Blob> bankBooths   = Vision.LocateObjects(RGBHSBRangeFactory.BankBoothEdgeville(), left, right, top, bottom, true, Screen.ArtifactArea(0.0000754), Screen.ArtifactArea(0.0004)); //ex 0.000151 - 0.000211

            if (bankBooths.Count == 0)
            {
                bankBooth = null;
                return(false);
            }
            bankBooths.Sort(new BlobProximityComparer(Screen.Center));
            bankBooth = bankBooths[0];
            if (bankBooth.Width > bankBooth.Height)
            {
                bankBooth.ShiftPixels(0, 24);
            }
            else
            {
                bankBooth.ShiftPixels(15, 0);
            }

            return(true);
        }