示例#1
0
 public PhutballGameState(
     IEventPublisher eventPublisher,
     IPhutballBoard phutballBoard,
     IPlayersState playersState,
     BestMoveApplier bestMoveApplier,
     Func <IHandlePlayerMoves> handlePlayerMovesFactory)
 {
     _currentState             = PhutballGameStateEnum.NotStarted;
     _eventPublisher           = eventPublisher;
     _phutballBoard            = phutballBoard;
     _playersState             = playersState;
     _bestMoveApplier          = bestMoveApplier;
     _handlePlayerMovesFactory = handlePlayerMovesFactory;
     _handlePlayerMoves        = handlePlayerMovesFactory();
     _eventPublisher.Subscribe <PlayerWonEvent>((e) => CurrentPlayerWon());
     _eventPublisher.Subscribe <PlayerOnTheMoveChanged>(OnPlayerOnTheMoveChanged);
     _eventPublisher.Subscribe <ComputerStartedMoving>((e) => LongRunningProcess.Clear());
 }
示例#2
0
 public PhutballGameState(
     IEventPublisher eventPublisher,
     IPhutballBoard phutballBoard,
     IPlayersState playersState,
     BestMoveApplier bestMoveApplier,
     Func<IHandlePlayerMoves> handlePlayerMovesFactory)
 {
     _currentState = PhutballGameStateEnum.NotStarted;
     _eventPublisher = eventPublisher;
     _phutballBoard = phutballBoard;
     _playersState = playersState;
     _bestMoveApplier = bestMoveApplier;
     _handlePlayerMovesFactory = handlePlayerMovesFactory;
     _handlePlayerMoves = handlePlayerMovesFactory();
     _eventPublisher.Subscribe<PlayerWonEvent>((e)=> CurrentPlayerWon());
     _eventPublisher.Subscribe<PlayerOnTheMoveChanged>(OnPlayerOnTheMoveChanged);
     _eventPublisher.Subscribe<ComputerStartedMoving>((e)=> LongRunningProcess.Clear());
 }