BWAPI
|
#include <MacroManager.h>
Public Member Functions | |
MacroItem () | |
MacroItem (BWAPI::UnitType unit, int priority) | |
MacroItem (BWAPI::TechType tech, int priority) | |
MacroItem (BWAPI::UpgradeType upgrade, int level, int priority) | |
std::string | getDebugInfo () const |
bool | isUnitType () const |
bool | isTechType () const |
bool | isUpgradeType () const |
BWAPI::UnitType | getUnitType () const |
BWAPI::TechType | getTechType () const |
BWAPI::UpgradeType | getUpgradeType () const |
int | getUpgradeLevel () const |
int | getPriority () const |
bool | inProgress () const |
TaskPointer | createTask (TaskType taskType) const |
Private Attributes | |
BWAPI::UnitType | mUnit |
BWAPI::TechType | mTech |
BWAPI::UpgradeType | mUpgrade |
int | mLevel |
int | mPriority |
Definition at line 24 of file MacroManager.h.
MacroItem::MacroItem | ( | ) | [inline] |
Definition at line 27 of file MacroManager.h.
MacroItem::MacroItem | ( | BWAPI::UnitType | unit, |
int | priority | ||
) | [inline] |
Definition at line 28 of file MacroManager.h.
: mUnit(unit), mTech(BWAPI::TechTypes::None), mUpgrade(BWAPI::UpgradeTypes::None), mLevel(0), mPriority(priority){}
MacroItem::MacroItem | ( | BWAPI::TechType | tech, |
int | priority | ||
) | [inline] |
Definition at line 29 of file MacroManager.h.
: mUnit(BWAPI::UnitTypes::None), mTech(tech), mUpgrade(BWAPI::UpgradeTypes::None), mLevel(0), mPriority(priority){}
MacroItem::MacroItem | ( | BWAPI::UpgradeType | upgrade, |
int | level, | ||
int | priority | ||
) | [inline] |
Definition at line 30 of file MacroManager.h.
: mUnit(BWAPI::UnitTypes::None), mTech(BWAPI::TechTypes::None), mUpgrade(upgrade), mLevel(level), mPriority(priority){}
TaskPointer MacroItem::createTask | ( | TaskType | taskType | ) | const |
Definition at line 743 of file MacroManager.cpp.
References Singleton< T >::Instance().
{ if(isUnitType()) return TaskManager::Instance().build(mUnit, taskType); else if(isTechType()) return TaskManager::Instance().research(mTech, taskType); else if(isUpgradeType()) return TaskManager::Instance().upgrade(mUpgrade, mLevel, taskType); else return TaskPointer(); }
std::string MacroItem::getDebugInfo | ( | ) | const [inline] |
Definition at line 32 of file MacroManager.h.
References BWAPI::UpgradeType::getName(), BWAPI::TechType::getName(), BWAPI::UnitType::getName(), mLevel, mPriority, mTech, mUnit, mUpgrade, BWAPI::TechTypes::None, BWAPI::UpgradeTypes::None, and BWAPI::UnitTypes::None.
{ std::stringstream returnString; returnString << mPriority << " : "; if(mUnit != BWAPI::UnitTypes::None) returnString << mUnit.getName(); else if(mTech != BWAPI::TechTypes::None) returnString << mTech.getName(); else if(mUpgrade != BWAPI::UpgradeTypes::None) returnString << mUpgrade.getName() << " (" << mLevel << ")"; else returnString << "null"; return returnString.str(); }
int MacroItem::getPriority | ( | ) | const [inline] |
Definition at line 59 of file MacroManager.h.
References mPriority.
Referenced by macroCompare().
{ return mPriority; }
BWAPI::TechType MacroItem::getTechType | ( | ) | const [inline] |
BWAPI::UnitType MacroItem::getUnitType | ( | ) | const [inline] |
int MacroItem::getUpgradeLevel | ( | ) | const [inline] |
BWAPI::UpgradeType MacroItem::getUpgradeType | ( | ) | const [inline] |
bool MacroItem::inProgress | ( | ) | const |
Definition at line 731 of file MacroManager.cpp.
References Singleton< T >::Instance().
{ if(isUnitType()) return MacroManager::Instance().getPlannedTotal(mUnit) > 1; else if(isTechType()) return MacroManager::Instance().getPlannedTotal(mTech) > 1; else if(isUpgradeType()) return MacroManager::Instance().getPlannedTotal(mUpgrade, mLevel) > 1; else return true; }
bool MacroItem::isTechType | ( | ) | const [inline] |
Definition at line 50 of file MacroManager.h.
References mTech, and BWAPI::BulletTypes::None.
{ return mTech != BWAPI::TechTypes::None; }
bool MacroItem::isUnitType | ( | ) | const [inline] |
Definition at line 49 of file MacroManager.h.
References mUnit, and BWAPI::BulletTypes::None.
{ return mUnit != BWAPI::UnitTypes::None; }
bool MacroItem::isUpgradeType | ( | ) | const [inline] |
Definition at line 51 of file MacroManager.h.
References mUpgrade, and BWAPI::BulletTypes::None.
{ return mUpgrade != BWAPI::UpgradeTypes::None; }
int MacroItem::mLevel [private] |
Definition at line 69 of file MacroManager.h.
Referenced by getDebugInfo(), and getUpgradeLevel().
int MacroItem::mPriority [private] |
Definition at line 71 of file MacroManager.h.
Referenced by getDebugInfo(), and getPriority().
BWAPI::TechType MacroItem::mTech [private] |
Definition at line 67 of file MacroManager.h.
Referenced by getDebugInfo(), getTechType(), and isTechType().
BWAPI::UnitType MacroItem::mUnit [private] |
Definition at line 66 of file MacroManager.h.
Referenced by getDebugInfo(), getUnitType(), and isUnitType().
BWAPI::UpgradeType MacroItem::mUpgrade [private] |
Definition at line 68 of file MacroManager.h.
Referenced by getDebugInfo(), getUpgradeType(), and isUpgradeType().