Beispiel #1
0
 public void Setup()
 {
     UseSubstitueGameManager();
     _mockBallFactory        = Substitute.For <IBallFactory>();
     _mockBallGrid           = Substitute.For <IBallGrid>();
     _gridPositionCalculator = Substitute.For <IBallGridPositionCalculator>();
     _ballGridController     = new BallGridController(_mockBallFactory, _mockBallGrid, _gridPositionCalculator);
 }
Beispiel #2
0
        public BallGridController(IBallFactory ballFactory, IBallGrid ballGrid, IBallGridPositionCalculator gridPositionCalculator)
        {
            _ballFactory            = ballFactory;
            _ballGrid               = ballGrid;
            _gridPositionCalculator = gridPositionCalculator;
            var gameEventBus = GameManager.Instance.EventBus;

            gameEventBus.Subscribe <BallDestroyByGiantLaserEventArgs>(OnBallDestroyed);
            gameEventBus.Subscribe <BallCollisionEventArgs>(OnBallCollision);
        }