public void CreateManualPixel(GUIPixel pixel) { if (!BotEnabled) { return; } pixel = new GUIPixel(pixel.X, pixel.Y, Color.FromArgb(pixel.Color.A, pixel.Color.R, pixel.Color.G, pixel.Color.B)); if (manualTask.Contains(pixel)) { GUIPixel cur = manualTask.GetStoredCopy(pixel); if (cur.Color.R == pixel.Color.R && cur.Color.G == pixel.Color.G && cur.Color.B == pixel.Color.B) { return; } else { manualTask.Remove(pixel); manualTask.Add(pixel); UsefulData.UpdateManualPixel(pixel); return; } } manualTask.Add(pixel); UsefulData.UpdateManualPixel(pixel); Updater.Update();//TODO temporary!! }
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 GUIPixel) { GUIPixel other = obj as GUIPixel; 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); } }
public void PushPixel(int x, int y, Color color, int boardId, int userId, bool instantPixel) { if (boardId == CanvasId) { var cColor = System.Windows.Media.Color.FromArgb(color.A, color.R, color.G, color.B); pixelCanvas.SetPixel(x, y, cColor, userId); if (instantPixel) { return; } botWindow.UpdateSpeed(cColor, userId); GUIPixel removed = new GUIPixel(x, y, color); if (manualTask.Remove(removed)) { UsefulData.RemoveManualPixel(removed); } } }