Пример #1
0
        private BallController GetNewBall(BallPoint position)
        {
            var ball = _generateBalls.GenerateRandomBall(position);

            InitBall(ball, position.X, position.Y);
            return(ball);
        }
Пример #2
0
        private static void CheckTwoBalls(int prevX, int prevY, int currX, int currY)
        {
            BallPoint currentBall  = CurrentGame.GetBallByOpenCoord(currX, currY);
            BallPoint previousBall = CurrentGame.GetBallByOpenCoord(prevX, prevY);

            CheckLine(previousBall.PointColor, currentBall.PointColor);
        }
Пример #3
0
 private void SetupSectorsAndBalls()
 {
     foreach (Point sectorPlace in Game.GetSectorMatrix())
     {
         Sector sector = new Sector(Game, sectorPlace);
         Controls.Add(sector);
         sector.MouseClick += OnSectorMouseClick;
         foreach (Point ballPoint in Sector.GetBallMatrix())
         {
             BallPoint bp = new BallPoint(sector, ballPoint);
             bp.MouseClick += OnBallPointClick;
             sector.Controls.Add(bp);
         }
     }
 }
Пример #4
0
        private BallController GetGeneratedBall(BallPoint position)
        {
            int            x = position.X;
            int            y = _generatedBall.GetLength(1) - 1;
            BallController ball;

            do
            {
                ball = _generatedBall[x, y];
                _generatedBall[x, y] = null;
                y--;
            } while (ball == null);
            _gamePoleView.AddBall(ball.View);
            InitBall(ball, position.X, position.Y);
            return(ball);
        }
Пример #5
0
        private void OnBallPointClick(object sender, MouseEventArgs e)
        {
            BallPoint ball = (BallPoint)sender;

            if (ball.IsColored || !IsBallNotSector)
            {
                OnSectorMouseClick(ball.Sector, e);
            }
            else
            {
                ball.PointColor = Player.GetActivePlayer().Color;
                ball.DrawBallPoint();

                label_hint.Text = OnscreenText.TurnSector;
                IsBallNotSector = false;
            }
        }
Пример #6
0
        private static void CheckFirstBallInRaw(int firstX, int firstY)
        {
            BallPoint currentBall = CurrentGame.GetBallByOpenCoord(firstX, firstY);

            CheckLine(BallColor.WHITE, currentBall.PointColor);
        }
Пример #7
0
 public Vector2 GetCoordPoints(BallPoint position)
 {
     return(GetCoordPoints(position.X, (int)position.Y));
 }