コード例 #1
0
        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!!
        }
コード例 #2
0
 public void RemoveManualPixel(GUIPixel pixel)
 {
     lock (manualPixels)
     {
         UsefulPixel newPixel = new UsefulPixel(pixel.X, pixel.Y, pixel.Color);
         manualPixels.Remove(newPixel);
     }
 }
コード例 #3
0
 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));
 }
コード例 #4
0
 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);
     }
 }
コード例 #5
0
        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);
                }
            }
        }