Beispiel #1
0
 public ChessBoardEngineProvider(
     IRefreshAllPaths <ChessPieceEntity> refreshAllPaths,
     IPathsValidator <ChessPieceEntity> chessPathsValidator,
     IBoardMoveService <ChessPieceEntity> boardMoveService
     )
 {
     _boardMoveService    = boardMoveService;
     _chessPathsValidator = chessPathsValidator;
     _refreshAllPaths     = refreshAllPaths;
 }
        public BoardEngine(IBoardSetup <TEntity> boardSetup,
                           IPathsValidator <TEntity> pathsValidator,
                           IBoardMoveService <TEntity> boardMoveService,
                           IRefreshAllPaths <TEntity> refreshAllPaths,
                           int currentPlayer)
        {
            CurrentPlayer     = currentPlayer;
            _boardMoveService = boardMoveService;

            BoardState = new BoardState <TEntity>(pathsValidator);

            _boardSetup = boardSetup;
            _boardSetup.SetupPieces(this);

            _refreshAllPaths = refreshAllPaths;
            _refreshAllPaths.RefreshAllPaths(BoardState, CurrentPlayer);
        }