private BallController GetNewBall(BallPoint position) { var ball = _generateBalls.GenerateRandomBall(position); InitBall(ball, position.X, position.Y); return(ball); }
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); }
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); } } }
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); }
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; } }
private static void CheckFirstBallInRaw(int firstX, int firstY) { BallPoint currentBall = CurrentGame.GetBallByOpenCoord(firstX, firstY); CheckLine(BallColor.WHITE, currentBall.PointColor); }
public Vector2 GetCoordPoints(BallPoint position) { return(GetCoordPoints(position.X, (int)position.Y)); }