public static ChessGame CustomChessGame(IBoardSetup <ChessPieceEntity> setup, Colours toPlay = Colours.White) => new ChessGame( ChessBoardEngineProvider(), CheckDetectionService(), setup, toPlay );
public BoardEngine <ChessPieceEntity> Provide(IBoardSetup <ChessPieceEntity> boardSetup, int currentPlayer) { return(new BoardEngine <ChessPieceEntity>(boardSetup, _chessPathsValidator, _boardMoveService, _refreshAllPaths, currentPlayer)); }
public BoardEngine(IBoardSetup <TEntity> boardSetup, IPathsValidator <TEntity> pathsValidator, IBoardMoveService <TEntity> boardMoveService ) : this(boardSetup, pathsValidator, boardMoveService, new DefaultRefreshAllPaths(), 0) { }
public Game(IRenderer renderer, IInputHandler inputHandler, IBoardSetup boardSetupRules) { this.renderer = renderer; this.inputHandler = inputHandler; this.boardSetupRules = boardSetupRules; this.player = new Player(); this.commandController = new CommandController(this.player); }
public ChessGameTrigger( IBoardEngineProvider <ChessPieceEntity> boardEngineProvider, IBoardSetup <ChessPieceEntity> boardSetup, ICheckDetectionService checkDetectionService ) { _boardSetup = boardSetup; _boardEngineProvider = boardEngineProvider; _checkDetectionService = checkDetectionService; }
public ChessGame( IBoardEngineProvider <ChessPieceEntity> boardEngineProvider, ICheckDetectionService checkDetectionService, IBoardSetup <ChessPieceEntity> setup, Colours whoseTurn = Colours.White) { _engine = boardEngineProvider.Provide(setup, (int)whoseTurn); _checkDetectionService = checkDetectionService; _engine.CurrentPlayer = (int)whoseTurn; CheckState = _checkDetectionService.Check(BoardState); }
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); }
public void Run() { this.renderer.RenderMessage(Messages.TypeOfGameMessage); string userGameType; do { userGameType = this.inputHandler.GetInput(); } while (userGameType != "standart" && userGameType != "unique"); switch (userGameType) { case "standart": this.boardSetupRules = new StandartBoardSetup(); break; case "unique": // different boardSetupRules break; default: break; } var game = new Game(this.renderer, this.inputHandler, this.boardSetupRules); game.Start(); }