         #endif
     }
 
+    /// Returns `true` if `self` can castle for `side`.
+    public func canCastle(for side: Board.Side) -> Bool {
+        #if swift(>=3)
+            return !self.intersection(CastlingRights(side: side)).isEmpty
+        #else
+            return !self.intersect(CastlingRights(side: side)).isEmpty
+        #endif
+    }
+
 }
 
 #if swift(>=3)

    /// Black castling rights.
    public static let black = CastlingRights(Right.black)

    /// The rights.
    private var _rights: Set<Right>



        /// Black rights.
        public static let black: [Right] = all.filter({ $0.color.isBlack })

        /// Kingside rights.
        public static let kingside: [Right] = all.filter({ $0.side.isKingside })

        /// Queenside rights.
        public static let queenside: [Right] = all.filter({ $0.side.isQueenside })

        /// The color for `self`.
        public var color: Color {
