BWAPI
Public Member Functions | Private Attributes
MacroItem Class Reference

#include <MacroManager.h>

Collaboration diagram for MacroItem:
Collaboration graph
[legend]

List of all members.

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

Detailed Description

Definition at line 24 of file MacroManager.h.


Constructor & Destructor Documentation

MacroItem::MacroItem ( ) [inline]
MacroItem::MacroItem ( BWAPI::UnitType  unit,
int  priority 
) [inline]

Definition at line 28 of file MacroManager.h.

MacroItem::MacroItem ( BWAPI::TechType  tech,
int  priority 
) [inline]

Definition at line 29 of file MacroManager.h.

MacroItem::MacroItem ( BWAPI::UpgradeType  upgrade,
int  level,
int  priority 
) [inline]

Definition at line 30 of file MacroManager.h.


Member Function Documentation

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();
}

Here is the call graph for this function:

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();
        }

Here is the call graph for this function:

int MacroItem::getPriority ( ) const [inline]

Definition at line 59 of file MacroManager.h.

References mPriority.

Referenced by macroCompare().

{ return mPriority; }

Here is the caller graph for this function:

Definition at line 54 of file MacroManager.h.

References mTech.

{ return mTech; }

Definition at line 53 of file MacroManager.h.

References mUnit.

{ return mUnit; }
int MacroItem::getUpgradeLevel ( ) const [inline]

Definition at line 57 of file MacroManager.h.

References mLevel.

{ return mLevel; }

Definition at line 55 of file MacroManager.h.

References mUpgrade.

{ return mUpgrade; }
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;
}

Here is the call graph for this function:

bool MacroItem::isTechType ( ) const [inline]

Definition at line 50 of file MacroManager.h.

References mTech, and BWAPI::BulletTypes::None.

bool MacroItem::isUnitType ( ) const [inline]

Definition at line 49 of file MacroManager.h.

References mUnit, and BWAPI::BulletTypes::None.

bool MacroItem::isUpgradeType ( ) const [inline]

Definition at line 51 of file MacroManager.h.

References mUpgrade, and BWAPI::BulletTypes::None.


Member Data Documentation

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().

Definition at line 67 of file MacroManager.h.

Referenced by getDebugInfo(), getTechType(), and isTechType().

Definition at line 66 of file MacroManager.h.

Referenced by getDebugInfo(), getUnitType(), and isUnitType().

Definition at line 68 of file MacroManager.h.

Referenced by getDebugInfo(), getUpgradeType(), and isUpgradeType().


The documentation for this class was generated from the following files:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines