private void DrawNextBalls(Graphics graphics) { var x = ClientSize.Width / 2 - (int)(1.5 * CellSize); var y = ButtonHeight + ElementsMargin; foreach (var color in controller.Next.Select(tuple => tuple.Item2)) { BallDrawer.DrawBallAt(graphics, x, y, color); x += CellSize; } }
private void DrawMainBallsGrid(Graphics graphics, Point start) { foreach (var tuple in controller.GetAllCells()) { var ballPoint = tuple.Item1; var point = start + ballPoint * CellSize; var color = tuple.Item2; graphics.FillRectangle(new SolidBrush(controller.BackgroundColor), new Rectangle(point.ToDrawingPoint(), new Size(CellSize, CellSize))); if (ballPoint == controller.ClickedPoint) { BallDrawer.DrawSelectedBallAt(graphics, point, color); } else { BallDrawer.DrawBallAt(graphics, point, color); } } }