public UpdatePieceAction( IBoardEntityFactory <TEntity> entityFactory, IBoardActionProvider <TEntity> actionProvider, IBoardState <TEntity> boardState ) : base(actionProvider, boardState) { _entityFactory = entityFactory; }
public ChessGame( IBoardEngineProvider <ChessPieceEntity> boardEngineProvider, IBoardEntityFactory <ChessPieceEntity> entityFactory, ICheckDetectionService checkDetectionService ) : this(boardEngineProvider, checkDetectionService, new ChessBoardSetup(entityFactory)) { }
public ChessBoardActionProvider(IBoardEntityFactory <ChessPieceEntity> entityFactory) : base(entityFactory) { Actions.Add((int)ChessMoveTypes.KingMove, (s) => new MoveOrTakeAction <ChessPieceEntity>(this, s)); Actions.Add((int)ChessMoveTypes.CastleQueenSide, (s) => new CastleAction <ChessPieceEntity>(this, s)); Actions.Add((int)ChessMoveTypes.CastleKingSide, (s) => new CastleAction <ChessPieceEntity>(this, s)); Actions.Add((int)ChessMoveTypes.TakeEnPassant, (s) => new EnPassantAction(this, s)); Actions.Add((int)ChessMoveTypes.PawnTwoStep, (s) => new PawnTwoStepAction(this, s)); }
public static IBoardMoveService <ChessPieceEntity> BoardMoveService( ChessBoardActionProvider boardActionProvider = null, IBoardEntityFactory <ChessPieceEntity> entityFactory = null ) { return(new BoardMoveService <ChessPieceEntity>( boardActionProvider ?? ChessBoardActionProvider(entityFactory) )); }
public BoardActionProvider(IBoardEntityFactory <TEntity> entityFactory) { Actions = new Dictionary <int, Func <IBoardState <TEntity>, IBoardAction> > { { (int)DefaultActions.MoveOnly, (s) => new MoveOnlyAction <TEntity>(this, s) }, { (int)DefaultActions.TakeOnly, (s) => new TakeOnlyAction <TEntity>(this, s) }, { (int)DefaultActions.MoveOrTake, (s) => new MoveOrTakeAction <TEntity>(this, s) }, { (int)DefaultActions.UpdatePiece, (s) => new UpdatePieceAction <TEntity>(entityFactory, this, s) }, { (int)DefaultActions.UpdatePieceWithTake, (s) => new UpdatePieceAction <TEntity>(entityFactory, this, s) }, }; }
public ChessGameService( ILogger <ChessGameService> logger, ILogger <ChessGame> chessGameLogger, ICheckDetectionService checkDetectionService, IBoardEngineProvider <ChessPieceEntity> boardEngineProvider, IBoardEntityFactory <ChessPieceEntity> entityFactory ) { _checkDetectionService = checkDetectionService; _entityFactory = entityFactory; _chessGameLogger = chessGameLogger; _boardEngineProvider = boardEngineProvider; _logger = logger; }
public static ChessBoardActionProvider ChessBoardActionProvider(IBoardEntityFactory <ChessPieceEntity> entityFactory = null) => new ChessBoardActionProvider( entityFactory ?? ChessPieceEntityFactory() );
public ChessBoardSetup(IBoardEntityFactory <ChessPieceEntity> entityFactory) { _entityFactory = entityFactory; }