示例#1
0
 public void Setup()
 {
     UseSubstituteLogging();
     _useSubstitueGameManager = UseSubstitueGameManager();
     _ballFactory             = Substitute.For <IBallFactory>();
     _ballGrid = new BallGrid(_ballFactory, new OrphanedBallFinder(), null);
 }
示例#2
0
 public void Setup()
 {
     UseSubstitueGameManager();
     _mockBallFactory        = Substitute.For <IBallFactory>();
     _mockBallGrid           = Substitute.For <IBallGrid>();
     _gridPositionCalculator = Substitute.For <IBallGridPositionCalculator>();
     _ballGridController     = new BallGridController(_mockBallFactory, _mockBallGrid, _gridPositionCalculator);
 }
示例#3
0
 public StartBall(
     IBallFactory factory,
     IConsoleHandler console
     )
 {
     _factory = factory;
     _console = console;
 }
示例#4
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;
 }
示例#5
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);
        }
示例#6
0
文件: PongGame.cs 项目: kibiz0r/Pong
 public PongGame(IGameInitializer gameInitializer, IPlayerInitializer playerInitializer,
     IPlayerFactory playerFactory, IBallFactory ballFactory, IBallInitializer ballInitializer)
 {
     this.gameInitializer = gameInitializer;
     this.playerInitializer = playerInitializer;
     this.playerFactory = playerFactory;
     this.ballFactory = ballFactory;
     this.ballInitializer = ballInitializer;
     Running = true;
 }
示例#7
0
 public PongGame(IGameInitializer gameInitializer, IPlayerInitializer playerInitializer,
                 IPlayerFactory playerFactory, IBallFactory ballFactory, IBallInitializer ballInitializer)
 {
     this.gameInitializer   = gameInitializer;
     this.playerInitializer = playerInitializer;
     this.playerFactory     = playerFactory;
     this.ballFactory       = ballFactory;
     this.ballInitializer   = ballInitializer;
     Running = true;
 }
示例#8
0
 public GameInitializer(IPlayerInitializer playerInitializer, IBallFactory ballFactory, IBallInitializer ballInitializer)
 {
     this.playerInitializer = playerInitializer;
     this.ballFactory = ballFactory;
     this.ballInitializer = ballInitializer;
 }
示例#9
0
 public GameInitializer(IPlayerInitializer playerInitializer, IBallFactory ballFactory, IBallInitializer ballInitializer)
 {
     this.playerInitializer = playerInitializer;
     this.ballFactory       = ballFactory;
     this.ballInitializer   = ballInitializer;
 }