\hypertarget{classMacroManagerClass}{\section{\-Macro\-Manager\-Class \-Class \-Reference}
\label{classMacroManagerClass}\index{\-Macro\-Manager\-Class@{\-Macro\-Manager\-Class}}
}


{\ttfamily \#include $<$\-Macro\-Manager.\-h$>$}

\subsection*{\-Public \-Member \-Functions}
\begin{DoxyCompactItemize}
\item 
\hyperlink{classMacroManagerClass_a5227b4f290dce857e814482ddafae5d9}{\-Macro\-Manager\-Class} ()
\item 
void \hyperlink{classMacroManagerClass_aefc52076481a7d50f1b7fe36f188b8f8}{on\-Begin} ()
\item 
void \hyperlink{classMacroManagerClass_af016c23babface55aa9807159f25d586}{update} ()
\item 
void \hyperlink{classMacroManagerClass_adf9fbb2facdc8cba448a501e5c2326b4}{update\-Task\-Lists} ()
\item 
void \hyperlink{classMacroManagerClass_afff725afde83fc0b7595008954a6d98f}{update\-Unit\-Production} ()
\item 
void \hyperlink{classMacroManagerClass_a6e41bb285b1069315d939c70ff121536}{update\-Observer\-Production} ()
\item 
void \hyperlink{classMacroManagerClass_abec63b460abb3cabbf8a4f32e9fda1a6}{update\-Production\-Production} ()
\item 
void \hyperlink{classMacroManagerClass_a3f38e0dc6a71681aa3f9a53464630ac6}{update\-Tech} ()
\item 
void \hyperlink{classMacroManagerClass_a55d519b89ecb3485362b03f713088614}{on\-Change\-Build} ()
\item 
bool \hyperlink{classMacroManagerClass_a38f6756ba11d2d611208157c4b7ed4ad}{has\-Requirements} (\hyperlink{classBWAPI_1_1UnitType}{\-B\-W\-A\-P\-I\-::\-Unit\-Type} type)
\item 
bool \hyperlink{classMacroManagerClass_a9689d9c9b0dd78b8bf629af425d67897}{has\-Requirements} (\hyperlink{classBWAPI_1_1TechType}{\-B\-W\-A\-P\-I\-::\-Tech\-Type} type)
\item 
bool \hyperlink{classMacroManagerClass_aca9b2d3ebbb78245e7d6355e5d088ac0}{has\-Requirements} (\hyperlink{classBWAPI_1_1UpgradeType}{\-B\-W\-A\-P\-I\-::\-Upgrade\-Type} type, int level)
\item 
int \hyperlink{classMacroManagerClass_a8785038df323b6ec81edf9faff7d2e78}{get\-Planned\-Count} (\hyperlink{classBWAPI_1_1UnitType}{\-B\-W\-A\-P\-I\-::\-Unit\-Type} unit\-Type)
\item 
int \hyperlink{classMacroManagerClass_afdc40fc2db5660cf995ea3366eea6a3a}{get\-Planned\-Total} (\hyperlink{classBWAPI_1_1UnitType}{\-B\-W\-A\-P\-I\-::\-Unit\-Type} unit\-Type)
\item 
bool \hyperlink{classMacroManagerClass_a9b99936c0fa1796eac67282a9b16a910}{is\-Planning\-Unit} (\hyperlink{classBWAPI_1_1UnitType}{\-B\-W\-A\-P\-I\-::\-Unit\-Type} unit\-Type)
\item 
int \hyperlink{classMacroManagerClass_aeb789a6380c9c38ddf303683df80ff13}{get\-Planned\-Count} (\hyperlink{classBWAPI_1_1TechType}{\-B\-W\-A\-P\-I\-::\-Tech\-Type} tech\-Type)
\item 
int \hyperlink{classMacroManagerClass_a8b8397b0f64485a99b3db8c0393cbde3}{get\-Planned\-Total} (\hyperlink{classBWAPI_1_1TechType}{\-B\-W\-A\-P\-I\-::\-Tech\-Type} tech\-Type)
\item 
bool \hyperlink{classMacroManagerClass_a117c4b6f2c54b450085f2cd113323053}{is\-Planning\-Tech} (\hyperlink{classBWAPI_1_1TechType}{\-B\-W\-A\-P\-I\-::\-Tech\-Type} tech\-Type)
\item 
int \hyperlink{classMacroManagerClass_ae16c5369d0462c5a2347a67b1271d5b3}{get\-Planned\-Count} (\hyperlink{classBWAPI_1_1UpgradeType}{\-B\-W\-A\-P\-I\-::\-Upgrade\-Type} upgrade\-Type, int level)
\item 
int \hyperlink{classMacroManagerClass_a7a3bbfef8d9d7afe521017e9648d4d22}{get\-Planned\-Total} (\hyperlink{classBWAPI_1_1UpgradeType}{\-B\-W\-A\-P\-I\-::\-Upgrade\-Type} upgrade\-Type, int level)
\item 
bool \hyperlink{classMacroManagerClass_a57b5244cc47298b367838849e8904705}{is\-Planning\-Upgrade} (\hyperlink{classBWAPI_1_1UpgradeType}{\-B\-W\-A\-P\-I\-::\-Upgrade\-Type} upgrade\-Type, int level)
\item 
std\-::set$<$ \hyperlink{classBWAPI_1_1UnitType}{\-B\-W\-A\-P\-I\-::\-Unit\-Type} $>$ \hyperlink{classMacroManagerClass_a8e8c29c269f821b2796446c6334fcb98}{get\-Needed\-Units} (\hyperlink{classBWAPI_1_1UnitType}{\-B\-W\-A\-P\-I\-::\-Unit\-Type} type)
\item 
std\-::set$<$ \hyperlink{classBWAPI_1_1UnitType}{\-B\-W\-A\-P\-I\-::\-Unit\-Type} $>$ \hyperlink{classMacroManagerClass_ac6582c99647427b69d3b8afa43ebfff0}{get\-Needed\-Units} (\hyperlink{classBWAPI_1_1TechType}{\-B\-W\-A\-P\-I\-::\-Tech\-Type} type)
\item 
std\-::set$<$ \hyperlink{classBWAPI_1_1UnitType}{\-B\-W\-A\-P\-I\-::\-Unit\-Type} $>$ \hyperlink{classMacroManagerClass_acb43ef99d25a1740e014c097296c841a}{get\-Needed\-Units} (\hyperlink{classBWAPI_1_1UpgradeType}{\-B\-W\-A\-P\-I\-::\-Upgrade\-Type} type, int level)
\item 
void \hyperlink{classMacroManagerClass_a03ef7268ea106577fab7c5d660de9a08}{on\-Build\-Task} (\hyperlink{Requirement_8h_a10d9e68ef4957f6a76bc93eb32bf2670}{\-Task\-Pointer} task, \hyperlink{classBWAPI_1_1UnitType}{\-B\-W\-A\-P\-I\-::\-Unit\-Type} unit\-Type)
\item 
void \hyperlink{classMacroManagerClass_afbb24206d2c2a997a23751bcb745afa8}{on\-Tech\-Task} (\hyperlink{Requirement_8h_a10d9e68ef4957f6a76bc93eb32bf2670}{\-Task\-Pointer} task, \hyperlink{classBWAPI_1_1TechType}{\-B\-W\-A\-P\-I\-::\-Tech\-Type} tech\-Type)
\item 
void \hyperlink{classMacroManagerClass_a3e6e272c3da1ef507ffbe7f309d666a1}{on\-Upgrade\-Task} (\hyperlink{Requirement_8h_a10d9e68ef4957f6a76bc93eb32bf2670}{\-Task\-Pointer} task, \hyperlink{classBWAPI_1_1UpgradeType}{\-B\-W\-A\-P\-I\-::\-Upgrade\-Type} upgrade\-Type, int level)
\end{DoxyCompactItemize}
\subsection*{\-Private \-Member \-Functions}
\begin{DoxyCompactItemize}
\item 
void \hyperlink{classMacroManagerClass_aed0f352c5f5e383ee63edd53220c9d8b}{add\-Needed} (std\-::set$<$ \hyperlink{classBWAPI_1_1UnitType}{\-B\-W\-A\-P\-I\-::\-Unit\-Type} $>$ \&needed\-Units)
\item 
void \hyperlink{classMacroManagerClass_a82eb2d13059e51f04b3120d0b7963c1b}{create\-Tech\-Items} ()
\end{DoxyCompactItemize}
\subsection*{\-Private \-Attributes}
\begin{DoxyCompactItemize}
\item 
std\-::map$<$ \hyperlink{classBWAPI_1_1TechType}{\-B\-W\-A\-P\-I\-::\-Tech\-Type}, int $>$ \hyperlink{classMacroManagerClass_a7a296c7fe9441bcabd4a8acec95049b5}{m\-Tech\-Priority\-Map}
\item 
std\-::map$<$ \hyperlink{classBWAPI_1_1UpgradeType}{\-B\-W\-A\-P\-I\-::\-Upgrade\-Type}, int $>$ \hyperlink{classMacroManagerClass_afe4e1ef75b7007127835c829243178b6}{m\-Upgrade\-Priority\-Map}
\item 
std\-::list$<$ \hyperlink{classUnitToProduce}{\-Unit\-To\-Produce} $>$ \hyperlink{classMacroManagerClass_a79a2e7aabf6ec375b77a3f885895f0a4}{m\-Normal\-Units}
\item 
std\-::list$<$ \hyperlink{classUnitToProduce}{\-Unit\-To\-Produce} $>$ \hyperlink{classMacroManagerClass_a943a51b58a6ddd520dea60834064d2db}{m\-Low\-Gas\-Units}
\item 
std\-::list$<$ \hyperlink{classUnitToProduce}{\-Unit\-To\-Produce} $>$ \hyperlink{classMacroManagerClass_a0c0f20fb90e3952ff1f8333734c0c27b}{m\-Low\-Mineral\-Units}
\item 
std\-::list$<$ std\-::pair\*
$<$ \hyperlink{Requirement_8h_a10d9e68ef4957f6a76bc93eb32bf2670}{\-Task\-Pointer}, \hyperlink{classBWAPI_1_1UnitType}{\-B\-W\-A\-P\-I\-::\-Unit\-Type} $>$ $>$ \hyperlink{classMacroManagerClass_aa9c7befc367dfcf19cfd2de2050396d1}{m\-Unit\-Produce}
\item 
std\-::map$<$ \hyperlink{classBWAPI_1_1UnitType}{\-B\-W\-A\-P\-I\-::\-Unit\-Type}, \*
std\-::list$<$ \hyperlink{Requirement_8h_a10d9e68ef4957f6a76bc93eb32bf2670}{\-Task\-Pointer} $>$ $>$ \hyperlink{classMacroManagerClass_aeef56c1e6b7dffb55b6e750f56796806}{m\-Tasks\-Per\-Production\-Type}
\item 
std\-::map$<$ \hyperlink{classBWAPI_1_1TechType}{\-B\-W\-A\-P\-I\-::\-Tech\-Type}, \*
std\-::list$<$ \hyperlink{Requirement_8h_a10d9e68ef4957f6a76bc93eb32bf2670}{\-Task\-Pointer} $>$ $>$ \hyperlink{classMacroManagerClass_a14ce3a61a3a32fb212ddfc17bbebcd42}{m\-Tasks\-Per\-Tech\-Type}
\item 
std\-::map$<$ \hyperlink{classBWAPI_1_1UpgradeType}{\-B\-W\-A\-P\-I\-::\-Upgrade\-Type}, \*
std\-::map$<$ int, std\-::list\*
$<$ \hyperlink{Requirement_8h_a10d9e68ef4957f6a76bc93eb32bf2670}{\-Task\-Pointer} $>$ $>$ $>$ \hyperlink{classMacroManagerClass_afc9b436684c9cb39ebc39cc1a6bc13dd}{m\-Tasks\-Per\-Upgrade\-Type}
\item 
std\-::map$<$ \hyperlink{classBWAPI_1_1UnitType}{\-B\-W\-A\-P\-I\-::\-Unit\-Type}, \*
std\-::list$<$ \hyperlink{Requirement_8h_a10d9e68ef4957f6a76bc93eb32bf2670}{\-Task\-Pointer} $>$ $>$ \hyperlink{classMacroManagerClass_aedf869bf50d3738760dee2fb897ed1d1}{m\-Tasks\-Per\-Produced\-Type}
\item 
\hyperlink{Requirement_8h_a10d9e68ef4957f6a76bc93eb32bf2670}{\-Task\-Pointer} \hyperlink{classMacroManagerClass_a1a410a9bbc95d11f6092ef0ed0379806}{m\-Observer}
\item 
std\-::list$<$ \hyperlink{classMacroItem}{\-Macro\-Item} $>$ \hyperlink{classMacroManagerClass_a0b9e3b2fb1b28ef0d574db67a41a5e52}{m\-Tech\-Items\-To\-Create}
\item 
std\-::list$<$ std\-::pair\*
$<$ \hyperlink{classMacroItem}{\-Macro\-Item}, \hyperlink{Requirement_8h_a10d9e68ef4957f6a76bc93eb32bf2670}{\-Task\-Pointer} $>$ $>$ \hyperlink{classMacroManagerClass_ae1aa2fc444c393d658761a60b46c518a}{m\-Tech\-Items}
\end{DoxyCompactItemize}


\subsection{\-Detailed \-Description}


\-Definition at line 74 of file \-Macro\-Manager.\-h.



\subsection{\-Constructor \& \-Destructor \-Documentation}
\hypertarget{classMacroManagerClass_a5227b4f290dce857e814482ddafae5d9}{\index{\-Macro\-Manager\-Class@{\-Macro\-Manager\-Class}!\-Macro\-Manager\-Class@{\-Macro\-Manager\-Class}}
\index{\-Macro\-Manager\-Class@{\-Macro\-Manager\-Class}!MacroManagerClass@{\-Macro\-Manager\-Class}}
\subsubsection[{\-Macro\-Manager\-Class}]{\setlength{\rightskip}{0pt plus 5cm}{\bf \-Macro\-Manager\-Class\-::\-Macro\-Manager\-Class} (
\begin{DoxyParamCaption}
{}
\end{DoxyParamCaption}
)\hspace{0.3cm}{\ttfamily  \mbox{[}inline\mbox{]}}}}\label{classMacroManagerClass_a5227b4f290dce857e814482ddafae5d9}


\-Definition at line 77 of file \-Macro\-Manager.\-h.


\begin{DoxyCode}
{}
\end{DoxyCode}


\subsection{\-Member \-Function \-Documentation}
\hypertarget{classMacroManagerClass_aed0f352c5f5e383ee63edd53220c9d8b}{\index{\-Macro\-Manager\-Class@{\-Macro\-Manager\-Class}!add\-Needed@{add\-Needed}}
\index{add\-Needed@{add\-Needed}!MacroManagerClass@{\-Macro\-Manager\-Class}}
\subsubsection[{add\-Needed}]{\setlength{\rightskip}{0pt plus 5cm}void {\bf \-Macro\-Manager\-Class\-::add\-Needed} (
\begin{DoxyParamCaption}
\item[{std\-::set$<$ {\bf \-B\-W\-A\-P\-I\-::\-Unit\-Type} $>$ \&}]{needed\-Units}
\end{DoxyParamCaption}
)\hspace{0.3cm}{\ttfamily  \mbox{[}private\mbox{]}}}}\label{classMacroManagerClass_aed0f352c5f5e383ee63edd53220c9d8b}


\-Definition at line 534 of file \-Macro\-Manager.\-cpp.



\-References is\-Planning\-Unit(), \-B\-W\-A\-P\-I\-::\-Unit\-Type\-::required\-Units(), \-B\-W\-A\-P\-I\-::\-Unit\-Type\-::what\-Builds(), \-B\-W\-A\-P\-I\-::\-Unit\-Types\-::\-Zerg\-\_\-\-Hatchery, and \-B\-W\-A\-P\-I\-::\-Unit\-Types\-::\-Zerg\-\_\-\-Larva.



\-Referenced by get\-Needed\-Units().


\begin{DoxyCode}
{
        bool addedUnits = false;
        std::set<BWAPI::UnitType> tempList;
        for each(BWAPI::UnitType type in neededUnits)
        {
                BWAPI::UnitType whatBuilds = type.whatBuilds().first;
                if(whatBuilds == BWAPI::UnitTypes::Zerg_Larva)
                        whatBuilds = BWAPI::UnitTypes::Zerg_Hatchery;

                if(!isPlanningUnit(whatBuilds) && neededUnits.count(whatBuilds)
       == 0)
                {
                        addedUnits = true;
                        tempList.insert(whatBuilds);
                }

                for(std::map<BWAPI::UnitType, int>::const_iterator it = type.
      requiredUnits().begin(); it != type.requiredUnits().end(); ++it)
                {
                        if (it->first == BWAPI::UnitTypes::Zerg_Larva)
                                continue;

                        if(!isPlanningUnit(it->first) && neededUnits.count(it->
      first) == 0)
                        {
                                addedUnits = true;
                                tempList.insert(it->first);
                        }
                }
        }

        neededUnits.insert(tempList.begin(), tempList.end());

        if(addedUnits)
                addNeeded(neededUnits);
}
\end{DoxyCode}


\-Here is the call graph for this function\-:\nopagebreak
\begin{figure}[H]
\begin{center}
\leavevmode
\includegraphics[width=350pt]{classMacroManagerClass_aed0f352c5f5e383ee63edd53220c9d8b_cgraph}
\end{center}
\end{figure}




\-Here is the caller graph for this function\-:\nopagebreak
\begin{figure}[H]
\begin{center}
\leavevmode
\includegraphics[width=350pt]{classMacroManagerClass_aed0f352c5f5e383ee63edd53220c9d8b_icgraph}
\end{center}
\end{figure}


\hypertarget{classMacroManagerClass_a82eb2d13059e51f04b3120d0b7963c1b}{\index{\-Macro\-Manager\-Class@{\-Macro\-Manager\-Class}!create\-Tech\-Items@{create\-Tech\-Items}}
\index{create\-Tech\-Items@{create\-Tech\-Items}!MacroManagerClass@{\-Macro\-Manager\-Class}}
\subsubsection[{create\-Tech\-Items}]{\setlength{\rightskip}{0pt plus 5cm}void {\bf \-Macro\-Manager\-Class\-::create\-Tech\-Items} (
\begin{DoxyParamCaption}
{}
\end{DoxyParamCaption}
)\hspace{0.3cm}{\ttfamily  \mbox{[}private\mbox{]}}}}\label{classMacroManagerClass_a82eb2d13059e51f04b3120d0b7963c1b}


\-Definition at line 716 of file \-Macro\-Manager.\-cpp.



\-References \-Singleton$<$ T $>$\-::\-Instance(), \-Order\-Def\-::\-Macro\-Can\-Tech, \-Task\-Type\-Def\-::\-Macro\-Tech, m\-Tech\-Items, and m\-Tech\-Items\-To\-Create.



\-Referenced by on\-Change\-Build(), and update().


\begin{DoxyCode}
{
        if(!mTechItemsToCreate.empty() && BuildOrderManager::Instance().
      getOrder(Order::MacroCanTech))
        {
                for(std::list<MacroItem>::iterator it = mTechItemsToCreate.
      begin(); it != mTechItemsToCreate.end(); ++it)
                {
                        TaskPointer task = it->createTask(TaskType::MacroTech);
                        if(task)
                                mTechItems.push_back(std::make_pair(*it, task))
      ;
                }

                mTechItemsToCreate.clear();
        }
}
\end{DoxyCode}


\-Here is the call graph for this function\-:\nopagebreak
\begin{figure}[H]
\begin{center}
\leavevmode
\includegraphics[width=350pt]{classMacroManagerClass_a82eb2d13059e51f04b3120d0b7963c1b_cgraph}
\end{center}
\end{figure}




\-Here is the caller graph for this function\-:\nopagebreak
\begin{figure}[H]
\begin{center}
\leavevmode
\includegraphics[width=350pt]{classMacroManagerClass_a82eb2d13059e51f04b3120d0b7963c1b_icgraph}
\end{center}
\end{figure}


\hypertarget{classMacroManagerClass_a8e8c29c269f821b2796446c6334fcb98}{\index{\-Macro\-Manager\-Class@{\-Macro\-Manager\-Class}!get\-Needed\-Units@{get\-Needed\-Units}}
\index{get\-Needed\-Units@{get\-Needed\-Units}!MacroManagerClass@{\-Macro\-Manager\-Class}}
\subsubsection[{get\-Needed\-Units}]{\setlength{\rightskip}{0pt plus 5cm}std\-::set$<$ {\bf \-B\-W\-A\-P\-I\-::\-Unit\-Type} $>$ {\bf \-Macro\-Manager\-Class\-::get\-Needed\-Units} (
\begin{DoxyParamCaption}
\item[{{\bf \-B\-W\-A\-P\-I\-::\-Unit\-Type}}]{type}
\end{DoxyParamCaption}
)}}\label{classMacroManagerClass_a8e8c29c269f821b2796446c6334fcb98}


\-Definition at line 476 of file \-Macro\-Manager.\-cpp.



\-References add\-Needed(), is\-Planning\-Unit(), \-B\-W\-A\-P\-I\-::\-Unit\-Type\-::required\-Units(), \-B\-W\-A\-P\-I\-::\-Unit\-Type\-::what\-Builds(), \-B\-W\-A\-P\-I\-::\-Unit\-Types\-::\-Zerg\-\_\-\-Hatchery, and \-B\-W\-A\-P\-I\-::\-Unit\-Types\-::\-Zerg\-\_\-\-Larva.



\-Referenced by on\-Change\-Build().


\begin{DoxyCode}
{
        std::set<BWAPI::UnitType> neededUnits;

        BWAPI::UnitType whatBuilds = type.whatBuilds().first;
        if(whatBuilds == BWAPI::UnitTypes::Zerg_Larva)
                whatBuilds = BWAPI::UnitTypes::Zerg_Hatchery;

        if(!isPlanningUnit(whatBuilds))
                neededUnits.insert(whatBuilds);

        for(std::map<BWAPI::UnitType, int>::const_iterator it = type.
      requiredUnits().begin(); it != type.requiredUnits().end(); ++it)
        {
                if(it->first == BWAPI::UnitTypes::Zerg_Larva)
                        continue;

                if(!isPlanningUnit(it->first))
                        neededUnits.insert(it->first);

        }

        addNeeded(neededUnits);

        return neededUnits;
}
\end{DoxyCode}


\-Here is the call graph for this function\-:\nopagebreak
\begin{figure}[H]
\begin{center}
\leavevmode
\includegraphics[width=350pt]{classMacroManagerClass_a8e8c29c269f821b2796446c6334fcb98_cgraph}
\end{center}
\end{figure}




\-Here is the caller graph for this function\-:\nopagebreak
\begin{figure}[H]
\begin{center}
\leavevmode
\includegraphics[width=350pt]{classMacroManagerClass_a8e8c29c269f821b2796446c6334fcb98_icgraph}
\end{center}
\end{figure}


\hypertarget{classMacroManagerClass_ac6582c99647427b69d3b8afa43ebfff0}{\index{\-Macro\-Manager\-Class@{\-Macro\-Manager\-Class}!get\-Needed\-Units@{get\-Needed\-Units}}
\index{get\-Needed\-Units@{get\-Needed\-Units}!MacroManagerClass@{\-Macro\-Manager\-Class}}
\subsubsection[{get\-Needed\-Units}]{\setlength{\rightskip}{0pt plus 5cm}std\-::set$<$ {\bf \-B\-W\-A\-P\-I\-::\-Unit\-Type} $>$ {\bf \-Macro\-Manager\-Class\-::get\-Needed\-Units} (
\begin{DoxyParamCaption}
\item[{{\bf \-B\-W\-A\-P\-I\-::\-Tech\-Type}}]{type}
\end{DoxyParamCaption}
)}}\label{classMacroManagerClass_ac6582c99647427b69d3b8afa43ebfff0}


\-Definition at line 502 of file \-Macro\-Manager.\-cpp.



\-References add\-Needed(), is\-Planning\-Unit(), and \-B\-W\-A\-P\-I\-::\-Tech\-Type\-::what\-Researches().


\begin{DoxyCode}
{
        std::set<BWAPI::UnitType> neededUnits;
        if(!isPlanningUnit(type.whatResearches()))
                neededUnits.insert(type.whatResearches());

        addNeeded(neededUnits);

        return neededUnits;
}
\end{DoxyCode}


\-Here is the call graph for this function\-:\nopagebreak
\begin{figure}[H]
\begin{center}
\leavevmode
\includegraphics[width=350pt]{classMacroManagerClass_ac6582c99647427b69d3b8afa43ebfff0_cgraph}
\end{center}
\end{figure}


\hypertarget{classMacroManagerClass_acb43ef99d25a1740e014c097296c841a}{\index{\-Macro\-Manager\-Class@{\-Macro\-Manager\-Class}!get\-Needed\-Units@{get\-Needed\-Units}}
\index{get\-Needed\-Units@{get\-Needed\-Units}!MacroManagerClass@{\-Macro\-Manager\-Class}}
\subsubsection[{get\-Needed\-Units}]{\setlength{\rightskip}{0pt plus 5cm}std\-::set$<$ {\bf \-B\-W\-A\-P\-I\-::\-Unit\-Type} $>$ {\bf \-Macro\-Manager\-Class\-::get\-Needed\-Units} (
\begin{DoxyParamCaption}
\item[{{\bf \-B\-W\-A\-P\-I\-::\-Upgrade\-Type}}]{type, }
\item[{int}]{level}
\end{DoxyParamCaption}
)}}\label{classMacroManagerClass_acb43ef99d25a1740e014c097296c841a}


\-Definition at line 513 of file \-Macro\-Manager.\-cpp.



\-References add\-Needed(), is\-Planning\-Unit(), \-B\-W\-A\-P\-I\-::\-Upgrade\-Types\-::\-Protoss\-\_\-\-Air\-\_\-\-Armor, \-B\-W\-A\-P\-I\-::\-Upgrade\-Types\-::\-Protoss\-\_\-\-Air\-\_\-\-Weapons, \-B\-W\-A\-P\-I\-::\-Unit\-Types\-::\-Protoss\-\_\-\-Cybernetics\-\_\-\-Core, \-B\-W\-A\-P\-I\-::\-Unit\-Types\-::\-Protoss\-\_\-\-Fleet\-\_\-\-Beacon, \-B\-W\-A\-P\-I\-::\-Upgrade\-Types\-::\-Protoss\-\_\-\-Ground\-\_\-\-Armor, \-B\-W\-A\-P\-I\-::\-Upgrade\-Types\-::\-Protoss\-\_\-\-Ground\-\_\-\-Weapons, \-B\-W\-A\-P\-I\-::\-Upgrade\-Types\-::\-Protoss\-\_\-\-Plasma\-\_\-\-Shields, \-B\-W\-A\-P\-I\-::\-Unit\-Types\-::\-Protoss\-\_\-\-Templar\-\_\-\-Archives, and \-B\-W\-A\-P\-I\-::\-Upgrade\-Type\-::what\-Upgrades().


\begin{DoxyCode}
{
        std::set<BWAPI::UnitType> neededUnits;
        if(!isPlanningUnit(type.whatUpgrades()))
                neededUnits.insert(type.whatUpgrades());

        if(level > 1)
        {
                if((type == BWAPI::UpgradeTypes::Protoss_Ground_Weapons || type
       == BWAPI::UpgradeTypes::Protoss_Ground_Armor) && !isPlanningUnit(
      BWAPI::UnitTypes::Protoss_Templar_Archives))
                        neededUnits.insert(
      BWAPI::UnitTypes::Protoss_Templar_Archives);
                else if(type == BWAPI::UpgradeTypes::Protoss_Plasma_Shields && 
      !isPlanningUnit(BWAPI::UnitTypes::Protoss_Cybernetics_Core))
                        neededUnits.insert(
      BWAPI::UnitTypes::Protoss_Cybernetics_Core);
                else if((type == BWAPI::UpgradeTypes::Protoss_Air_Armor || type
       == BWAPI::UpgradeTypes::Protoss_Air_Weapons) && !isPlanningUnit(
      BWAPI::UnitTypes::Protoss_Fleet_Beacon))
                        neededUnits.insert(
      BWAPI::UnitTypes::Protoss_Fleet_Beacon);
        }

        addNeeded(neededUnits);

        return neededUnits;
}
\end{DoxyCode}


\-Here is the call graph for this function\-:\nopagebreak
\begin{figure}[H]
\begin{center}
\leavevmode
\includegraphics[width=350pt]{classMacroManagerClass_acb43ef99d25a1740e014c097296c841a_cgraph}
\end{center}
\end{figure}


\hypertarget{classMacroManagerClass_a8785038df323b6ec81edf9faff7d2e78}{\index{\-Macro\-Manager\-Class@{\-Macro\-Manager\-Class}!get\-Planned\-Count@{get\-Planned\-Count}}
\index{get\-Planned\-Count@{get\-Planned\-Count}!MacroManagerClass@{\-Macro\-Manager\-Class}}
\subsubsection[{get\-Planned\-Count}]{\setlength{\rightskip}{0pt plus 5cm}int {\bf \-Macro\-Manager\-Class\-::get\-Planned\-Count} (
\begin{DoxyParamCaption}
\item[{{\bf \-B\-W\-A\-P\-I\-::\-Unit\-Type}}]{unit\-Type}
\end{DoxyParamCaption}
)}}\label{classMacroManagerClass_a8785038df323b6ec81edf9faff7d2e78}


\-Definition at line 569 of file \-Macro\-Manager.\-cpp.



\-References m\-Tasks\-Per\-Produced\-Type.



\-Referenced by get\-Planned\-Total().


\begin{DoxyCode}
{
        int count = 0;
        for each(TaskPointer task in mTasksPerProducedType[unitType])
        {
                if(!task->inProgress())
                        ++count;
        }

        return count;
}
\end{DoxyCode}


\-Here is the caller graph for this function\-:\nopagebreak
\begin{figure}[H]
\begin{center}
\leavevmode
\includegraphics[width=350pt]{classMacroManagerClass_a8785038df323b6ec81edf9faff7d2e78_icgraph}
\end{center}
\end{figure}


\hypertarget{classMacroManagerClass_aeb789a6380c9c38ddf303683df80ff13}{\index{\-Macro\-Manager\-Class@{\-Macro\-Manager\-Class}!get\-Planned\-Count@{get\-Planned\-Count}}
\index{get\-Planned\-Count@{get\-Planned\-Count}!MacroManagerClass@{\-Macro\-Manager\-Class}}
\subsubsection[{get\-Planned\-Count}]{\setlength{\rightskip}{0pt plus 5cm}int {\bf \-Macro\-Manager\-Class\-::get\-Planned\-Count} (
\begin{DoxyParamCaption}
\item[{{\bf \-B\-W\-A\-P\-I\-::\-Tech\-Type}}]{tech\-Type}
\end{DoxyParamCaption}
)}}\label{classMacroManagerClass_aeb789a6380c9c38ddf303683df80ff13}


\-Definition at line 591 of file \-Macro\-Manager.\-cpp.



\-References m\-Tasks\-Per\-Tech\-Type.


\begin{DoxyCode}
{
        int count = 0;
        for each(TaskPointer task in mTasksPerTechType[techType])
        {
                if(!task->inProgress())
                        ++count;
        }

        return count;
}
\end{DoxyCode}
\hypertarget{classMacroManagerClass_ae16c5369d0462c5a2347a67b1271d5b3}{\index{\-Macro\-Manager\-Class@{\-Macro\-Manager\-Class}!get\-Planned\-Count@{get\-Planned\-Count}}
\index{get\-Planned\-Count@{get\-Planned\-Count}!MacroManagerClass@{\-Macro\-Manager\-Class}}
\subsubsection[{get\-Planned\-Count}]{\setlength{\rightskip}{0pt plus 5cm}int {\bf \-Macro\-Manager\-Class\-::get\-Planned\-Count} (
\begin{DoxyParamCaption}
\item[{{\bf \-B\-W\-A\-P\-I\-::\-Upgrade\-Type}}]{upgrade\-Type, }
\item[{int}]{level}
\end{DoxyParamCaption}
)}}\label{classMacroManagerClass_ae16c5369d0462c5a2347a67b1271d5b3}


\-Definition at line 613 of file \-Macro\-Manager.\-cpp.



\-References m\-Tasks\-Per\-Upgrade\-Type.


\begin{DoxyCode}
{
        int count = 0;
        for each(TaskPointer task in mTasksPerUpgradeType[upgradeType][level])
        {
                if(!task->inProgress())
                        ++count;
        }

        return count;
}
\end{DoxyCode}
\hypertarget{classMacroManagerClass_afdc40fc2db5660cf995ea3366eea6a3a}{\index{\-Macro\-Manager\-Class@{\-Macro\-Manager\-Class}!get\-Planned\-Total@{get\-Planned\-Total}}
\index{get\-Planned\-Total@{get\-Planned\-Total}!MacroManagerClass@{\-Macro\-Manager\-Class}}
\subsubsection[{get\-Planned\-Total}]{\setlength{\rightskip}{0pt plus 5cm}int {\bf \-Macro\-Manager\-Class\-::get\-Planned\-Total} (
\begin{DoxyParamCaption}
\item[{{\bf \-B\-W\-A\-P\-I\-::\-Unit\-Type}}]{unit\-Type}
\end{DoxyParamCaption}
)}}\label{classMacroManagerClass_afdc40fc2db5660cf995ea3366eea6a3a}


\-Definition at line 581 of file \-Macro\-Manager.\-cpp.



\-References \-B\-W\-A\-P\-I\-::\-Player\-::all\-Unit\-Count(), \-B\-W\-A\-P\-I\-::\-Broodwar, get\-Planned\-Count(), and \-B\-W\-A\-P\-I\-::\-Game\-::self().



\-Referenced by is\-Planning\-Tech(), is\-Planning\-Unit(), is\-Planning\-Upgrade(), and update\-Observer\-Production().


\begin{DoxyCode}
{
        return getPlannedCount(unitType) + BWAPI::Broodwar->self()->allUnitCount
      (unitType);
}
\end{DoxyCode}


\-Here is the call graph for this function\-:\nopagebreak
\begin{figure}[H]
\begin{center}
\leavevmode
\includegraphics[width=350pt]{classMacroManagerClass_afdc40fc2db5660cf995ea3366eea6a3a_cgraph}
\end{center}
\end{figure}




\-Here is the caller graph for this function\-:\nopagebreak
\begin{figure}[H]
\begin{center}
\leavevmode
\includegraphics[width=350pt]{classMacroManagerClass_afdc40fc2db5660cf995ea3366eea6a3a_icgraph}
\end{center}
\end{figure}


\hypertarget{classMacroManagerClass_a8b8397b0f64485a99b3db8c0393cbde3}{\index{\-Macro\-Manager\-Class@{\-Macro\-Manager\-Class}!get\-Planned\-Total@{get\-Planned\-Total}}
\index{get\-Planned\-Total@{get\-Planned\-Total}!MacroManagerClass@{\-Macro\-Manager\-Class}}
\subsubsection[{get\-Planned\-Total}]{\setlength{\rightskip}{0pt plus 5cm}int {\bf \-Macro\-Manager\-Class\-::get\-Planned\-Total} (
\begin{DoxyParamCaption}
\item[{{\bf \-B\-W\-A\-P\-I\-::\-Tech\-Type}}]{tech\-Type}
\end{DoxyParamCaption}
)}}\label{classMacroManagerClass_a8b8397b0f64485a99b3db8c0393cbde3}


\-Definition at line 603 of file \-Macro\-Manager.\-cpp.



\-References \-B\-W\-A\-P\-I\-::\-Broodwar, get\-Planned\-Count(), \-B\-W\-A\-P\-I\-::\-Player\-::has\-Researched(), and \-B\-W\-A\-P\-I\-::\-Game\-::self().


\begin{DoxyCode}
{
        return getPlannedCount(techType) + (BWAPI::Broodwar->self()->
      hasResearched(techType) ? 1 : 0);
}
\end{DoxyCode}


\-Here is the call graph for this function\-:\nopagebreak
\begin{figure}[H]
\begin{center}
\leavevmode
\includegraphics[width=350pt]{classMacroManagerClass_a8b8397b0f64485a99b3db8c0393cbde3_cgraph}
\end{center}
\end{figure}


\hypertarget{classMacroManagerClass_a7a3bbfef8d9d7afe521017e9648d4d22}{\index{\-Macro\-Manager\-Class@{\-Macro\-Manager\-Class}!get\-Planned\-Total@{get\-Planned\-Total}}
\index{get\-Planned\-Total@{get\-Planned\-Total}!MacroManagerClass@{\-Macro\-Manager\-Class}}
\subsubsection[{get\-Planned\-Total}]{\setlength{\rightskip}{0pt plus 5cm}int {\bf \-Macro\-Manager\-Class\-::get\-Planned\-Total} (
\begin{DoxyParamCaption}
\item[{{\bf \-B\-W\-A\-P\-I\-::\-Upgrade\-Type}}]{upgrade\-Type, }
\item[{int}]{level}
\end{DoxyParamCaption}
)}}\label{classMacroManagerClass_a7a3bbfef8d9d7afe521017e9648d4d22}


\-Definition at line 625 of file \-Macro\-Manager.\-cpp.



\-References \-B\-W\-A\-P\-I\-::\-Broodwar, get\-Planned\-Count(), \-B\-W\-A\-P\-I\-::\-Player\-::get\-Upgrade\-Level(), and \-B\-W\-A\-P\-I\-::\-Game\-::self().


\begin{DoxyCode}
{
        return getPlannedCount(upgradeType, level) + (BWAPI::Broodwar->self()->
      getUpgradeLevel(upgradeType) >= level ? 1 : 0);
}
\end{DoxyCode}


\-Here is the call graph for this function\-:\nopagebreak
\begin{figure}[H]
\begin{center}
\leavevmode
\includegraphics[width=350pt]{classMacroManagerClass_a7a3bbfef8d9d7afe521017e9648d4d22_cgraph}
\end{center}
\end{figure}


\hypertarget{classMacroManagerClass_a38f6756ba11d2d611208157c4b7ed4ad}{\index{\-Macro\-Manager\-Class@{\-Macro\-Manager\-Class}!has\-Requirements@{has\-Requirements}}
\index{has\-Requirements@{has\-Requirements}!MacroManagerClass@{\-Macro\-Manager\-Class}}
\subsubsection[{has\-Requirements}]{\setlength{\rightskip}{0pt plus 5cm}bool {\bf \-Macro\-Manager\-Class\-::has\-Requirements} (
\begin{DoxyParamCaption}
\item[{{\bf \-B\-W\-A\-P\-I\-::\-Unit\-Type}}]{type}
\end{DoxyParamCaption}
)}}\label{classMacroManagerClass_a38f6756ba11d2d611208157c4b7ed4ad}


\-Definition at line 433 of file \-Macro\-Manager.\-cpp.



\-References \-B\-W\-A\-P\-I\-::\-Broodwar, \-B\-W\-A\-P\-I\-::\-Unit\-Type\-::required\-Units(), and \-B\-W\-A\-P\-I\-::\-Unit\-Type\-::what\-Builds().



\-Referenced by update\-Observer\-Production(), update\-Production\-Production(), and update\-Unit\-Production().


\begin{DoxyCode}
{
        if(BWAPI::Broodwar->self()->completedUnitCount(type.whatBuilds().first)
       == 0)
                return false;

        for(std::map<BWAPI::UnitType, int>::const_iterator it = type.
      requiredUnits().begin(); it != type.requiredUnits().end(); ++it)
        {
                if(BWAPI::Broodwar->self()->completedUnitCount(it->first) == 0)
                        return false;
        }

        return true;
}
\end{DoxyCode}


\-Here is the call graph for this function\-:\nopagebreak
\begin{figure}[H]
\begin{center}
\leavevmode
\includegraphics[width=350pt]{classMacroManagerClass_a38f6756ba11d2d611208157c4b7ed4ad_cgraph}
\end{center}
\end{figure}




\-Here is the caller graph for this function\-:\nopagebreak
\begin{figure}[H]
\begin{center}
\leavevmode
\includegraphics[width=350pt]{classMacroManagerClass_a38f6756ba11d2d611208157c4b7ed4ad_icgraph}
\end{center}
\end{figure}


\hypertarget{classMacroManagerClass_a9689d9c9b0dd78b8bf629af425d67897}{\index{\-Macro\-Manager\-Class@{\-Macro\-Manager\-Class}!has\-Requirements@{has\-Requirements}}
\index{has\-Requirements@{has\-Requirements}!MacroManagerClass@{\-Macro\-Manager\-Class}}
\subsubsection[{has\-Requirements}]{\setlength{\rightskip}{0pt plus 5cm}bool {\bf \-Macro\-Manager\-Class\-::has\-Requirements} (
\begin{DoxyParamCaption}
\item[{{\bf \-B\-W\-A\-P\-I\-::\-Tech\-Type}}]{type}
\end{DoxyParamCaption}
)}}\label{classMacroManagerClass_a9689d9c9b0dd78b8bf629af425d67897}


\-Definition at line 447 of file \-Macro\-Manager.\-cpp.



\-References \-B\-W\-A\-P\-I\-::\-Broodwar, and \-B\-W\-A\-P\-I\-::\-Tech\-Type\-::what\-Researches().


\begin{DoxyCode}
{
        if(BWAPI::Broodwar->self()->completedUnitCount(type.whatResearches()) 
      == 0)
                return false;

        return true;
}
\end{DoxyCode}


\-Here is the call graph for this function\-:\nopagebreak
\begin{figure}[H]
\begin{center}
\leavevmode
\includegraphics[width=350pt]{classMacroManagerClass_a9689d9c9b0dd78b8bf629af425d67897_cgraph}
\end{center}
\end{figure}


\hypertarget{classMacroManagerClass_aca9b2d3ebbb78245e7d6355e5d088ac0}{\index{\-Macro\-Manager\-Class@{\-Macro\-Manager\-Class}!has\-Requirements@{has\-Requirements}}
\index{has\-Requirements@{has\-Requirements}!MacroManagerClass@{\-Macro\-Manager\-Class}}
\subsubsection[{has\-Requirements}]{\setlength{\rightskip}{0pt plus 5cm}bool {\bf \-Macro\-Manager\-Class\-::has\-Requirements} (
\begin{DoxyParamCaption}
\item[{{\bf \-B\-W\-A\-P\-I\-::\-Upgrade\-Type}}]{type, }
\item[{int}]{level}
\end{DoxyParamCaption}
)}}\label{classMacroManagerClass_aca9b2d3ebbb78245e7d6355e5d088ac0}


\-Definition at line 455 of file \-Macro\-Manager.\-cpp.



\-References \-B\-W\-A\-P\-I\-::\-Broodwar, \-B\-W\-A\-P\-I\-::\-Player\-::completed\-Unit\-Count(), \-B\-W\-A\-P\-I\-::\-Upgrade\-Types\-::\-Protoss\-\_\-\-Air\-\_\-\-Armor, \-B\-W\-A\-P\-I\-::\-Upgrade\-Types\-::\-Protoss\-\_\-\-Air\-\_\-\-Weapons, \-B\-W\-A\-P\-I\-::\-Unit\-Types\-::\-Protoss\-\_\-\-Cybernetics\-\_\-\-Core, \-B\-W\-A\-P\-I\-::\-Unit\-Types\-::\-Protoss\-\_\-\-Fleet\-\_\-\-Beacon, \-B\-W\-A\-P\-I\-::\-Upgrade\-Types\-::\-Protoss\-\_\-\-Ground\-\_\-\-Armor, \-B\-W\-A\-P\-I\-::\-Upgrade\-Types\-::\-Protoss\-\_\-\-Ground\-\_\-\-Weapons, \-B\-W\-A\-P\-I\-::\-Upgrade\-Types\-::\-Protoss\-\_\-\-Plasma\-\_\-\-Shields, \-B\-W\-A\-P\-I\-::\-Unit\-Types\-::\-Protoss\-\_\-\-Templar\-\_\-\-Archives, \-B\-W\-A\-P\-I\-::\-Game\-::self(), and \-B\-W\-A\-P\-I\-::\-Upgrade\-Type\-::what\-Upgrades().


\begin{DoxyCode}
{
        if(BWAPI::Broodwar->self()->completedUnitCount(type.whatUpgrades()) == 
      0)
                return false;

        if(level != 1 && BWAPI::Broodwar->self()->getUpgradeLevel(type) != (
      level - 1))
                return false;

        if(level > 1)
        {
                if((type == BWAPI::UpgradeTypes::Protoss_Ground_Weapons || type
       == BWAPI::UpgradeTypes::Protoss_Ground_Armor) && BWAPI::Broodwar->self()->
      completedUnitCount(BWAPI::UnitTypes::Protoss_Templar_Archives) == 0)
                        return false;
                else if(type == BWAPI::UpgradeTypes::Protoss_Plasma_Shields && 
      BWAPI::Broodwar->self()->completedUnitCount(
      BWAPI::UnitTypes::Protoss_Cybernetics_Core) == 0)
                        return false;
                else if((type == BWAPI::UpgradeTypes::Protoss_Air_Armor || type
       == BWAPI::UpgradeTypes::Protoss_Air_Weapons) && BWAPI::Broodwar->self()->
      completedUnitCount(BWAPI::UnitTypes::Protoss_Fleet_Beacon) == 0)
                        return false;
        }

        return true;
}
\end{DoxyCode}


\-Here is the call graph for this function\-:\nopagebreak
\begin{figure}[H]
\begin{center}
\leavevmode
\includegraphics[width=350pt]{classMacroManagerClass_aca9b2d3ebbb78245e7d6355e5d088ac0_cgraph}
\end{center}
\end{figure}


\hypertarget{classMacroManagerClass_a117c4b6f2c54b450085f2cd113323053}{\index{\-Macro\-Manager\-Class@{\-Macro\-Manager\-Class}!is\-Planning\-Tech@{is\-Planning\-Tech}}
\index{is\-Planning\-Tech@{is\-Planning\-Tech}!MacroManagerClass@{\-Macro\-Manager\-Class}}
\subsubsection[{is\-Planning\-Tech}]{\setlength{\rightskip}{0pt plus 5cm}bool {\bf \-Macro\-Manager\-Class\-::is\-Planning\-Tech} (
\begin{DoxyParamCaption}
\item[{{\bf \-B\-W\-A\-P\-I\-::\-Tech\-Type}}]{tech\-Type}
\end{DoxyParamCaption}
)}}\label{classMacroManagerClass_a117c4b6f2c54b450085f2cd113323053}


\-Definition at line 608 of file \-Macro\-Manager.\-cpp.



\-References get\-Planned\-Total().


\begin{DoxyCode}
{
        return getPlannedTotal(techType) != 0;
}
\end{DoxyCode}


\-Here is the call graph for this function\-:\nopagebreak
\begin{figure}[H]
\begin{center}
\leavevmode
\includegraphics[width=350pt]{classMacroManagerClass_a117c4b6f2c54b450085f2cd113323053_cgraph}
\end{center}
\end{figure}


\hypertarget{classMacroManagerClass_a9b99936c0fa1796eac67282a9b16a910}{\index{\-Macro\-Manager\-Class@{\-Macro\-Manager\-Class}!is\-Planning\-Unit@{is\-Planning\-Unit}}
\index{is\-Planning\-Unit@{is\-Planning\-Unit}!MacroManagerClass@{\-Macro\-Manager\-Class}}
\subsubsection[{is\-Planning\-Unit}]{\setlength{\rightskip}{0pt plus 5cm}bool {\bf \-Macro\-Manager\-Class\-::is\-Planning\-Unit} (
\begin{DoxyParamCaption}
\item[{{\bf \-B\-W\-A\-P\-I\-::\-Unit\-Type}}]{unit\-Type}
\end{DoxyParamCaption}
)}}\label{classMacroManagerClass_a9b99936c0fa1796eac67282a9b16a910}


\-Definition at line 586 of file \-Macro\-Manager.\-cpp.



\-References get\-Planned\-Total().



\-Referenced by add\-Needed(), and get\-Needed\-Units().


\begin{DoxyCode}
{
        return getPlannedTotal(unitType) != 0;
}
\end{DoxyCode}


\-Here is the call graph for this function\-:\nopagebreak
\begin{figure}[H]
\begin{center}
\leavevmode
\includegraphics[width=350pt]{classMacroManagerClass_a9b99936c0fa1796eac67282a9b16a910_cgraph}
\end{center}
\end{figure}




\-Here is the caller graph for this function\-:\nopagebreak
\begin{figure}[H]
\begin{center}
\leavevmode
\includegraphics[width=350pt]{classMacroManagerClass_a9b99936c0fa1796eac67282a9b16a910_icgraph}
\end{center}
\end{figure}


\hypertarget{classMacroManagerClass_a57b5244cc47298b367838849e8904705}{\index{\-Macro\-Manager\-Class@{\-Macro\-Manager\-Class}!is\-Planning\-Upgrade@{is\-Planning\-Upgrade}}
\index{is\-Planning\-Upgrade@{is\-Planning\-Upgrade}!MacroManagerClass@{\-Macro\-Manager\-Class}}
\subsubsection[{is\-Planning\-Upgrade}]{\setlength{\rightskip}{0pt plus 5cm}bool {\bf \-Macro\-Manager\-Class\-::is\-Planning\-Upgrade} (
\begin{DoxyParamCaption}
\item[{{\bf \-B\-W\-A\-P\-I\-::\-Upgrade\-Type}}]{upgrade\-Type, }
\item[{int}]{level}
\end{DoxyParamCaption}
)}}\label{classMacroManagerClass_a57b5244cc47298b367838849e8904705}


\-Definition at line 630 of file \-Macro\-Manager.\-cpp.



\-References get\-Planned\-Total().


\begin{DoxyCode}
{
        return getPlannedTotal(upgradeType, level) != 0;
}
\end{DoxyCode}


\-Here is the call graph for this function\-:\nopagebreak
\begin{figure}[H]
\begin{center}
\leavevmode
\includegraphics[width=350pt]{classMacroManagerClass_a57b5244cc47298b367838849e8904705_cgraph}
\end{center}
\end{figure}


\hypertarget{classMacroManagerClass_aefc52076481a7d50f1b7fe36f188b8f8}{\index{\-Macro\-Manager\-Class@{\-Macro\-Manager\-Class}!on\-Begin@{on\-Begin}}
\index{on\-Begin@{on\-Begin}!MacroManagerClass@{\-Macro\-Manager\-Class}}
\subsubsection[{on\-Begin}]{\setlength{\rightskip}{0pt plus 5cm}void {\bf \-Macro\-Manager\-Class\-::on\-Begin} (
\begin{DoxyParamCaption}
{}
\end{DoxyParamCaption}
)}}\label{classMacroManagerClass_aefc52076481a7d50f1b7fe36f188b8f8}


\-Definition at line 8 of file \-Macro\-Manager.\-cpp.



\-References \-B\-W\-A\-P\-I\-::\-Upgrade\-Types\-::\-Adrenal\-\_\-\-Glands, \-B\-W\-A\-P\-I\-::\-Upgrade\-Types\-::\-Anabolic\-\_\-\-Synthesis, \-B\-W\-A\-P\-I\-::\-Upgrade\-Types\-::\-Antennae, \-B\-W\-A\-P\-I\-::\-Upgrade\-Types\-::\-Apial\-\_\-\-Sensors, \-B\-W\-A\-P\-I\-::\-Upgrade\-Types\-::\-Apollo\-\_\-\-Reactor, \-B\-W\-A\-P\-I\-::\-Tech\-Types\-::\-Archon\-\_\-\-Warp, \-B\-W\-A\-P\-I\-::\-Upgrade\-Types\-::\-Argus\-\_\-\-Jewel, \-B\-W\-A\-P\-I\-::\-Upgrade\-Types\-::\-Argus\-\_\-\-Talisman, \-B\-W\-A\-P\-I\-::\-Orders\-::\-Burrowing, \-B\-W\-A\-P\-I\-::\-Upgrade\-Types\-::\-Caduceus\-\_\-\-Reactor, \-B\-W\-A\-P\-I\-::\-Upgrade\-Types\-::\-Carrier\-\_\-\-Capacity, \-B\-W\-A\-P\-I\-::\-Upgrade\-Types\-::\-Charon\-\_\-\-Boosters, \-B\-W\-A\-P\-I\-::\-Upgrade\-Types\-::\-Chitinous\-\_\-\-Plating, \-B\-W\-A\-P\-I\-::\-Tech\-Types\-::\-Cloaking\-\_\-\-Field, \-B\-W\-A\-P\-I\-::\-Upgrade\-Types\-::\-Colossus\-\_\-\-Reactor, \-B\-W\-A\-P\-I\-::\-Bullet\-Types\-::\-Consume, \-B\-W\-A\-P\-I\-::\-Tech\-Types\-::\-Dark\-\_\-\-Archon\-\_\-\-Meld, \-B\-W\-A\-P\-I\-::\-Explosion\-Types\-::\-Dark\-\_\-\-Swarm, \-B\-W\-A\-P\-I\-::\-Tech\-Types\-::\-Defensive\-\_\-\-Matrix, \-B\-W\-A\-P\-I\-::\-Explosion\-Types\-::\-Disruption\-\_\-\-Web, \-B\-W\-A\-P\-I\-::\-Explosion\-Types\-::\-E\-M\-P\-\_\-\-Shockwave, \-B\-W\-A\-P\-I\-::\-Explosion\-Types\-::\-Ensnare, \-B\-W\-A\-P\-I\-::\-Explosion\-Types\-::\-Feedback, \-B\-W\-A\-P\-I\-::\-Upgrade\-Types\-::\-Gamete\-\_\-\-Meiosis, \-B\-W\-A\-P\-I\-::\-Upgrade\-Types\-::\-Gravitic\-\_\-\-Boosters, \-B\-W\-A\-P\-I\-::\-Upgrade\-Types\-::\-Gravitic\-\_\-\-Drive, \-B\-W\-A\-P\-I\-::\-Upgrade\-Types\-::\-Gravitic\-\_\-\-Thrusters, \-B\-W\-A\-P\-I\-::\-Upgrade\-Types\-::\-Grooved\-\_\-\-Spines, \-B\-W\-A\-P\-I\-::\-Tech\-Types\-::\-Hallucination, \-B\-W\-A\-P\-I\-::\-Tech\-Types\-::\-Healing, \-B\-W\-A\-P\-I\-::\-Tech\-Types\-::\-Infestation, \-Singleton$<$ T $>$\-::\-Instance(), \-B\-W\-A\-P\-I\-::\-Upgrade\-Types\-::\-Ion\-\_\-\-Thrusters, \-B\-W\-A\-P\-I\-::\-Explosion\-Types\-::\-Irradiate, \-B\-W\-A\-P\-I\-::\-Upgrade\-Types\-::\-Khaydarin\-\_\-\-Amulet, \-B\-W\-A\-P\-I\-::\-Upgrade\-Types\-::\-Khaydarin\-\_\-\-Core, \-B\-W\-A\-P\-I\-::\-Upgrade\-Types\-::\-Leg\-\_\-\-Enhancements, \-B\-W\-A\-P\-I\-::\-Explosion\-Types\-::\-Lockdown, \-B\-W\-A\-P\-I\-::\-Tech\-Types\-::\-Lurker\-\_\-\-Aspect, \-B\-W\-A\-P\-I\-::\-Explosion\-Types\-::\-Maelstrom, \-B\-W\-A\-P\-I\-::\-Upgrade\-Types\-::\-Metabolic\-\_\-\-Boost, \-B\-W\-A\-P\-I\-::\-Upgrade\-Types\-::\-Metasynaptic\-\_\-\-Node, \-B\-W\-A\-P\-I\-::\-Explosion\-Types\-::\-Mind\-\_\-\-Control, \-B\-W\-A\-P\-I\-::\-Upgrade\-Types\-::\-Moebius\-\_\-\-Reactor, m\-Tech\-Priority\-Map, m\-Upgrade\-Priority\-Map, \-B\-W\-A\-P\-I\-::\-Upgrade\-Types\-::\-Muscular\-\_\-\-Augments, \-B\-W\-A\-P\-I\-::\-Tech\-Types\-::\-Nuclear\-\_\-\-Strike, \-B\-W\-A\-P\-I\-::\-Upgrade\-Types\-::\-Ocular\-\_\-\-Implants, \-B\-W\-A\-P\-I\-::\-Explosion\-Types\-::\-Optical\-\_\-\-Flare, \-B\-W\-A\-P\-I\-::\-Explosion\-Types\-::\-Parasite, \-B\-W\-A\-P\-I\-::\-Tech\-Types\-::\-Personnel\-\_\-\-Cloaking, \-B\-W\-A\-P\-I\-::\-Explosion\-Types\-::\-Plague, \-B\-W\-A\-P\-I\-::\-Upgrade\-Types\-::\-Pneumatized\-\_\-\-Carapace, \-B\-W\-A\-P\-I\-::\-Races\-::\-Protoss, \-B\-W\-A\-P\-I\-::\-Upgrade\-Types\-::\-Protoss\-\_\-\-Air\-\_\-\-Armor, \-B\-W\-A\-P\-I\-::\-Upgrade\-Types\-::\-Protoss\-\_\-\-Air\-\_\-\-Weapons, \-B\-W\-A\-P\-I\-::\-Upgrade\-Types\-::\-Protoss\-\_\-\-Ground\-\_\-\-Armor, \-B\-W\-A\-P\-I\-::\-Upgrade\-Types\-::\-Protoss\-\_\-\-Ground\-\_\-\-Weapons, \-B\-W\-A\-P\-I\-::\-Upgrade\-Types\-::\-Protoss\-\_\-\-Plasma\-\_\-\-Shields, \-B\-W\-A\-P\-I\-::\-Bullet\-Types\-::\-Psionic\-\_\-\-Storm, \-B\-W\-A\-P\-I\-::\-Upgrade\-Types\-::\-Reaver\-\_\-\-Capacity, \-B\-W\-A\-P\-I\-::\-Tech\-Types\-::\-Recall, \-B\-W\-A\-P\-I\-::\-Explosion\-Types\-::\-Restoration, \-B\-W\-A\-P\-I\-::\-Tech\-Types\-::\-Scanner\-\_\-\-Sweep, \-B\-W\-A\-P\-I\-::\-Upgrade\-Types\-::\-Scarab\-\_\-\-Damage, \-B\-W\-A\-P\-I\-::\-Upgrade\-Types\-::\-Sensor\-\_\-\-Array, \-B\-W\-A\-P\-I\-::\-Upgrade\-Types\-::\-Singularity\-\_\-\-Charge, \-B\-W\-A\-P\-I\-::\-Tech\-Types\-::\-Spawn\-\_\-\-Broodlings, \-B\-W\-A\-P\-I\-::\-Tech\-Types\-::\-Spider\-\_\-\-Mines, \-B\-W\-A\-P\-I\-::\-Explosion\-Types\-::\-Stasis\-\_\-\-Field, \-B\-W\-A\-P\-I\-::\-Tech\-Types\-::\-Stim\-\_\-\-Packs, \-B\-W\-A\-P\-I\-::\-Tech\-Types\-::\-Tank\-\_\-\-Siege\-\_\-\-Mode, \-B\-W\-A\-P\-I\-::\-Upgrade\-Types\-::\-Terran\-\_\-\-Infantry\-\_\-\-Armor, \-B\-W\-A\-P\-I\-::\-Upgrade\-Types\-::\-Terran\-\_\-\-Infantry\-\_\-\-Weapons, \-B\-W\-A\-P\-I\-::\-Upgrade\-Types\-::\-Terran\-\_\-\-Ship\-\_\-\-Plating, \-B\-W\-A\-P\-I\-::\-Upgrade\-Types\-::\-Terran\-\_\-\-Ship\-\_\-\-Weapons, \-B\-W\-A\-P\-I\-::\-Upgrade\-Types\-::\-Terran\-\_\-\-Vehicle\-\_\-\-Plating, \-B\-W\-A\-P\-I\-::\-Upgrade\-Types\-::\-Terran\-\_\-\-Vehicle\-\_\-\-Weapons, \-B\-W\-A\-P\-I\-::\-Upgrade\-Types\-::\-Titan\-\_\-\-Reactor, \-B\-W\-A\-P\-I\-::\-Upgrade\-Types\-::\-U\-\_\-238\-\_\-\-Shells, \-B\-W\-A\-P\-I\-::\-Upgrade\-Types\-::\-Ventral\-\_\-\-Sacs, \-B\-W\-A\-P\-I\-::\-Bullet\-Types\-::\-Yamato\-\_\-\-Gun, \-B\-W\-A\-P\-I\-::\-Races\-::\-Zerg, \-B\-W\-A\-P\-I\-::\-Upgrade\-Types\-::\-Zerg\-\_\-\-Carapace, \-B\-W\-A\-P\-I\-::\-Upgrade\-Types\-::\-Zerg\-\_\-\-Flyer\-\_\-\-Attacks, \-B\-W\-A\-P\-I\-::\-Upgrade\-Types\-::\-Zerg\-\_\-\-Flyer\-\_\-\-Carapace, \-B\-W\-A\-P\-I\-::\-Upgrade\-Types\-::\-Zerg\-\_\-\-Melee\-\_\-\-Attacks, and \-B\-W\-A\-P\-I\-::\-Upgrade\-Types\-::\-Zerg\-\_\-\-Missile\-\_\-\-Attacks.


\begin{DoxyCode}
{
        using namespace BWAPI::TechTypes;
        using namespace BWAPI::UpgradeTypes;

        //Terran Tech
        mTechPriorityMap[Tank_Siege_Mode] = 110;
        mTechPriorityMap[Spider_Mines] = 100;
        mTechPriorityMap[Stim_Packs] = 90;
        mTechPriorityMap[Yamato_Gun] = 90; //Battlecruiser
        mTechPriorityMap[Cloaking_Field] = 85;
        mTechPriorityMap[Irradiate] = PlayerTracker::Instance().isEnemyRace(
      BWAPI::Races::Zerg) ? 89 : 0;
        mTechPriorityMap[EMP_Shockwave] = PlayerTracker::Instance().isEnemyRace
      (BWAPI::Races::Protoss) ? 99 : 0;
        mTechPriorityMap[Personnel_Cloaking] = 75;
        mTechPriorityMap[Healing] = 10;
        mTechPriorityMap[Lockdown] = 10;
        mTechPriorityMap[Restoration] = 10;
        mTechPriorityMap[Optical_Flare] = 5;

        //Pre Researched
        mTechPriorityMap[Nuclear_Strike] = 0;
        mTechPriorityMap[Scanner_Sweep] = 0;
        mTechPriorityMap[Defensive_Matrix] = 0;

        //Zerg Tech
        mTechPriorityMap[Burrowing] = 100;
        mTechPriorityMap[Consume] = 100;
        mTechPriorityMap[Dark_Swarm] = 100;
        mTechPriorityMap[Ensnare] = 100;
        mTechPriorityMap[Infestation] = 100;
        mTechPriorityMap[Lurker_Aspect] = 100;
        mTechPriorityMap[Parasite] = 100;
        mTechPriorityMap[Plague] = 100;
        mTechPriorityMap[Spawn_Broodlings] = 100;

        //Protoss Tech
        mTechPriorityMap[Disruption_Web] = 0;
        mTechPriorityMap[Feedback] = 0;
        mTechPriorityMap[Hallucination] = 0;
        mTechPriorityMap[Maelstrom] = 0; //Dark Arcon freezes targeted units
        mTechPriorityMap[Mind_Control] = 0;
        mTechPriorityMap[Psionic_Storm] = 120;
        mTechPriorityMap[Recall] = 90;
        mTechPriorityMap[Stasis_Field] = 80;

        //Pre Researched
        mTechPriorityMap[Archon_Warp] = 0;
        mTechPriorityMap[Dark_Archon_Meld] = 0;

        //Terran Upgrades
        mUpgradePriorityMap[Terran_Infantry_Armor] = 85;
        mUpgradePriorityMap[Terran_Infantry_Weapons] = 90;
        mUpgradePriorityMap[Terran_Ship_Plating] = 65;
        mUpgradePriorityMap[Terran_Ship_Weapons] = 60;
        mUpgradePriorityMap[Terran_Vehicle_Plating] = 85;
        mUpgradePriorityMap[Terran_Vehicle_Weapons] = 90;
        mUpgradePriorityMap[U_238_Shells] = 85; //Marine Range
        mUpgradePriorityMap[Charon_Boosters] = 85; //Goliath Range
        mUpgradePriorityMap[Ion_Thrusters] = 95; //Vulture Speed
        mUpgradePriorityMap[Apollo_Reactor] = 40; //Wraith Energy
        mUpgradePriorityMap[Caduceus_Reactor] = 60; //Medic Energy
        mUpgradePriorityMap[Colossus_Reactor] = 40; //Battlecruiser Energy
        mUpgradePriorityMap[Moebius_Reactor] = 40; //Ghost Energy Upgrade
        mUpgradePriorityMap[Ocular_Implants] = 40; //Ghost Sight Range
        mUpgradePriorityMap[Titan_Reactor] = 70; //Science Vessel Energy

        //Zerg Upgrades
        mUpgradePriorityMap[Ventral_Sacs] = 80; //Overlord drop
        mUpgradePriorityMap[Zerg_Carapace] = 95;
        mUpgradePriorityMap[Zerg_Flyer_Attacks] = 100;
        mUpgradePriorityMap[Zerg_Flyer_Carapace] = 95;
        mUpgradePriorityMap[Zerg_Melee_Attacks] = 100;
        mUpgradePriorityMap[Zerg_Missile_Attacks] = 100;
        mUpgradePriorityMap[Metabolic_Boost] = 100; //Zergling Movement Speed
        mUpgradePriorityMap[Adrenal_Glands] = 100; //Zergling Attack Speed
        mUpgradePriorityMap[Anabolic_Synthesis] = 100; //Ultralisk Speed
        mUpgradePriorityMap[Antennae] = 100; //Overlord Sight Range
        mUpgradePriorityMap[Chitinous_Plating] = 100; //Ultralisk +2 armor
        mUpgradePriorityMap[Gamete_Meiosis] = 100; // Zerg queen Energy
        mUpgradePriorityMap[Grooved_Spines] = 100; // Hydralisk range
        mUpgradePriorityMap[Metasynaptic_Node] = 100; // Defiler Energy
        mUpgradePriorityMap[Muscular_Augments] = 100; //Hydralisk Speed
        mUpgradePriorityMap[Pneumatized_Carapace] = 100; //Overlord Speed

        //Protoss Upgrades
        mUpgradePriorityMap[Protoss_Air_Weapons] = 0;
        mUpgradePriorityMap[Protoss_Air_Armor] = 0;
        mUpgradePriorityMap[Protoss_Ground_Weapons] = 100;
        mUpgradePriorityMap[Protoss_Plasma_Shields] = 70;
        mUpgradePriorityMap[Protoss_Ground_Armor] = 95;
        mUpgradePriorityMap[Reaver_Capacity] = 85; //More scarabs
        mUpgradePriorityMap[Scarab_Damage] = 100; //Increase Reaver Scarab
       Damage
        mUpgradePriorityMap[Singularity_Charge] = 110; //Dragoon Range
        mUpgradePriorityMap[Carrier_Capacity] = 110; //MOAR INTERCEPTORS!
        mUpgradePriorityMap[Apial_Sensors] = 100; //Scout Sight
        mUpgradePriorityMap[Argus_Jewel] = 100; //Cosair Energy
        mUpgradePriorityMap[Argus_Talisman] = 100; //Dark Archon Energy
        mUpgradePriorityMap[Gravitic_Boosters] = 80; //Observer Speed
        mUpgradePriorityMap[Gravitic_Drive] = 97; //Shuttle Speed
        mUpgradePriorityMap[Gravitic_Thrusters] = 100; //Scout Speed
        mUpgradePriorityMap[Khaydarin_Amulet] = 90; //High Templar Energy
        mUpgradePriorityMap[Khaydarin_Core] = 80; //Arbitor Energy
        mUpgradePriorityMap[Leg_Enhancements] = 110; //Zealot Speed Upgrades
        mUpgradePriorityMap[Sensor_Array] = 60; // Observer Sight
}
\end{DoxyCode}


\-Here is the call graph for this function\-:\nopagebreak
\begin{figure}[H]
\begin{center}
\leavevmode
\includegraphics[width=350pt]{classMacroManagerClass_aefc52076481a7d50f1b7fe36f188b8f8_cgraph}
\end{center}
\end{figure}


\hypertarget{classMacroManagerClass_a03ef7268ea106577fab7c5d660de9a08}{\index{\-Macro\-Manager\-Class@{\-Macro\-Manager\-Class}!on\-Build\-Task@{on\-Build\-Task}}
\index{on\-Build\-Task@{on\-Build\-Task}!MacroManagerClass@{\-Macro\-Manager\-Class}}
\subsubsection[{on\-Build\-Task}]{\setlength{\rightskip}{0pt plus 5cm}void {\bf \-Macro\-Manager\-Class\-::on\-Build\-Task} (
\begin{DoxyParamCaption}
\item[{{\bf \-Task\-Pointer}}]{task, }
\item[{{\bf \-B\-W\-A\-P\-I\-::\-Unit\-Type}}]{unit\-Type}
\end{DoxyParamCaption}
)}}\label{classMacroManagerClass_a03ef7268ea106577fab7c5d660de9a08}


\-Definition at line 698 of file \-Macro\-Manager.\-cpp.



\-References m\-Tasks\-Per\-Produced\-Type, m\-Tasks\-Per\-Production\-Type, and \-B\-W\-A\-P\-I\-::\-Unit\-Type\-::what\-Builds().


\begin{DoxyCode}
{
        mTasksPerProductionType[unitType.whatBuilds().first].push_back(task);
        mTasksPerProducedType[unitType].push_back(task);
}
\end{DoxyCode}


\-Here is the call graph for this function\-:\nopagebreak
\begin{figure}[H]
\begin{center}
\leavevmode
\includegraphics[width=350pt]{classMacroManagerClass_a03ef7268ea106577fab7c5d660de9a08_cgraph}
\end{center}
\end{figure}


\hypertarget{classMacroManagerClass_a55d519b89ecb3485362b03f713088614}{\index{\-Macro\-Manager\-Class@{\-Macro\-Manager\-Class}!on\-Change\-Build@{on\-Change\-Build}}
\index{on\-Change\-Build@{on\-Change\-Build}!MacroManagerClass@{\-Macro\-Manager\-Class}}
\subsubsection[{on\-Change\-Build}]{\setlength{\rightskip}{0pt plus 5cm}void {\bf \-Macro\-Manager\-Class\-::on\-Change\-Build} (
\begin{DoxyParamCaption}
{}
\end{DoxyParamCaption}
)}}\label{classMacroManagerClass_a55d519b89ecb3485362b03f713088614}


\-Definition at line 253 of file \-Macro\-Manager.\-cpp.



\-References \-B\-W\-A\-P\-I\-::\-Unit\-Type\-::abilities(), \-B\-W\-A\-P\-I\-::\-Broodwar, create\-Tech\-Items(), \-B\-W\-A\-P\-I\-::\-Unit\-Type\-::gas\-Price(), get\-Needed\-Units(), \-Unit\-To\-Produce\-::get\-Priority(), \-B\-W\-A\-P\-I\-::\-Races\-::get\-Race(), \-Unit\-To\-Produce\-::get\-Unit\-Type(), \-B\-W\-A\-P\-I\-::\-Upgrade\-Types\-::\-Gravitic\-\_\-\-Drive, \-Singleton$<$ T $>$\-::\-Instance(), macro\-Compare(), \-B\-W\-A\-P\-I\-::\-Upgrade\-Type\-::max\-Repeats(), \-B\-W\-A\-P\-I\-::\-Unit\-Type\-::mineral\-Price(), m\-Low\-Gas\-Units, m\-Low\-Mineral\-Units, m\-Normal\-Units, m\-Tech\-Items, m\-Tech\-Items\-To\-Create, m\-Tech\-Priority\-Map, m\-Upgrade\-Priority\-Map, \-B\-W\-A\-P\-I\-::\-Races\-::\-Protoss, \-B\-W\-A\-P\-I\-::\-Upgrade\-Types\-::\-Protoss\-\_\-\-Air\-\_\-\-Weapons, \-B\-W\-A\-P\-I\-::\-Unit\-Types\-::\-Protoss\-\_\-\-Carrier, \-B\-W\-A\-P\-I\-::\-Unit\-Types\-::\-Protoss\-\_\-\-Observer, \-B\-W\-A\-P\-I\-::\-Unit\-Types\-::\-Protoss\-\_\-\-Photon\-\_\-\-Cannon, \-B\-W\-A\-P\-I\-::\-Unit\-Types\-::\-Protoss\-\_\-\-Reaver, \-B\-W\-A\-P\-I\-::\-Upgrade\-Types\-::\-Scarab\-\_\-\-Damage, update\-Task\-Lists(), and \-B\-W\-A\-P\-I\-::\-Unit\-Type\-::upgrades().


\begin{DoxyCode}
{
        mNormalUnits.clear();
        mLowMineralUnits.clear();
        mLowGasUnits.clear();

        mNormalUnits = BuildOrderManager::Instance().getCurrentBuild().
      getUnitsToProduce();

        for each(UnitToProduce unit in mNormalUnits)
        {
                double mineralToGasRatio = unit.getUnitType().gasPrice() == 0 ?
       1 : double(unit.getUnitType().mineralPrice())/double(unit.getUnitType().gasPrice
      ());
                double gasToMineralRatio = unit.getUnitType().mineralPrice() ==
       0 ? 1 : double(unit.getUnitType().gasPrice())/double(unit.getUnitType().
      mineralPrice());

                if(gasToMineralRatio < 0.4)
                        mLowGasUnits.push_back(unit);
                else if(mineralToGasRatio < 0.4)
                        mLowMineralUnits.push_back(unit);
        }

        for(std::list<std::pair<MacroItem, TaskPointer>>::iterator it = 
      mTechItems.begin(); it != mTechItems.end(); ++it)
        {
                if(!it->second->inProgress())
                        it->second->cancel();
        }
        mTechItems.clear();
        mTechItemsToCreate.clear();

        updateTaskLists();

        std::list<UnitToProduce> normalWithExtra = mNormalUnits;

        if(BWAPI::Broodwar->self()->getRace() == BWAPI::Races::Protoss)
        {
                normalWithExtra.push_back(UnitToProduce(
      BWAPI::UnitTypes::Protoss_Observer, 1, 115));
                normalWithExtra.push_back(UnitToProduce(
      BWAPI::UnitTypes::Protoss_Photon_Cannon, 1, 95));
        }

        std::set<BWAPI::TechType> techSet;
        std::set<BWAPI::UpgradeType> upgradeSet;

        for each(UnitToProduce unit in normalWithExtra)
        {
                for each(BWAPI::UnitType type in getNeededUnits(unit.getUnitType
      ()))
                {
                        mTechItemsToCreate.push_back(MacroItem(type, unit.
      getPriority()));
                }

                for each(BWAPI::TechType tech in unit.getUnitType().abilities()
      )
                {
                        techSet.insert(tech);
                }

                for each(BWAPI::UpgradeType upgrade in unit.getUnitType().
      upgrades())
                {
                        upgradeSet.insert(upgrade);
                }

                if(unit.getUnitType() == BWAPI::UnitTypes::Protoss_Reaver)
                {
                        // Scarab damage doesn't pick up under its upgrades
                        upgradeSet.insert(BWAPI::UpgradeTypes::Scarab_Damage);

                        // Reaver is usually used with shuttle, speed upgrade
       will probably help
                        upgradeSet.insert(BWAPI::UpgradeTypes::Gravitic_Drive);
                }
                else if(unit.getUnitType() == BWAPI::UnitTypes::Protoss_Carrier
      )
                        upgradeSet.insert(
      BWAPI::UpgradeTypes::Protoss_Air_Weapons);
        }

        for each(BWAPI::TechType tech in techSet)
        {
                if(mTechPriorityMap[tech] < 30)
                        continue;

                mTechItemsToCreate.push_back(MacroItem(tech, mTechPriorityMap[
      tech]));

                for each(BWAPI::UnitType type in getNeededUnits(tech))
                {
                        mTechItemsToCreate.push_back(MacroItem(type, 
      mTechPriorityMap[tech]));
                }
        }

        for each(BWAPI::UpgradeType upgrade in upgradeSet)
        {
                if(mUpgradePriorityMap[upgrade] < 30)
                        continue;

                for(int i = 1; i <= upgrade.maxRepeats(); ++i)
                {
                        int priority = mUpgradePriorityMap[upgrade] - ((i-1)*10
      );
                        mTechItemsToCreate.push_back(MacroItem(upgrade, i, 
      priority));

                        for each(BWAPI::UnitType type in getNeededUnits(upgrade
      , i))
                        {
                                mTechItemsToCreate.push_back(MacroItem(type, 
      priority));
                        }
                }
        }

        mTechItemsToCreate.sort(macroCompare);

        //remove duplicates now so the highest is kept
        std::set<BWAPI::UnitType> unitSet;
        for(std::list<MacroItem>::iterator it = mTechItemsToCreate.begin(); it 
      != mTechItemsToCreate.end();)
        {
                if(it->isUnitType())
                {
                        if(unitSet.count(it->getUnitType()) != 0)
                        {
                                mTechItemsToCreate.erase(it++);
                                continue;
                        }
                        else
                                unitSet.insert(it->getUnitType());
                }

                ++it;
        }

        createTechItems();
}
\end{DoxyCode}


\-Here is the call graph for this function\-:\nopagebreak
\begin{figure}[H]
\begin{center}
\leavevmode
\includegraphics[width=350pt]{classMacroManagerClass_a55d519b89ecb3485362b03f713088614_cgraph}
\end{center}
\end{figure}


\hypertarget{classMacroManagerClass_afbb24206d2c2a997a23751bcb745afa8}{\index{\-Macro\-Manager\-Class@{\-Macro\-Manager\-Class}!on\-Tech\-Task@{on\-Tech\-Task}}
\index{on\-Tech\-Task@{on\-Tech\-Task}!MacroManagerClass@{\-Macro\-Manager\-Class}}
\subsubsection[{on\-Tech\-Task}]{\setlength{\rightskip}{0pt plus 5cm}void {\bf \-Macro\-Manager\-Class\-::on\-Tech\-Task} (
\begin{DoxyParamCaption}
\item[{{\bf \-Task\-Pointer}}]{task, }
\item[{{\bf \-B\-W\-A\-P\-I\-::\-Tech\-Type}}]{tech\-Type}
\end{DoxyParamCaption}
)}}\label{classMacroManagerClass_afbb24206d2c2a997a23751bcb745afa8}


\-Definition at line 704 of file \-Macro\-Manager.\-cpp.



\-References m\-Tasks\-Per\-Production\-Type, m\-Tasks\-Per\-Tech\-Type, and \-B\-W\-A\-P\-I\-::\-Tech\-Type\-::what\-Researches().


\begin{DoxyCode}
{
        mTasksPerProductionType[techType.whatResearches()].push_back(task);
        mTasksPerTechType[techType].push_back(task);
}
\end{DoxyCode}


\-Here is the call graph for this function\-:\nopagebreak
\begin{figure}[H]
\begin{center}
\leavevmode
\includegraphics[width=350pt]{classMacroManagerClass_afbb24206d2c2a997a23751bcb745afa8_cgraph}
\end{center}
\end{figure}


\hypertarget{classMacroManagerClass_a3e6e272c3da1ef507ffbe7f309d666a1}{\index{\-Macro\-Manager\-Class@{\-Macro\-Manager\-Class}!on\-Upgrade\-Task@{on\-Upgrade\-Task}}
\index{on\-Upgrade\-Task@{on\-Upgrade\-Task}!MacroManagerClass@{\-Macro\-Manager\-Class}}
\subsubsection[{on\-Upgrade\-Task}]{\setlength{\rightskip}{0pt plus 5cm}void {\bf \-Macro\-Manager\-Class\-::on\-Upgrade\-Task} (
\begin{DoxyParamCaption}
\item[{{\bf \-Task\-Pointer}}]{task, }
\item[{{\bf \-B\-W\-A\-P\-I\-::\-Upgrade\-Type}}]{upgrade\-Type, }
\item[{int}]{level}
\end{DoxyParamCaption}
)}}\label{classMacroManagerClass_a3e6e272c3da1ef507ffbe7f309d666a1}


\-Definition at line 710 of file \-Macro\-Manager.\-cpp.



\-References m\-Tasks\-Per\-Production\-Type, m\-Tasks\-Per\-Upgrade\-Type, and \-B\-W\-A\-P\-I\-::\-Upgrade\-Type\-::what\-Upgrades().


\begin{DoxyCode}
{
        mTasksPerProductionType[upgradeType.whatUpgrades()].push_back(task);
        mTasksPerUpgradeType[upgradeType][level].push_back(task);
}
\end{DoxyCode}


\-Here is the call graph for this function\-:\nopagebreak
\begin{figure}[H]
\begin{center}
\leavevmode
\includegraphics[width=350pt]{classMacroManagerClass_a3e6e272c3da1ef507ffbe7f309d666a1_cgraph}
\end{center}
\end{figure}


\hypertarget{classMacroManagerClass_af016c23babface55aa9807159f25d586}{\index{\-Macro\-Manager\-Class@{\-Macro\-Manager\-Class}!update@{update}}
\index{update@{update}!MacroManagerClass@{\-Macro\-Manager\-Class}}
\subsubsection[{update}]{\setlength{\rightskip}{0pt plus 5cm}void {\bf \-Macro\-Manager\-Class\-::update} (
\begin{DoxyParamCaption}
{}
\end{DoxyParamCaption}
)}}\label{classMacroManagerClass_af016c23babface55aa9807159f25d586}


\-Definition at line 114 of file \-Macro\-Manager.\-cpp.



\-References create\-Tech\-Items(), \-B\-W\-A\-P\-I\-::\-Orders\-::get\-Order(), \-Singleton$<$ T $>$\-::\-Instance(), \-Order\-Def\-::\-Macro\-Army\-Production, \-Order\-Def\-::\-Macro\-Can\-Tech, \-Order\-Def\-::\-Macro\-Production\-Facilities, update\-Observer\-Production(), update\-Production\-Production(), update\-Task\-Lists(), update\-Tech(), and update\-Unit\-Production().


\begin{DoxyCode}
{
        updateTaskLists();

        if(BuildOrderManager::Instance().getOrder(Order::MacroArmyProduction))
        {
                updateObserverProduction();
                updateUnitProduction();
        }

        if(BuildOrderManager::Instance().getOrder(
      Order::MacroProductionFacilities))
                updateProductionProduction();

        if(BuildOrderManager::Instance().getOrder(Order::MacroCanTech))
                createTechItems();
        updateTech();

        /*int y = 60;
        for each(std::pair<MacroItem, TaskPointer> item in mTechItems)
        {
                if(item.second->inProgress())
                        BWAPI::Broodwar->drawTextScreen(5, y, "%s : (In
       Progress)", item.first.getDebugInfo().c_str());
                else
                        BWAPI::Broodwar->drawTextScreen(5, y, "%s",
       item.first.getDebugInfo().c_str());

                y += 10;
        }*/
}
\end{DoxyCode}


\-Here is the call graph for this function\-:\nopagebreak
\begin{figure}[H]
\begin{center}
\leavevmode
\includegraphics[width=350pt]{classMacroManagerClass_af016c23babface55aa9807159f25d586_cgraph}
\end{center}
\end{figure}


\hypertarget{classMacroManagerClass_a6e41bb285b1069315d939c70ff121536}{\index{\-Macro\-Manager\-Class@{\-Macro\-Manager\-Class}!update\-Observer\-Production@{update\-Observer\-Production}}
\index{update\-Observer\-Production@{update\-Observer\-Production}!MacroManagerClass@{\-Macro\-Manager\-Class}}
\subsubsection[{update\-Observer\-Production}]{\setlength{\rightskip}{0pt plus 5cm}void {\bf \-Macro\-Manager\-Class\-::update\-Observer\-Production} (
\begin{DoxyParamCaption}
{}
\end{DoxyParamCaption}
)}}\label{classMacroManagerClass_a6e41bb285b1069315d939c70ff121536}


\-Definition at line 375 of file \-Macro\-Manager.\-cpp.



\-References \-Task\-Type\-Def\-::\-Army, \-B\-W\-A\-P\-I\-::\-Broodwar, \-Task\-Type\-Def\-::\-Defense, get\-Planned\-Total(), \-B\-W\-A\-P\-I\-::\-Races\-::get\-Race(), has\-Requirements(), \-Singleton$<$ T $>$\-::\-Instance(), \-Task\-Type\-Def\-::\-Macro\-Urgent, m\-Observer, \-B\-W\-A\-P\-I\-::\-Races\-::\-Protoss, and \-B\-W\-A\-P\-I\-::\-Unit\-Types\-::\-Protoss\-\_\-\-Observer.



\-Referenced by update().


\begin{DoxyCode}
{
        if(BWAPI::Broodwar->self()->getRace() == BWAPI::Races::Protoss)
        {
                if(hasRequirements(BWAPI::UnitTypes::Protoss_Observer))
                {
                        TaskType type = TaskType::Defense;
                        int num = getPlannedTotal(
      BWAPI::UnitTypes::Protoss_Observer);
                        if(num > 3)
                                return;
                        else if(num == 0)
                                type = TaskType::MacroUrgent;
                        else if(num == 1)
                                type = TaskType::Army;

                        // Cancel and recreate if its the wrong type incase it
       was create when we had more but are now low on observers
                        if(!mObserver || mObserver->inProgress() || mObserver->
      hasEnded() || mObserver->getType() != type)
                        {
                                if(mObserver && !mObserver->inProgress())
                                        mObserver->cancel();

                                mObserver = TaskManager::Instance().build(
      BWAPI::UnitTypes::Protoss_Observer, type);
                        }
                }
        }
}
\end{DoxyCode}


\-Here is the call graph for this function\-:\nopagebreak
\begin{figure}[H]
\begin{center}
\leavevmode
\includegraphics[width=350pt]{classMacroManagerClass_a6e41bb285b1069315d939c70ff121536_cgraph}
\end{center}
\end{figure}




\-Here is the caller graph for this function\-:\nopagebreak
\begin{figure}[H]
\begin{center}
\leavevmode
\includegraphics[width=350pt]{classMacroManagerClass_a6e41bb285b1069315d939c70ff121536_icgraph}
\end{center}
\end{figure}


\hypertarget{classMacroManagerClass_abec63b460abb3cabbf8a4f32e9fda1a6}{\index{\-Macro\-Manager\-Class@{\-Macro\-Manager\-Class}!update\-Production\-Production@{update\-Production\-Production}}
\index{update\-Production\-Production@{update\-Production\-Production}!MacroManagerClass@{\-Macro\-Manager\-Class}}
\subsubsection[{update\-Production\-Production}]{\setlength{\rightskip}{0pt plus 5cm}void {\bf \-Macro\-Manager\-Class\-::update\-Production\-Production} (
\begin{DoxyParamCaption}
{}
\end{DoxyParamCaption}
)}}\label{classMacroManagerClass_abec63b460abb3cabbf8a4f32e9fda1a6}


\-Definition at line 402 of file \-Macro\-Manager.\-cpp.



\-References \-Unit\-To\-Produce\-::can\-Build\-Factory(), \-Unit\-To\-Produce\-::get\-Unit\-Type(), has\-Requirements(), \-Singleton$<$ T $>$\-::\-Instance(), \-Task\-Type\-Def\-::\-Macro\-Extra\-Production, m\-Normal\-Units, m\-Tasks\-Per\-Produced\-Type, \-B\-W\-A\-P\-I\-::\-Unit\-Type\-::what\-Builds(), \-B\-W\-A\-P\-I\-::\-Unit\-Types\-::\-Zerg\-\_\-\-Hatchery, and \-B\-W\-A\-P\-I\-::\-Unit\-Types\-::\-Zerg\-\_\-\-Larva.



\-Referenced by update().


\begin{DoxyCode}
{
        for each(UnitToProduce unit in mNormalUnits)
        {
                if(hasRequirements(unit.getUnitType()) && unit.canBuildFactory(
      ))
                {
                        BWAPI::UnitType whatBuilds = unit.getUnitType().
      whatBuilds().first;
                        if(whatBuilds == BWAPI::UnitTypes::Zerg_Larva)
                                whatBuilds = BWAPI::UnitTypes::Zerg_Hatchery;

                        bool unstartedBuild = false;
                        for each(TaskPointer task in mTasksPerProducedType[
      whatBuilds])
                        {
                                if(!task->inProgress())
                                        unstartedBuild = true;
                        }
                        if(unstartedBuild)
                                continue;

                        int idleOfThis = 0;
                        for each(Unit building in UnitTracker::Instance().
      selectAllUnits(whatBuilds))
                        {
                                if(building->isCompleted() && !building->
      isTraining())
                                        ++idleOfThis;
                        }

                        if(idleOfThis == 0)
                                TaskManager::Instance().build(whatBuilds, 
      TaskType::MacroExtraProduction);
                }
        }
}
\end{DoxyCode}


\-Here is the call graph for this function\-:\nopagebreak
\begin{figure}[H]
\begin{center}
\leavevmode
\includegraphics[width=350pt]{classMacroManagerClass_abec63b460abb3cabbf8a4f32e9fda1a6_cgraph}
\end{center}
\end{figure}




\-Here is the caller graph for this function\-:\nopagebreak
\begin{figure}[H]
\begin{center}
\leavevmode
\includegraphics[width=350pt]{classMacroManagerClass_abec63b460abb3cabbf8a4f32e9fda1a6_icgraph}
\end{center}
\end{figure}


\hypertarget{classMacroManagerClass_adf9fbb2facdc8cba448a501e5c2326b4}{\index{\-Macro\-Manager\-Class@{\-Macro\-Manager\-Class}!update\-Task\-Lists@{update\-Task\-Lists}}
\index{update\-Task\-Lists@{update\-Task\-Lists}!MacroManagerClass@{\-Macro\-Manager\-Class}}
\subsubsection[{update\-Task\-Lists}]{\setlength{\rightskip}{0pt plus 5cm}void {\bf \-Macro\-Manager\-Class\-::update\-Task\-Lists} (
\begin{DoxyParamCaption}
{}
\end{DoxyParamCaption}
)}}\label{classMacroManagerClass_adf9fbb2facdc8cba448a501e5c2326b4}


\-Definition at line 635 of file \-Macro\-Manager.\-cpp.



\-References m\-Tasks\-Per\-Produced\-Type, m\-Tasks\-Per\-Production\-Type, m\-Tasks\-Per\-Tech\-Type, m\-Tasks\-Per\-Upgrade\-Type, and m\-Unit\-Produce.



\-Referenced by on\-Change\-Build(), and update().


\begin{DoxyCode}
{
        for(std::list<std::pair<TaskPointer, BWAPI::UnitType>>::iterator it = 
      mUnitProduce.begin(); it != mUnitProduce.end();)
        {
                if(it->first->hasEnded()) mUnitProduce.erase(it++);
                else ++it;
        }

        for(std::map<BWAPI::UnitType, std::list<TaskPointer>>::iterator it = 
      mTasksPerProductionType.begin(); it != mTasksPerProductionType.end(); ++it)
        {
                for(std::list<TaskPointer>::iterator it2 = it->second.begin(); 
      it2 != it->second.end();)
                {
                        if((*it2)->hasEnded()) it->second.erase(it2++);
                        else ++it2;
                }
        }

        for(std::map<BWAPI::UnitType, std::list<TaskPointer>>::iterator it = 
      mTasksPerProducedType.begin(); it != mTasksPerProducedType.end(); ++it)
        {
                for(std::list<TaskPointer>::iterator it2 = it->second.begin(); 
      it2 != it->second.end();)
                {
                        if((*it2)->hasEnded()) it->second.erase(it2++);
                        else ++it2;
                }
        }

        for(std::map<BWAPI::TechType, std::list<TaskPointer>>::iterator it = 
      mTasksPerTechType.begin(); it != mTasksPerTechType.end(); ++it)
        {
                for(std::list<TaskPointer>::iterator it2 = it->second.begin(); 
      it2 != it->second.end();)
                {
                        if((*it2)->hasEnded()) it->second.erase(it2++);
                        else ++it2;
                }
        }

        for(std::map<BWAPI::UpgradeType, std::map<int, std::list<TaskPointer>>>
      ::iterator it = mTasksPerUpgradeType.begin(); it != mTasksPerUpgradeType.end(); 
      ++it)
        {
                for(std::map<int, std::list<TaskPointer>>::iterator it1 = it->
      second.begin(); it1 != it->second.end(); ++it1)
                {
                        for(std::list<TaskPointer>::iterator it2 = it1->second.
      begin(); it2 != it1->second.end();)
                        {
                                if((*it2)->hasEnded()) it1->second.erase(it2++)
      ;
                                else ++it2;
                        }
                }
        }
}
\end{DoxyCode}


\-Here is the caller graph for this function\-:\nopagebreak
\begin{figure}[H]
\begin{center}
\leavevmode
\includegraphics[width=350pt]{classMacroManagerClass_adf9fbb2facdc8cba448a501e5c2326b4_icgraph}
\end{center}
\end{figure}


\hypertarget{classMacroManagerClass_a3f38e0dc6a71681aa3f9a53464630ac6}{\index{\-Macro\-Manager\-Class@{\-Macro\-Manager\-Class}!update\-Tech@{update\-Tech}}
\index{update\-Tech@{update\-Tech}!MacroManagerClass@{\-Macro\-Manager\-Class}}
\subsubsection[{update\-Tech}]{\setlength{\rightskip}{0pt plus 5cm}void {\bf \-Macro\-Manager\-Class\-::update\-Tech} (
\begin{DoxyParamCaption}
{}
\end{DoxyParamCaption}
)}}\label{classMacroManagerClass_a3f38e0dc6a71681aa3f9a53464630ac6}


\-Definition at line 683 of file \-Macro\-Manager.\-cpp.



\-References m\-Tech\-Items.



\-Referenced by update().


\begin{DoxyCode}
{
        for(std::list<std::pair<MacroItem, TaskPointer>>::iterator it = 
      mTechItems.begin(); it != mTechItems.end();)
        {
                // if its ended or something else is creating this, cancel it
       to avoid duplicates
                if(it->second->hasEnded() || (!it->second->inProgress() && it->
      first.inProgress()))
                {
                        it->second->cancel();
                        mTechItems.erase(it++);
                }
                else
                        ++it;
        }
}
\end{DoxyCode}


\-Here is the caller graph for this function\-:\nopagebreak
\begin{figure}[H]
\begin{center}
\leavevmode
\includegraphics[width=350pt]{classMacroManagerClass_a3f38e0dc6a71681aa3f9a53464630ac6_icgraph}
\end{center}
\end{figure}


\hypertarget{classMacroManagerClass_afff725afde83fc0b7595008954a6d98f}{\index{\-Macro\-Manager\-Class@{\-Macro\-Manager\-Class}!update\-Unit\-Production@{update\-Unit\-Production}}
\index{update\-Unit\-Production@{update\-Unit\-Production}!MacroManagerClass@{\-Macro\-Manager\-Class}}
\subsubsection[{update\-Unit\-Production}]{\setlength{\rightskip}{0pt plus 5cm}void {\bf \-Macro\-Manager\-Class\-::update\-Unit\-Production} (
\begin{DoxyParamCaption}
{}
\end{DoxyParamCaption}
)}}\label{classMacroManagerClass_afff725afde83fc0b7595008954a6d98f}


\-Definition at line 143 of file \-Macro\-Manager.\-cpp.



\-References \-Task\-Type\-Def\-::\-Army, \-B\-W\-A\-P\-I\-::\-Broodwar, \-Unit\-To\-Produce\-::get\-Unit\-Type(), \-Unit\-To\-Produce\-::get\-Unit\-Weight(), has\-Requirements(), \-Singleton$<$ T $>$\-::\-Instance(), m\-Low\-Gas\-Units, m\-Low\-Mineral\-Units, m\-Normal\-Units, m\-Tasks\-Per\-Production\-Type, m\-Unit\-Produce, \-B\-W\-A\-P\-I\-::\-Bullet\-Types\-::\-None, \-B\-W\-A\-P\-I\-::\-Unit\-Types\-::\-None, \-B\-W\-A\-P\-I\-::\-Damage\-Types\-::\-Normal, and \-B\-W\-A\-P\-I\-::\-Unit\-Type\-::what\-Builds().



\-Referenced by update().


\begin{DoxyCode}
{
        TrainType trainType = TrainType::Normal;

        int mineral = ResourceTracker::Instance().availableMineralAtTime(
      BWAPI::Broodwar->getFrameCount() + 450);
        int gas = ResourceTracker::Instance().availableGasAtTime(BWAPI::Broodwar
      ->getFrameCount() + 450);

        double LowMineralRatio = gas == 0 ? 1 : double(mineral)/double(gas);
        double LowGasRatio = mineral == 0 ? 1 : double(gas)/double(mineral);

        if(std::max(gas, mineral) > 500)
        {
                if(LowMineralRatio < 0.4)
                        trainType = TrainType::LowMineral;
                else if(LowGasRatio < 0.4)
                        trainType = TrainType::LowGas;
        }

        std::list<UnitToProduce> unitsToProduce;
        if(trainType == TrainType::LowMineral)
                unitsToProduce = mLowMineralUnits;
        else if(trainType == TrainType::LowGas)
                unitsToProduce = mLowGasUnits;
        else if(trainType == TrainType::Normal)
                unitsToProduce = mNormalUnits;

        for(std::list<UnitToProduce>::iterator it = unitsToProduce.begin(); it 
      != unitsToProduce.end();)
        {
                if(!hasRequirements(it->getUnitType()) || !it->canBuildUnit())
                        unitsToProduce.erase(it++);
                else
                        ++it;
        }

        if(trainType != TrainType::Normal)
        {
                std::set<BWAPI::UnitType> unitsWeAreProducing;
                for each(UnitToProduce unit in unitsToProduce)
                {
                        unitsWeAreProducing.insert(unit.getUnitType());
                }

                for(std::list<std::pair<TaskPointer, BWAPI::UnitType>>::
      reverse_iterator  it = mUnitProduce.rbegin(); it != mUnitProduce.rend(); ++it)
                {
                        if(!it->first->inProgress() && unitsWeAreProducing.
      count(it->second) == 0)
                        {
                                it->first->cancel();
                                mUnitProduce.erase( --(it.base()) );
                                break;
                        }
                }
        }

        // cancel and non dispatched unit that is normal but not this type

        std::map<BWAPI::UnitType, int> totalPerProductionBuilding;
        std::map<BWAPI::UnitType, int> UnitTotals;
        std::map<BWAPI::UnitType, std::map<BWAPI::UnitType, int>> 
      UnitToBuilding;
        std::map<BWAPI::UnitType, int> totalWeightPerBuilding;

        // TODO: try to maintain some sort of balance between buildings

        for each(UnitToProduce unit in unitsToProduce)
        {
                int plannedTotalUnit = UnitTracker::Instance().selectAllUnits(
      unit.getUnitType()).size();
                totalPerProductionBuilding[unit.getUnitType().whatBuilds().
      first] += plannedTotalUnit;
                UnitTotals[unit.getUnitType()] += plannedTotalUnit;

                totalWeightPerBuilding[unit.getUnitType().whatBuilds().first] +
      = unit.getUnitWeight();
                UnitToBuilding[unit.getUnitType().whatBuilds().first][unit.
      getUnitType()] = unit.getUnitWeight();
        }

        for each(std::pair<BWAPI::UnitType, int> totalPair in 
      totalPerProductionBuilding)
        {
                int buildings = UnitTracker::Instance().selectAllUnits(
      totalPair.first).size() * 2;
                int queued = mTasksPerProductionType[totalPair.first].size();
                int freeProductionBuildings = buildings - queued;
                if(freeProductionBuildings > 0)
                {
                        BWAPI::UnitType chosenUnit = BWAPI::UnitTypes::None;
                        double biggestDifference = 
      std::numeric_limits<double>::max();
                        for each(std::pair<BWAPI::UnitType, int> producePair in
       UnitToBuilding[totalPair.first])
                        {
                                double neededRatio = double(producePair.second)
       / double(totalWeightPerBuilding[totalPair.first]);
                                double currentRatio = 0;
                                if(totalPair.second != 0)
                                        currentRatio = double(UnitTotals[
      producePair.first]) / double(totalPair.second);

                                double difference = currentRatio - neededRatio;

                                if(difference < biggestDifference)
                                {
                                        biggestDifference = difference;
                                        chosenUnit = producePair.first;
                                }
                        }

                        if(chosenUnit != BWAPI::UnitTypes::None)
                                mUnitProduce.push_back(std::make_pair(
      TaskManager::Instance().build(chosenUnit, TaskType::Army), chosenUnit));

                        freeProductionBuildings--;
                }
        }
}
\end{DoxyCode}


\-Here is the call graph for this function\-:\nopagebreak
\begin{figure}[H]
\begin{center}
\leavevmode
\includegraphics[width=350pt]{classMacroManagerClass_afff725afde83fc0b7595008954a6d98f_cgraph}
\end{center}
\end{figure}




\-Here is the caller graph for this function\-:\nopagebreak
\begin{figure}[H]
\begin{center}
\leavevmode
\includegraphics[width=350pt]{classMacroManagerClass_afff725afde83fc0b7595008954a6d98f_icgraph}
\end{center}
\end{figure}




\subsection{\-Member \-Data \-Documentation}
\hypertarget{classMacroManagerClass_a943a51b58a6ddd520dea60834064d2db}{\index{\-Macro\-Manager\-Class@{\-Macro\-Manager\-Class}!m\-Low\-Gas\-Units@{m\-Low\-Gas\-Units}}
\index{m\-Low\-Gas\-Units@{m\-Low\-Gas\-Units}!MacroManagerClass@{\-Macro\-Manager\-Class}}
\subsubsection[{m\-Low\-Gas\-Units}]{\setlength{\rightskip}{0pt plus 5cm}std\-::list$<${\bf \-Unit\-To\-Produce}$>$ {\bf \-Macro\-Manager\-Class\-::m\-Low\-Gas\-Units}\hspace{0.3cm}{\ttfamily  \mbox{[}private\mbox{]}}}}\label{classMacroManagerClass_a943a51b58a6ddd520dea60834064d2db}


\-Definition at line 119 of file \-Macro\-Manager.\-h.



\-Referenced by on\-Change\-Build(), and update\-Unit\-Production().

\hypertarget{classMacroManagerClass_a0c0f20fb90e3952ff1f8333734c0c27b}{\index{\-Macro\-Manager\-Class@{\-Macro\-Manager\-Class}!m\-Low\-Mineral\-Units@{m\-Low\-Mineral\-Units}}
\index{m\-Low\-Mineral\-Units@{m\-Low\-Mineral\-Units}!MacroManagerClass@{\-Macro\-Manager\-Class}}
\subsubsection[{m\-Low\-Mineral\-Units}]{\setlength{\rightskip}{0pt plus 5cm}std\-::list$<${\bf \-Unit\-To\-Produce}$>$ {\bf \-Macro\-Manager\-Class\-::m\-Low\-Mineral\-Units}\hspace{0.3cm}{\ttfamily  \mbox{[}private\mbox{]}}}}\label{classMacroManagerClass_a0c0f20fb90e3952ff1f8333734c0c27b}


\-Definition at line 120 of file \-Macro\-Manager.\-h.



\-Referenced by on\-Change\-Build(), and update\-Unit\-Production().

\hypertarget{classMacroManagerClass_a79a2e7aabf6ec375b77a3f885895f0a4}{\index{\-Macro\-Manager\-Class@{\-Macro\-Manager\-Class}!m\-Normal\-Units@{m\-Normal\-Units}}
\index{m\-Normal\-Units@{m\-Normal\-Units}!MacroManagerClass@{\-Macro\-Manager\-Class}}
\subsubsection[{m\-Normal\-Units}]{\setlength{\rightskip}{0pt plus 5cm}std\-::list$<${\bf \-Unit\-To\-Produce}$>$ {\bf \-Macro\-Manager\-Class\-::m\-Normal\-Units}\hspace{0.3cm}{\ttfamily  \mbox{[}private\mbox{]}}}}\label{classMacroManagerClass_a79a2e7aabf6ec375b77a3f885895f0a4}


\-Definition at line 118 of file \-Macro\-Manager.\-h.



\-Referenced by on\-Change\-Build(), update\-Production\-Production(), and update\-Unit\-Production().

\hypertarget{classMacroManagerClass_a1a410a9bbc95d11f6092ef0ed0379806}{\index{\-Macro\-Manager\-Class@{\-Macro\-Manager\-Class}!m\-Observer@{m\-Observer}}
\index{m\-Observer@{m\-Observer}!MacroManagerClass@{\-Macro\-Manager\-Class}}
\subsubsection[{m\-Observer}]{\setlength{\rightskip}{0pt plus 5cm}{\bf \-Task\-Pointer} {\bf \-Macro\-Manager\-Class\-::m\-Observer}\hspace{0.3cm}{\ttfamily  \mbox{[}private\mbox{]}}}}\label{classMacroManagerClass_a1a410a9bbc95d11f6092ef0ed0379806}


\-Definition at line 128 of file \-Macro\-Manager.\-h.



\-Referenced by update\-Observer\-Production().

\hypertarget{classMacroManagerClass_aedf869bf50d3738760dee2fb897ed1d1}{\index{\-Macro\-Manager\-Class@{\-Macro\-Manager\-Class}!m\-Tasks\-Per\-Produced\-Type@{m\-Tasks\-Per\-Produced\-Type}}
\index{m\-Tasks\-Per\-Produced\-Type@{m\-Tasks\-Per\-Produced\-Type}!MacroManagerClass@{\-Macro\-Manager\-Class}}
\subsubsection[{m\-Tasks\-Per\-Produced\-Type}]{\setlength{\rightskip}{0pt plus 5cm}std\-::map$<${\bf \-B\-W\-A\-P\-I\-::\-Unit\-Type}, std\-::list$<${\bf \-Task\-Pointer}$>$ $>$ {\bf \-Macro\-Manager\-Class\-::m\-Tasks\-Per\-Produced\-Type}\hspace{0.3cm}{\ttfamily  \mbox{[}private\mbox{]}}}}\label{classMacroManagerClass_aedf869bf50d3738760dee2fb897ed1d1}


\-Definition at line 126 of file \-Macro\-Manager.\-h.



\-Referenced by get\-Planned\-Count(), on\-Build\-Task(), update\-Production\-Production(), and update\-Task\-Lists().

\hypertarget{classMacroManagerClass_aeef56c1e6b7dffb55b6e750f56796806}{\index{\-Macro\-Manager\-Class@{\-Macro\-Manager\-Class}!m\-Tasks\-Per\-Production\-Type@{m\-Tasks\-Per\-Production\-Type}}
\index{m\-Tasks\-Per\-Production\-Type@{m\-Tasks\-Per\-Production\-Type}!MacroManagerClass@{\-Macro\-Manager\-Class}}
\subsubsection[{m\-Tasks\-Per\-Production\-Type}]{\setlength{\rightskip}{0pt plus 5cm}std\-::map$<${\bf \-B\-W\-A\-P\-I\-::\-Unit\-Type}, std\-::list$<${\bf \-Task\-Pointer}$>$ $>$ {\bf \-Macro\-Manager\-Class\-::m\-Tasks\-Per\-Production\-Type}\hspace{0.3cm}{\ttfamily  \mbox{[}private\mbox{]}}}}\label{classMacroManagerClass_aeef56c1e6b7dffb55b6e750f56796806}


\-Definition at line 123 of file \-Macro\-Manager.\-h.



\-Referenced by on\-Build\-Task(), on\-Tech\-Task(), on\-Upgrade\-Task(), update\-Task\-Lists(), and update\-Unit\-Production().

\hypertarget{classMacroManagerClass_a14ce3a61a3a32fb212ddfc17bbebcd42}{\index{\-Macro\-Manager\-Class@{\-Macro\-Manager\-Class}!m\-Tasks\-Per\-Tech\-Type@{m\-Tasks\-Per\-Tech\-Type}}
\index{m\-Tasks\-Per\-Tech\-Type@{m\-Tasks\-Per\-Tech\-Type}!MacroManagerClass@{\-Macro\-Manager\-Class}}
\subsubsection[{m\-Tasks\-Per\-Tech\-Type}]{\setlength{\rightskip}{0pt plus 5cm}std\-::map$<${\bf \-B\-W\-A\-P\-I\-::\-Tech\-Type}, std\-::list$<${\bf \-Task\-Pointer}$>$ $>$ {\bf \-Macro\-Manager\-Class\-::m\-Tasks\-Per\-Tech\-Type}\hspace{0.3cm}{\ttfamily  \mbox{[}private\mbox{]}}}}\label{classMacroManagerClass_a14ce3a61a3a32fb212ddfc17bbebcd42}


\-Definition at line 124 of file \-Macro\-Manager.\-h.



\-Referenced by get\-Planned\-Count(), on\-Tech\-Task(), and update\-Task\-Lists().

\hypertarget{classMacroManagerClass_afc9b436684c9cb39ebc39cc1a6bc13dd}{\index{\-Macro\-Manager\-Class@{\-Macro\-Manager\-Class}!m\-Tasks\-Per\-Upgrade\-Type@{m\-Tasks\-Per\-Upgrade\-Type}}
\index{m\-Tasks\-Per\-Upgrade\-Type@{m\-Tasks\-Per\-Upgrade\-Type}!MacroManagerClass@{\-Macro\-Manager\-Class}}
\subsubsection[{m\-Tasks\-Per\-Upgrade\-Type}]{\setlength{\rightskip}{0pt plus 5cm}std\-::map$<${\bf \-B\-W\-A\-P\-I\-::\-Upgrade\-Type}, std\-::map$<$int, std\-::list$<${\bf \-Task\-Pointer}$>$ $>$ $>$ {\bf \-Macro\-Manager\-Class\-::m\-Tasks\-Per\-Upgrade\-Type}\hspace{0.3cm}{\ttfamily  \mbox{[}private\mbox{]}}}}\label{classMacroManagerClass_afc9b436684c9cb39ebc39cc1a6bc13dd}


\-Definition at line 125 of file \-Macro\-Manager.\-h.



\-Referenced by get\-Planned\-Count(), on\-Upgrade\-Task(), and update\-Task\-Lists().

\hypertarget{classMacroManagerClass_ae1aa2fc444c393d658761a60b46c518a}{\index{\-Macro\-Manager\-Class@{\-Macro\-Manager\-Class}!m\-Tech\-Items@{m\-Tech\-Items}}
\index{m\-Tech\-Items@{m\-Tech\-Items}!MacroManagerClass@{\-Macro\-Manager\-Class}}
\subsubsection[{m\-Tech\-Items}]{\setlength{\rightskip}{0pt plus 5cm}std\-::list$<$std\-::pair$<${\bf \-Macro\-Item}, {\bf \-Task\-Pointer}$>$ $>$ {\bf \-Macro\-Manager\-Class\-::m\-Tech\-Items}\hspace{0.3cm}{\ttfamily  \mbox{[}private\mbox{]}}}}\label{classMacroManagerClass_ae1aa2fc444c393d658761a60b46c518a}


\-Definition at line 131 of file \-Macro\-Manager.\-h.



\-Referenced by create\-Tech\-Items(), on\-Change\-Build(), and update\-Tech().

\hypertarget{classMacroManagerClass_a0b9e3b2fb1b28ef0d574db67a41a5e52}{\index{\-Macro\-Manager\-Class@{\-Macro\-Manager\-Class}!m\-Tech\-Items\-To\-Create@{m\-Tech\-Items\-To\-Create}}
\index{m\-Tech\-Items\-To\-Create@{m\-Tech\-Items\-To\-Create}!MacroManagerClass@{\-Macro\-Manager\-Class}}
\subsubsection[{m\-Tech\-Items\-To\-Create}]{\setlength{\rightskip}{0pt plus 5cm}std\-::list$<${\bf \-Macro\-Item}$>$ {\bf \-Macro\-Manager\-Class\-::m\-Tech\-Items\-To\-Create}\hspace{0.3cm}{\ttfamily  \mbox{[}private\mbox{]}}}}\label{classMacroManagerClass_a0b9e3b2fb1b28ef0d574db67a41a5e52}


\-Definition at line 130 of file \-Macro\-Manager.\-h.



\-Referenced by create\-Tech\-Items(), and on\-Change\-Build().

\hypertarget{classMacroManagerClass_a7a296c7fe9441bcabd4a8acec95049b5}{\index{\-Macro\-Manager\-Class@{\-Macro\-Manager\-Class}!m\-Tech\-Priority\-Map@{m\-Tech\-Priority\-Map}}
\index{m\-Tech\-Priority\-Map@{m\-Tech\-Priority\-Map}!MacroManagerClass@{\-Macro\-Manager\-Class}}
\subsubsection[{m\-Tech\-Priority\-Map}]{\setlength{\rightskip}{0pt plus 5cm}std\-::map$<${\bf \-B\-W\-A\-P\-I\-::\-Tech\-Type}, int$>$ {\bf \-Macro\-Manager\-Class\-::m\-Tech\-Priority\-Map}\hspace{0.3cm}{\ttfamily  \mbox{[}private\mbox{]}}}}\label{classMacroManagerClass_a7a296c7fe9441bcabd4a8acec95049b5}


\-Definition at line 115 of file \-Macro\-Manager.\-h.



\-Referenced by on\-Begin(), and on\-Change\-Build().

\hypertarget{classMacroManagerClass_aa9c7befc367dfcf19cfd2de2050396d1}{\index{\-Macro\-Manager\-Class@{\-Macro\-Manager\-Class}!m\-Unit\-Produce@{m\-Unit\-Produce}}
\index{m\-Unit\-Produce@{m\-Unit\-Produce}!MacroManagerClass@{\-Macro\-Manager\-Class}}
\subsubsection[{m\-Unit\-Produce}]{\setlength{\rightskip}{0pt plus 5cm}std\-::list$<$std\-::pair$<${\bf \-Task\-Pointer}, {\bf \-B\-W\-A\-P\-I\-::\-Unit\-Type}$>$ $>$ {\bf \-Macro\-Manager\-Class\-::m\-Unit\-Produce}\hspace{0.3cm}{\ttfamily  \mbox{[}private\mbox{]}}}}\label{classMacroManagerClass_aa9c7befc367dfcf19cfd2de2050396d1}


\-Definition at line 122 of file \-Macro\-Manager.\-h.



\-Referenced by update\-Task\-Lists(), and update\-Unit\-Production().

\hypertarget{classMacroManagerClass_afe4e1ef75b7007127835c829243178b6}{\index{\-Macro\-Manager\-Class@{\-Macro\-Manager\-Class}!m\-Upgrade\-Priority\-Map@{m\-Upgrade\-Priority\-Map}}
\index{m\-Upgrade\-Priority\-Map@{m\-Upgrade\-Priority\-Map}!MacroManagerClass@{\-Macro\-Manager\-Class}}
\subsubsection[{m\-Upgrade\-Priority\-Map}]{\setlength{\rightskip}{0pt plus 5cm}std\-::map$<${\bf \-B\-W\-A\-P\-I\-::\-Upgrade\-Type}, int$>$ {\bf \-Macro\-Manager\-Class\-::m\-Upgrade\-Priority\-Map}\hspace{0.3cm}{\ttfamily  \mbox{[}private\mbox{]}}}}\label{classMacroManagerClass_afe4e1ef75b7007127835c829243178b6}


\-Definition at line 116 of file \-Macro\-Manager.\-h.



\-Referenced by on\-Begin(), and on\-Change\-Build().



\-The documentation for this class was generated from the following files\-:\begin{DoxyCompactItemize}
\item 
\-Skynet/\-Skynet/\hyperlink{MacroManager_8h}{\-Macro\-Manager.\-h}\item 
\-Skynet/\-Skynet/\hyperlink{MacroManager_8cpp}{\-Macro\-Manager.\-cpp}\end{DoxyCompactItemize}
