Example #1
0
        public void Create(IBall ball, BrickType type)
        {
            switch (type)
            {
            case BrickType.ThreeBalls:
            {
                IPad pad = ballManager.GetPadAssignedToBall(ball);
                ballBuilder.Create(pad);
                ballBuilder.Create(pad);
                break;
            }

            case BrickType.DestroyerBall:
            {
                ITail tail = new Tail {
                    FireBallTimerCallback = fireBallCounter.FireBallTimerHandler
                };
                tailManager.Add(ball, tail);
                break;
            }

            default:
                break;
            }
        }
Example #2
0
        private void ExecuteAdditionalEffect(BrickType type)
        {
            switch (type)
            {
            case BrickType.ThreeBalls:
            {
                IPad pad = padManager.GetFirst();

                IBall ball1 = new Ball(randomGenerator);
                ball1.SetSize(15, 15);
                SetBallStartPosition(pad, ball1);
                ballManager.Add(ball1);

                IBall ball2 = new Ball(randomGenerator);
                ball2.SetSize(15, 15);
                SetBallStartPosition(pad, ball2);
                ballManager.Add(ball2);
                break;
            }

            case BrickType.DestroyerBall:
            {
                foreach (IBall ball in ballManager)
                {
                    tailManager.Add(ball);
                }
                break;
            }

            default:
                break;
            }
        }