Ejemplo n.º 1
0
 private void DrawNextBallsOnGrid(Graphics graphics, int startX, int startY)
 {
     foreach (var tuple in controller.Next)
     {
         var point = tuple.Item1;
         var x     = startX + point.X * CellSize;
         var y     = startY + point.Y * CellSize;
         BallDrawer.DrawNextBallAt(graphics, x, y, tuple.Item2);
     }
 }
Ejemplo n.º 2
0
        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;
            }
        }
Ejemplo n.º 3
0
        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);
                }
            }
        }