#pragma once
#include "../../World/TechObject.h"
#include "InBuildingMonitoringProcess.h"
/**
 * @brief Process used to monitor the completion of upgrades.
 */
class UpgradeMonitoringProcess : public InBuildingMonitoringProcessT<UpgradeMonitoringProcess>
{
public:
  UpgradeMonitoringProcess(const Process* parent, BWAPI::Unit* building, UpgradeTypeObject* upgrade);
  virtual void cancel();
protected:
  friend class MonitoringProcessT<UpgradeMonitoringProcess>;
  friend class InBuildingMonitoringProcessT<UpgradeMonitoringProcess>;
  virtual void _output(std::ostream& out) const;
  bool testCompletion();
  void setNewTimeout(bool error);

  UpgradeTypeObject* const m_upgrade;
};
