error C2440: '=' : cannot convert from 'const BWAPI::UpgradeType' to 'const BWAPI::Type *'
at this line
this->generalType = type;
what is the problem? since UnitType extends Type shouldn't be permitted?
class CombatEvent {
public:
CombatEvent& setUnitType(const UnitType& type);
const Type* getGeneralType() const;
private:
UnitType unitType;
const Type* generalType;
}
// implementation
CombatEvent& CombatEvent::setUnitType(const UnitType& type) {
this->generalType = type;
this->unitType = type;
return *this;
}