 #endif
 
 import KDTree
+import SwiftyHYGDB
 
 class StarViewController: NSViewController {
 
-    var stars: KDTree<Star>?
+    var stars: KDTree<RadialStar>?
     @IBOutlet weak var loadingIndicator: NSProgressIndicator!
     @IBOutlet weak var starMapView: StarMapView!
     

    }

    deinit {
        stars?.forEach({ (star: Star) in
            star.starData?.ref.release()
        })
    }

        }
        
        let startLoading = Date()

        DispatchQueue.global(qos: .background).async { [weak self] in
            StarHelper.loadStarTree(named: "allStars", completion: { (stars) in
                log.debug("Completed loading stars: \(Date().timeIntervalSince(startLoading))s")
                self?.stars = stars
                log.debug("Finished loading \(stars?.count ?? -1) stars, after \(Date().timeIntervalSince(startLoading))s")
                self?.loadingIndicator.stopAnimation(nil)
                self?.reloadStars()
            })
        }
    }
    
