public void BallSetPosition(Vector2 koord, BallPoint position) { _ballView.Ball.anchoredPosition = koord; _xPositinon = position.X; _yPosition = position.Y; _isChanged = true; }
public GenerateBalls(BallPoint sizePole, MiningSceneViewDescription miningViewDescription, BallPool ballPool) { _sizeGamePole = sizePole; _typeBallResource = miningViewDescription.TypeBallResource; _countColor = miningViewDescription.Balls.Count; _percentageResources = miningViewDescription.PercentageResources; _resources = new ResourcesCount(miningViewDescription.TypeResources, miningViewDescription.CountResource); _miningViewDescription = miningViewDescription; _ballPool = ballPool; }
public BallController[,] GenerateAll() { _balls = new BallController[_sizeGamePole.X, _sizeGamePole.Y]; _generatePosition = new BallPoint(0, 0); do { _balls[_generatePosition.X, _generatePosition.Y] = NextBall(); } while (NextPosition()); return(_balls); }
public BallController GenerateRandomBall(BallPoint position) { List <TypeBall> ballsTypes = GetTypesBall(); var indexColor = _rand.Next(0, ballsTypes.Count); TypeBall typeBall = ballsTypes[indexColor]; ResourcesCount resources = null; if (typeBall == _typeBallResource) { float chance = _rand.Next(0, 100) / 100F; if (chance < _percentageResources) { resources = _resources; } } return(new BallController(_ballPool.FreeBall, position, typeBall, resources)); }
private bool NextPosition() { int x = _generatePosition.X + 1; if (x < _sizeGamePole.X) { _generatePosition = new BallPoint(x, _generatePosition.Y); return(true); } else { int y = _generatePosition.Y + 1; if (y < _sizeGamePole.Y) { x = 0; _generatePosition = new BallPoint(x, y); return(true); } } return(false); }
public CheckBall(BallPoint sizeGamePole) { _sizeGamePole = sizeGamePole; }
public void BallSetPosition(BallPoint position) { _xPositinon = position.X; _yPosition = position.Y; _isChanged = true; }
public BallController(BallView ballView, BallPoint position, TypeBall typeBall, ResourcesCount typeResources) : this(ballView, position.X, position.Y, typeBall, typeResources) { }
public MoveReverce(BallController ball) { _ball = ball; _ballkoord = ball.View.Ball.anchoredPosition; _ballPoint = ball.Positinon; }