예제 #1
0
        internal void PutFigureOnPositionWithoutMovingItActualy(ChessBoardPosition positionOnTheBoard, IFigure figure)
        {
            if (figure == null)
            {
                throw new ArgumentNullException(nameof(figure));
            }

            this.board[8 - positionOnTheBoard.Vertical, positionOnTheBoard.Horizontal - 'a'] = figure;
        }
예제 #2
0
        internal void PutFigureOnPosition(ChessBoardPosition positionOnTheBoard, IFigure figure)
        {
            if (figure == null)
            {
                throw new ArgumentNullException(nameof(figure));
            }

            this.board[8 - positionOnTheBoard.Vertical, positionOnTheBoard.Horizontal - 'a'] = figure;

            if (figure is ICastleableFigure)
            {
                ((ICastleableFigure)figure).Move();
            }
        }
예제 #3
0
 internal IFigure GetFigureOnPosition(ChessBoardPosition positionOnTheBoard)
 {
     return(this.board[8 - positionOnTheBoard.Vertical, positionOnTheBoard.Horizontal - 'a']);
 }
예제 #4
0
 internal void RemoveFigureOnPosition(ChessBoardPosition positionOnTheBoard)
 {
     this.board[8 - positionOnTheBoard.Vertical, positionOnTheBoard.Horizontal - 'a'] = null;
 }