Exemple #1
0
 public override bool IsMet()
 {
     for (int x = _searchArea.X; x < _searchArea.X + _searchArea.Width; x += _resolution)
     {
         for (int y = _searchArea.Y; y < _searchArea.Y + _searchArea.Height; y += _resolution)
         {
             if (ScreenInterface.GetColorAt(new Point(x, y)) == TargetColor &&
                 (_filter == null || (_filter != null && _filter.IsMet(new object[] { x, y }))))
             {
                 _lastX = x;
                 _lastY = y;
                 return(true);
             }
         }
     }
     return(false);
 }
 public override bool IsMet(object[] parameters)
 {
     if (parameters.Length == 2)
     {
         int       centerX = (int)parameters[0], centerY = (int)parameters[1];
         Rectangle searchArea = new Rectangle(Math.Max(0, centerX - _maxDistance), Math.Max(0, centerY - _maxDistance), _maxDistance * 2, _maxDistance * 2);
         for (int x = searchArea.X; x < searchArea.X + searchArea.Width; x += _resolution)
         {
             for (int y = searchArea.Y; y < searchArea.Y + searchArea.Height; y += _resolution)
             {
                 if (ScreenInterface.GetColorAt(new Point(x, y)) == _targetColor)
                 {
                     return(true);
                 }
             }
         }
     }
     return(false);
 }
Exemple #3
0
 public override bool IsMet() => ScreenInterface.GetColorAt(new Point(_x, _y)) == TargetColor;