#include "stdafx.h"
#include "UpgradeTypeObject.h"
#include "CurrentWorld.h"

UpgradeTypeObject::UpgradeTypeObject(BWAPI::UpgradeType upgradeType, int level)
  : TechObject(upgradeType.getName(), CurrentWorld::UpgradeTypePrimitiveType)
  , m_upgradeType(upgradeType)
  , m_level(level)
{
  CurrentWorld::addUpgradeTypeTech(this);

  m_isAcquired = BWAPI::Broodwar->self()->getUpgradeLevel(m_upgradeType) >= m_level;
}

UpgradeTypeObject::UpgradeTypeObject(BWAPI::UpgradeType upgradeType)
  : TechObject(upgradeType.getName(), CurrentWorld::UpgradeTypePrimitiveType)
  , m_upgradeType(upgradeType)
  , m_level(1)
{
  CurrentWorld::addUpgradeTypeTech(this);

  m_isAcquired = BWAPI::Broodwar->self()->getUpgradeLevel(m_upgradeType) >= m_level;
}
