//
// © 2018-2020 Qualcomm Technologies, Inc. and/or its subsidiaries. All rights reserved.
//

import Foundation

enum MasterViewControllerMode {
    case alphabetical
    case kind
    case network
}

enum MasterViewControllerDisplayableType: Comparable {
    case unknown
    case speakerGroup
    case speakerConvenienceGroup
	case speaker
    case speakerChannel
    case bluetoothHeadphone
    case zigbeeLight
    case zigbeeThermostat
    case zigbeeOther

    private var sortOrder: Int {
        switch self {
        case .unknown:
            return 0
        case .speakerGroup:
            return 1
        case .speakerConvenienceGroup:
            return 1 // Intentionally same as .speakerGroup
        case .speaker:
            return 2
        case .speakerChannel:
            return 3
        case .bluetoothHeadphone:
            return 4
        case .zigbeeLight:
            return 5
        case .zigbeeThermostat:
            return 6
        case .zigbeeOther:
            return 7
        }
    }

    static func < (lhs: MasterViewControllerDisplayableType, rhs: MasterViewControllerDisplayableType) -> Bool {
        return lhs.sortOrder < rhs.sortOrder
    }
}

protocol MasterViewControllerDisplayable: NSObjectProtocol {
    var id: String { get }
    var name: String { get }
    var depth: UInt { get }
    var available: Bool { get }
    var stateDescription: [String] { get }
    var encapsulatedType: MasterViewControllerDisplayableType { get }
    var parent: MasterViewControllerDisplayable? { get set }
    var children: [MasterViewControllerDisplayable] { get }
}

protocol MasterViewControllerDisplayablePlayerChild {
    var playerID: String { get }
}

