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()); }
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()); }