public void AddPiece(Piece piece, BoardCoordinate moveCoordinate) { if (!moveCoordinate.IsCoordinateValidForBoardSize(Boardsize)) throw new ArgumentException("moveTarget"); _pieces[moveCoordinate.X, moveCoordinate.Y] = piece; }
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); }
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); } }
public abstract IEnumerable<BoardCoordinate> GetMovesFrom(BoardCoordinate moveCoordinate, int boardSize);
public override IEnumerable<BoardCoordinate> GetMovesFrom(BoardCoordinate moveCoordinate, int boardSize) { throw new System.NotImplementedException(); }
public Piece GetPiece(BoardCoordinate coordinates) { return _pieces[coordinates.X, coordinates.Y]; }