Exemplo n.º 1
0
 public BallGrid(IBallFactory ballFactory, OrphanedBallFinder orphanedBallFinder,
                 GameObject ballContainer)
 {
     _ballFactory          = ballFactory;
     _activeBalls          = new List <IBallController>(GRID_WIDTH * GRID_HEIGHT);
     _matchedBallSetFinder = new MatchedBallSetFinder();
     _ballPositionHandler  = new BallGridPositionHandler();
     _orphanedBallFinder   = orphanedBallFinder;
     _ballContainer        = ballContainer;
 }
Exemplo n.º 2
0
        protected override void Start()
        {
            var simpleObjectPool = GetComponent <SimpleObjectPool>();

            _ballFactory = new BallFactory(simpleObjectPool, Ceiling, Offset, Spacing);
            var orphanedBallFinder = new OrphanedBallFinder();
            var ballGrid           = new BallGrid(_ballFactory, orphanedBallFinder, gameObject);

            _ballGridController = new BallGridController(_ballFactory, ballGrid, new BallGridPositionCalculator());
        }