

var DiscoverElementSample = {
  findPercent:-1,
  checkFindIsEnd:-1,
  devices:[],
  links:[]
}

class DiscoverElementManagerImplement {
  // 获取进度信息
  getPercent (DeviceFindCollection) {
    return DeviceFindCollection.findPercent
  }

  // 获取判断进度条是否结束
  getFindIsEnd (DeviceFindCollection) {
    return DeviceFindCollection.checkFindIsEnd
  }

  // 获取设备
  getDevices (DeviceFindCollection) {
    return DeviceFindCollection.devices
  }

  // 获取链路
  getLinks (DeviceFindCollection) {
    return DeviceFindCollection.links
  }
}

let implementMethods = new DiscoverElementManagerImplement()

function DiscoverElementManager (DeviceFindCollection, contextState = {}) {
  // 获取进度
  function getPercent () {
    return implementMethods.getPercent(DeviceFindCollection)
  }


  function getFindIsEnd () {
    return implementMethods.getFindIsEnd(DeviceFindCollection)
  }

  // 获取设备
  function getDevices () {
    return implementMethods.getDevices(DeviceFindCollection)
  }

  // 获取链路
  function getLinks () {
    return implementMethods.getLinks(DeviceFindCollection)
  }

  return Object.freeze(Object.assign(
    {
      // 在此列出模型对象方法
      getPercent,
      getFindIsEnd,
      getDevices,
      getLinks
    }
  ))
}

// 导出模型对象构造函数
export default DiscoverElementManager
