public FishingSpotData(Coordinates scan1, Coordinates scan2, ScreenshotColor bubbleColor, AbstractFishingRodAction.Tolerance tolerance) { this.Scan1 = scan1; this.Scan2 = scan2; this.BubbleColor = bubbleColor; this.Tolerance = tolerance; }
protected bool CompareColor(ScreenshotColor refColor, ScreenshotColor actualColor, Tolerance tolerance) { // Simply compare the discrepancy of the R, G and B values // of each color. for (int i = 0; i < 3; i++) { byte bRef = refColor.GetValueFromIndex(i); byte bAct = actualColor.GetValueFromIndex(i); if (!(Math.Abs(bRef - bAct) <= tolerance.GetValueFromIndex(i))) { return(false); } } return(true); }