\hypertarget{classSupplyManagerClass}{\section{\-Supply\-Manager\-Class \-Class \-Reference}
\label{classSupplyManagerClass}\index{\-Supply\-Manager\-Class@{\-Supply\-Manager\-Class}}
}


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

\subsection*{\-Public \-Member \-Functions}
\begin{DoxyCompactItemize}
\item 
\hyperlink{classSupplyManagerClass_a0ca5c0740352067dd158fad87b87ae53}{\-Supply\-Manager\-Class} ()
\item 
void \hyperlink{classSupplyManagerClass_a3eeac3b41f109c4d0808f852ac01f59b}{update} ()
\end{DoxyCompactItemize}
\subsection*{\-Private \-Attributes}
\begin{DoxyCompactItemize}
\item 
\hyperlink{Requirement_8h_a10d9e68ef4957f6a76bc93eb32bf2670}{\-Task\-Pointer} \hyperlink{classSupplyManagerClass_abdb7e97d87282c800122383962b92064}{m\-Last\-Item}
\end{DoxyCompactItemize}


\subsection{\-Detailed \-Description}


\-Definition at line 8 of file \-Supply\-Manager.\-h.



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


\-Definition at line 11 of file \-Supply\-Manager.\-h.


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


\subsection{\-Member \-Function \-Documentation}
\hypertarget{classSupplyManagerClass_a3eeac3b41f109c4d0808f852ac01f59b}{\index{\-Supply\-Manager\-Class@{\-Supply\-Manager\-Class}!update@{update}}
\index{update@{update}!SupplyManagerClass@{\-Supply\-Manager\-Class}}
\subsubsection[{update}]{\setlength{\rightskip}{0pt plus 5cm}void {\bf \-Supply\-Manager\-Class\-::update} (
\begin{DoxyParamCaption}
{}
\end{DoxyParamCaption}
)}}\label{classSupplyManagerClass_a3eeac3b41f109c4d0808f852ac01f59b}


\-Definition at line 7 of file \-Supply\-Manager.\-cpp.



\-References \-B\-W\-A\-P\-I\-::\-Broodwar, \-B\-W\-A\-P\-I\-::\-Unit\-Type\-::build\-Time(), \-B\-W\-A\-P\-I\-::\-Game\-::get\-Frame\-Count(), \-B\-W\-A\-P\-I\-::\-Orders\-::get\-Order(), \-B\-W\-A\-P\-I\-::\-Player\-::get\-Race(), \-B\-W\-A\-P\-I\-::\-Races\-::get\-Race(), \-B\-W\-A\-P\-I\-::\-Race\-::get\-Supply\-Provider(), \-Singleton$<$ T $>$\-::\-Instance(), m\-Last\-Item, \-B\-W\-A\-P\-I\-::\-Game\-::self(), \-Task\-Type\-Def\-::\-Supply, \-Order\-Def\-::\-Supply\-Manager, and \-B\-W\-A\-P\-I\-::\-Player\-::supply\-Used().


\begin{DoxyCode}
{
        if(!BuildOrderManager::Instance().getOrder(Order::SupplyManager))
                return;

        const int &supplyTime = BWAPI::Broodwar->getFrameCount() + 
      BWAPI::Broodwar->self()->getRace().getSupplyProvider().buildTime() + 150;
        if(ResourceTracker::Instance().totalSupplyAtTime(supplyTime) < 400)
        {
                const int currentSupply = BWAPI::Broodwar->self()->supplyUsed()
      ;
                const int &freeSupply = ResourceTracker::Instance().
      availableSupplyAtTime(supplyTime);
                if(freeSupply <= (currentSupply > 120 ? 16 : currentSupply > 60
       ? 8 : 0))
                {
                        if(!mLastItem || mLastItem->hasDispatched() || mLastItem
      ->hasEnded())
                                mLastItem = TaskManager::Instance().build(
      BWAPI::Broodwar->self()->getRace().getSupplyProvider(), TaskType::Supply);
                }
        }
}
\end{DoxyCode}


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




\subsection{\-Member \-Data \-Documentation}
\hypertarget{classSupplyManagerClass_abdb7e97d87282c800122383962b92064}{\index{\-Supply\-Manager\-Class@{\-Supply\-Manager\-Class}!m\-Last\-Item@{m\-Last\-Item}}
\index{m\-Last\-Item@{m\-Last\-Item}!SupplyManagerClass@{\-Supply\-Manager\-Class}}
\subsubsection[{m\-Last\-Item}]{\setlength{\rightskip}{0pt plus 5cm}{\bf \-Task\-Pointer} {\bf \-Supply\-Manager\-Class\-::m\-Last\-Item}\hspace{0.3cm}{\ttfamily  \mbox{[}private\mbox{]}}}}\label{classSupplyManagerClass_abdb7e97d87282c800122383962b92064}


\-Definition at line 16 of file \-Supply\-Manager.\-h.



\-Referenced by update().



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