     /// The current player's turn.
     public private(set) var playerTurn: PlayerTurn
 
-    /// The white king has moved from E1.
-    public private(set) var whiteKingHasMoved: Bool = false
-
-    /// The left white rook has moved from A1.
-    public private(set) var whiteLeftRookHasMoved: Bool = false
-
-    /// The right white rook has moved from H1.
-    public private(set) var whiteRightRookHasMoved: Bool = false
-
-    /// The black king has moved from E8.
-    public private(set) var blackKingHasMoved: Bool = false
-
-    /// The left black rook has moved from A8.
-    public private(set) var blackLeftRookHasMoved: Bool = false
-
-    /// The right black rook has moved from H8.
-    public private(set) var blackRightRookHasMoved: Bool = false
+    /// The castling availability.
+    public private(set) var castlingAvailability: CastlingAvailability
 
     /// The game's mode.
     public var mode: Mode

            }
        case .King(let color):
            if color.isWhite {
                whiteKingHasMoved = true
            } else {
                blackKingHasMoved = true
            }
            if /* Castle */ abs(move.fileChange) == 2 {
                let rank = move.start.rank

            }
        case .King:
            if /* Castle */ abs(move.fileChange) == 2 {
                switch move.end {
                case (.C, .One):
                    guard castlingAvailability.contains(.WhiteQueenside) else {
                        return .Error(.NoAvailability(.WhiteQueenside))
                    }
                case (.G, .One):
                    guard castlingAvailability.contains(.WhiteKingside) else {
                        return .Error(.NoAvailability(.WhiteKingside))
                    }
                case (.C, .Eight):
                    guard castlingAvailability.contains(.BlackQueenside) else {
                        return .Error(.NoAvailability(.BlackQueenside))
                    }
                case (.G, .Eight):
                    guard castlingAvailability.contains(.BlackKingside) else {
                        return .Error(.NoAvailability(.BlackKingside))
                    }
                default:
                    return .Error(.WrongMovementKind(piece))
