示例#1
0
        public void AddPiece(Piece piece, BoardCoordinate moveCoordinate)
        {
            if (!moveCoordinate.IsCoordinateValidForBoardSize(Boardsize))
                throw new ArgumentException("moveTarget");

            _pieces[moveCoordinate.X, moveCoordinate.Y] = piece;
        }
示例#2
0
        public override IEnumerable<BoardCoordinate> GetMovesFrom(BoardCoordinate moveCoordinate, int boardSize)
        {
            yield return new BoardCoordinate(moveCoordinate.X, moveCoordinate.Y + 1);

            if (!HasMoved)
                yield return new BoardCoordinate(moveCoordinate.X, moveCoordinate.Y + 2);
        }
示例#3
0
        public override IEnumerable<BoardCoordinate> GetMovesFrom(BoardCoordinate moveCoordinate, int boardSize)
        {
            for (var i = 1; i <= boardSize; i++)
            {
                if (i != moveCoordinate.X)
                    yield return new BoardCoordinate(i, moveCoordinate.Y);

                if (i != moveCoordinate.Y)
                    yield return new BoardCoordinate(moveCoordinate.X, i);
            }
        }
示例#4
0
 public abstract IEnumerable<BoardCoordinate> GetMovesFrom(BoardCoordinate moveCoordinate, int boardSize);
示例#5
0
 public override IEnumerable<BoardCoordinate> GetMovesFrom(BoardCoordinate moveCoordinate, int boardSize)
 {
     throw new System.NotImplementedException();
 }
示例#6
0
 public Piece GetPiece(BoardCoordinate coordinates)
 {
     return _pieces[coordinates.X, coordinates.Y];
 }