public static void Buffer(DrawData draw) { foreach (PixelData pixel in draw.pixels) { PixelData old = buffer.FirstOrDefault(f => f.isbot == pixel.isbot && f.x == pixel.x && f.y == pixel.y); if (old != null) { old.color = pixel.color; } else { buffer.Add(pixel); } } }
static public void DrawHandler(NetConnection connection, object data) { DrawData draw = GSrv.Deserialize <DrawData>((byte[])data); World.Buffer(draw); }