public void AddPiece(Piece piece, BoardCoordinate location) { if (location.IsValidForBoard(BoardSize)) { if (!_pieces.ContainsKey(location)) { _pieces.Add(location, piece); } else { throw new InvalidOperationException("BoardCoordinate Is Occupied"); } } else { throw new InvalidOperationException("BoardCoordinate Is Out Of Range"); } }
public static MoveResult Captured(Piece captured) { return new MoveResult(true, captured); }
private MoveResult(bool success, Piece captured = null) { _success = success; _captured = captured; }
public void Setup() { _board = new Board(8); _startingLocation = new BoardCoordinate(1, 1); _piece = new Bishop(PlayerColor.White); }