コード例 #1
0
ファイル: Player.cs プロジェクト: kirilsimeonov/Play-Chess
 public void RemovePiece(IPiece piece)
 {
     ObjectValidator.CheckIfObjectIsNull(piece, ErrorMessages.NullPieceError);
     //TODO: check piece and color
     ChefIfPieceDoesNotExist(piece);
     pieces.Remove(piece);
 }
コード例 #2
0
        public void RemoveFigure(IFigure figure)
        {
            ObjectValidator.CheckIfObjectIsNull(figure, GlobalErrorMessages.NullFigureErrorMessage);

            this.CheckIfFigureDoesNotExist(figure);
            this.figures.Remove(figure);
        }
コード例 #3
0
ファイル: Player.cs プロジェクト: kirilsimeonov/Play-Chess
 public void AddPiece(IPiece piece)
 {
     ObjectValidator.CheckIfObjectIsNull(piece, ErrorMessages.NullPieceError);
     ChefIfPieceExists(piece);
     this.pieces.Add(piece);
     //TODO: check piece and color
 }
コード例 #4
0
 public void AddFigure(IFigure figure)
 {
     ObjectValidator.CheckIfObjectIsNull(figure, GlobalErrorMessages.NullFigureErrorMessage);
     // TODO: check figure and player color
     this.CheckIfFigureExists(figure);
     this.figures.Add(figure);
 }
コード例 #5
0
ファイル: Player.cs プロジェクト: rnikova/CSharp-OOP
        public void AddFigure(IFigure figure)
        {
            ObjectValidator.CheckIfObjectIsNull(figure, GlobalErrorMessages.NullFigure);
            CheckIfFigureExist(figure);

            this.figures.Add(figure);
        }
コード例 #6
0
 public void RemoveFigure(IFigure figure)
 {
     ObjectValidator.CheckIfObjectIsNull(figure, GlobalErrorMessages.nullFigureErrorMessage);
     //TODO check the color of the player
     this.CheckIfFigureDoesNotExists(figure);
     this.figures.Remove(figure);
 }
コード例 #7
0
ファイル: Player.cs プロジェクト: AJMitev/JustChess
 public void RemoveFigure(IFigure figure)
 {
     ObjectValidator.CheckIfObjectIsNull(figure, GlobalErrorMessages.NullFigureErrorMessage);
     //TODO: check figure and player color.
     this.CheckIfFigureDoesNotExit(figure);
     this.figures.Remove(figure);
 }
コード例 #8
0
        public void AddFigure(IFigure figure, Position position)
        {
            ObjectValidator.CheckIfObjectIsNull(figure, GlobalErrorMessages.nullFigureErrorMessage);
            Position.CheckIsValid(position);
            int arrRow = this.GetArrayRow(position.Row);
            int arrCol = this.GetArrayCol(position.Col);

            this.board[arrRow, arrCol] = figure;
        }
コード例 #9
0
        public void AddFigure(IFigure figure, Position position)
        {
            ObjectValidator.CheckIfObjectIsNull(figure, "Figure cannot be null!");
            Position.CheckIfValid(position);

            int arrRow = GetArrayRow(position.Row);
            int arrCol = GetArrayCol(position.Col);

            this.board[arrRow, arrCol] = figure;
        }
コード例 #10
0
        public void AddPiece(IPiece piece, Position position)
        {
            ObjectValidator.CheckIfObjectIsNull(piece, ErrorMessages.NullPieceError);
            this.CheckIfPositionIsValid(position);

            int arrayRow = this.GetArrayRow(position.Row);
            int arrayCol = this.GetArrayCol(position.Col);

            this.board[arrayRow, arrayCol] = piece;
        }
コード例 #11
0
        public void AddFigure(IFigure figure, Position position)
        {
            ObjectValidator.CheckIfObjectIsNull(figure, ErrorMessages.NullFigureErrorMessage);
            Position.ValidatePositionWithException(position);

            var arrayRow = this.GetArrayRow(position.Row);
            var arrayCol = this.GetArrayCol(position.Col);

            this._board[arrayRow, arrayCol] = figure;
        }
コード例 #12
0
ファイル: Player.cs プロジェクト: GeorgiTerziev02/Chess-Game
 public void RemoveFigure(IFigure figure)
 {
     ObjectValidator.CheckIfObjectIsNull(figure, ExceptionMessages.NullFigureException);
     this.CheckIfFigureDoesNotExists(figure);
     this.figures.Remove(figure);
 }
コード例 #13
0
ファイル: Player.cs プロジェクト: GeorgiTerziev02/Chess-Game
 public void AddFigure(IFigure figure)
 {
     ObjectValidator.CheckIfObjectIsNull(figure, ExceptionMessages.NullFigureException);
     CheckIfFigureExists(figure);
     this.figures.Add(figure);
 }
コード例 #14
0
ファイル: Board.cs プロジェクト: vpetrovv/JustLudoConsoleGame
 public void AddFigure(IFigure figure, Position position)
 {
     ObjectValidator.CheckIfObjectIsNull(figure, GlobalErrorMessages.NullFigureErrorMessages);
     CheckIfPositionIsValid(position);
 }