public void RemoveManualPixel(GUIPixel pixel) { lock (manualPixels) { UsefulPixel newPixel = new UsefulPixel(pixel.X, pixel.Y, pixel.Color); manualPixels.Remove(newPixel); } }
public override bool Equals(object obj) { if (obj is UsefulPixel) { UsefulPixel other = obj as UsefulPixel; return(X == other.X && Y == other.Y); } return(base.Equals(obj)); }
public void UpdateManualPixel(GUIPixel pixel) { if (!dataExchange.BotEnabled) { return; } lock (manualPixels) { UsefulPixel newPixel = new UsefulPixel(pixel.X, pixel.Y, pixel.Color); manualPixels.Remove(newPixel); manualPixels.Add(newPixel); } }
private void AddManual(List <IdPixel> queue, int userNumber, int totalUsers) { var pixels = guiData.ManualPixels; for (int i = userNumber; i < pixels.Count; i += totalUsers) { if (queue.Count >= maxQueueSize) { break; } UsefulPixel reqPixel = pixels[i]; if (iterCount - lastUpdateIterCount[reqPixel.X, reqPixel.Y] < pixelResendDelay) //avoid spamming the same place { continue; } var canvasPixel = canvas.GetPixel(reqPixel.X, reqPixel.Y); if (canvasPixel.R == 204 && canvasPixel.G == 204 && canvasPixel.B == 204) //protected pixel { continue; } if (canvasPixel == reqPixel.Color) { continue; } if (reqPixel.Color.R == 255 && reqPixel.Color.G == 255 && reqPixel.Color.B == 255 && canvasPixel.A == 0) { continue; } if (!curCanvasInvPalette.ContainsKey(reqPixel.Color)) { continue; } IdPixel pixel = new IdPixel(curCanvasInvPalette[reqPixel.Color], reqPixel.X, reqPixel.Y); queue.Add(pixel); lastUpdateIterCount[reqPixel.X, reqPixel.Y] = iterCount; } }