Files

28 lines
676 B
Swift

//
// MainOperationsResult.swift
// PrivadoVPN
//
// Created by Juraldinio on 3/21/21.
// Copyright © 2021 Privado LLC. All rights reserved.
//
import Foundation
struct MainRecordsContext {
var geoLocation: GeoLocation?
var bestRecord: ServerRecord?
var selectedRecord: ServerRecord?
mutating func clearGeo() { self.geoLocation = nil }
func isExist() -> Bool { self.geoLocation.isExist && (self.bestRecord.isExist || self.selectedRecord.isExist) }
static func empty() -> MainRecordsContext { MainRecordsContext() }
}
struct MainOperationsResult {
let serverRecords: [ServerRecord]?
let context: MainRecordsContext
}