//
//  SettingsState.swift
//  punchnet
//
//  Created by 安礼成 on 2026/1/16.
//

import Foundation
import Observation

@Observable
class SettingsState {
    struct Network {
        var id: Int
        var name: String
    }
    
    struct ExitNode {
        var id: Int
        var name: String
    }
    
    var networks: [Network]
    var selectedNetwork: Network
    
    var exitNodes: [ExitNode]
    var selectedExitNode: ExitNode
    
    init() {
        let networks: [Network] = [
            .init(id: 1, name: "测试网络12"),
            .init(id: 2, name: "测试网络13"),
            .init(id: 3, name: "测试网络14"),
            .init(id: 4, name: "测试网络15"),
            .init(id: 5, name: "xyz"),
        ]
        
        self.selectedNetwork = networks[0]
        self.networks = networks
        
        
        let exitNodes: [ExitNode] = [
            .init(id: 1, name: "出口节点1"),
            .init(id: 2, name: "出口节点12"),
            .init(id: 3, name: "出口节点13"),
            .init(id: 4, name: "出口节点14"),
            .init(id: 5, name: "出口节点15"),
        ]
        self.selectedExitNode = exitNodes[0]
        self.exitNodes = exitNodes
        
    }
    
}
