示例#1
0
 private BoardState(IPathsValidator <TEntity> pathsValidator,
                    IEnumerable <LocatedItem <TEntity> > clonedItems)
 {
     _items = clonedItems?.ToDictionary(k => k.Location, k => k)
              ?? new Dictionary <BoardLocation, LocatedItem <TEntity> >();
     _pathsValidator = pathsValidator;
 }
示例#2
0
        public BoardEngine(IBoardSetup <TEntity> boardSetup,
                           IPathsValidator <TEntity> pathsValidator,
                           IBoardMoveService <TEntity> boardMoveService
                           )

            : this(boardSetup, pathsValidator, boardMoveService, new DefaultRefreshAllPaths(), 0)
        {
        }
示例#3
0
 public ChessBoardEngineProvider(
     IRefreshAllPaths <ChessPieceEntity> refreshAllPaths,
     IPathsValidator <ChessPieceEntity> chessPathsValidator,
     IBoardMoveService <ChessPieceEntity> boardMoveService
     )
 {
     _boardMoveService    = boardMoveService;
     _chessPathsValidator = chessPathsValidator;
     _refreshAllPaths     = refreshAllPaths;
 }
 public CheckDetectionService(
     IPlayerStateService playerStateService,
     IBoardMoveService <ChessPieceEntity> moveService,
     IFindAttackPaths findAttackPaths,
     IPathsValidator <ChessPieceEntity> pathsValidator
     )
 {
     _moveService        = moveService;
     _playerStateService = playerStateService;
     _pathFinder         = findAttackPaths;
     _pathsValidator     = pathsValidator;
 }
示例#5
0
        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);
        }
示例#6
0
 public BoardState(IPathsValidator <TEntity> pathsValidator
                   ) : this(pathsValidator, null)
 {
 }
示例#7
0
 public PlayerStateService(IFindAttackPaths findAttackPaths,
                           IPathsValidator <ChessPieceEntity> pathsValidator)
 {
     _pathFinder     = findAttackPaths;
     _pathsValidator = pathsValidator;
 }