 
     /// Undoes the previous move and returns it, if any.
     public func undoMove() -> Move? {
-        guard let (move, piece, capture) = _moveHistory.popLast() else {
+        guard let (move, piece, capture, attackers) = _moveHistory.popLast() else {
             return nil
         }
         var captureSquare = move.end

    /// The current halfmove clock.
    public var halfmoves: UInt {
        var n: UInt = 0
        for (_, piece, capture) in _moveHistory.reverse() {
            if capture != nil { break }
            if case .Pawn = piece { break }
            n += 1

    public typealias PlayerTurn = Color

    /// All of the conducted moves in the game.
    private var _moveHistory: [(move: Move, piece: Piece, capture: Piece?, kingAttackers: Bitboard)]

    /// All of the undone moves in the game.
    private var _undoHistory: [(move: Move, promotion: Piece?, kingAttackers: Bitboard)]

    /// The game's board.
    public private(set) var board: Board
