\hypertarget{classDropAction}{\section{\-Drop\-Action \-Class \-Reference}
\label{classDropAction}\index{\-Drop\-Action@{\-Drop\-Action}}
}


{\ttfamily \#include $<$\-Drop\-Action.\-h$>$}



\-Inheritance diagram for \-Drop\-Action\-:\nopagebreak
\begin{figure}[H]
\begin{center}
\leavevmode
\includegraphics[height=550pt]{classDropAction__inherit__graph}
\end{center}
\end{figure}


\-Collaboration diagram for \-Drop\-Action\-:\nopagebreak
\begin{figure}[H]
\begin{center}
\leavevmode
\includegraphics[height=550pt]{classDropAction__coll__graph}
\end{center}
\end{figure}
\subsection*{\-Public \-Member \-Functions}
\begin{DoxyCompactItemize}
\item 
\hyperlink{classDropAction_ae561c5c3dd6893f49f4d7e7845e5f244}{\-Drop\-Action} (\hyperlink{Interface_8h_ab8fbb9e601c27f783b69f16c5a1fd40a}{\-Unit} unit)
\item 
bool \hyperlink{classDropAction_aa379d8c022cecc5b2fc3992e568f89b0}{update} (const \hyperlink{classGoal}{\-Goal} \&squad\-Goal, const \hyperlink{classUnitGroup}{\-Unit\-Group} \&squad\-Unit\-Group)
\item 
bool \hyperlink{classDropAction_aa5e3d137b92ec1d9ad57ab32e3d3b319}{has\-Ended} ()
\item 
bool \hyperlink{classDropAction_aeb374f277b94e0058009b8832d8a6cc6}{finished\-With\-A\-Unit} ()
\item 
\hyperlink{classUnitGroup}{\-Unit\-Group} \hyperlink{classDropAction_a886fef6e0edd0f32a46e48ba330a1900}{get\-Finished\-Units} ()
\item 
void \hyperlink{classDropAction_aca737b7244866afde39dc5821da338f1}{remove\-Unit} (\hyperlink{Interface_8h_ab8fbb9e601c27f783b69f16c5a1fd40a}{\-Unit} unit)
\item 
void \hyperlink{classDropAction_a98bbb4d34dc7dab106483d7d8fab684b}{add\-Unit} (\hyperlink{Interface_8h_ab8fbb9e601c27f783b69f16c5a1fd40a}{\-Unit} unit)
\item 
bool \hyperlink{classDropAction_a24e46bf31b47284b36f1d2e6bbdd37ca}{requesting\-Extra\-Units} ()
\item 
std\-::vector$<$ std\-::map\*
$<$ \hyperlink{classBWAPI_1_1UnitType}{\-B\-W\-A\-P\-I\-::\-Unit\-Type}, int $>$ $>$ \hyperlink{classDropAction_a3a670b3948bdd1b50613a55bc0e6f5af}{get\-Requested\-Units} ()
\end{DoxyCompactItemize}
\subsection*{\-Private \-Attributes}
\begin{DoxyCompactItemize}
\item 
\hyperlink{Interface_8h_ab8fbb9e601c27f783b69f16c5a1fd40a}{\-Unit} \hyperlink{classDropAction_aabe0ac06a23f6eb67c3c70883633d0db}{m\-Shuttle}
\item 
int \hyperlink{classDropAction_a827038faaeb1ce1509a6bc7ec039c23f}{m\-Free\-Space}
\end{DoxyCompactItemize}


\subsection{\-Detailed \-Description}


\-Definition at line 6 of file \-Drop\-Action.\-h.



\subsection{\-Constructor \& \-Destructor \-Documentation}
\hypertarget{classDropAction_ae561c5c3dd6893f49f4d7e7845e5f244}{\index{\-Drop\-Action@{\-Drop\-Action}!\-Drop\-Action@{\-Drop\-Action}}
\index{\-Drop\-Action@{\-Drop\-Action}!DropAction@{\-Drop\-Action}}
\subsubsection[{\-Drop\-Action}]{\setlength{\rightskip}{0pt plus 5cm}{\bf \-Drop\-Action\-::\-Drop\-Action} (
\begin{DoxyParamCaption}
\item[{{\bf \-Unit}}]{unit}
\end{DoxyParamCaption}
)\hspace{0.3cm}{\ttfamily  \mbox{[}inline\mbox{]}}}}\label{classDropAction_ae561c5c3dd6893f49f4d7e7845e5f244}


\-Definition at line 9 of file \-Drop\-Action.\-h.


\begin{DoxyCode}
: GroupMicroActionBaseClass(unit), mShuttle(unit), mFreeSpace(mShuttle->getType
      ().spaceProvided()) {}
\end{DoxyCode}


\subsection{\-Member \-Function \-Documentation}
\hypertarget{classDropAction_a98bbb4d34dc7dab106483d7d8fab684b}{\index{\-Drop\-Action@{\-Drop\-Action}!add\-Unit@{add\-Unit}}
\index{add\-Unit@{add\-Unit}!DropAction@{\-Drop\-Action}}
\subsubsection[{add\-Unit}]{\setlength{\rightskip}{0pt plus 5cm}void {\bf \-Drop\-Action\-::add\-Unit} (
\begin{DoxyParamCaption}
\item[{{\bf \-Unit}}]{unit}
\end{DoxyParamCaption}
)\hspace{0.3cm}{\ttfamily  \mbox{[}virtual\mbox{]}}}}\label{classDropAction_a98bbb4d34dc7dab106483d7d8fab684b}


\-Reimplemented from \hyperlink{classGroupMicroActionBaseClass_af7ef06d2c3741764c8dd8de1ede7cac8}{\-Group\-Micro\-Action\-Base\-Class}.



\-Definition at line 18 of file \-Drop\-Action.\-cpp.



\-References \-Unit\-Group\-::insert(), m\-Free\-Space, and \-Group\-Micro\-Action\-Base\-Class\-::m\-Units.


\begin{DoxyCode}
{
        mUnits.insert(unit);

        mFreeSpace -= unit->getType().spaceRequired();
}
\end{DoxyCode}


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


\hypertarget{classDropAction_aeb374f277b94e0058009b8832d8a6cc6}{\index{\-Drop\-Action@{\-Drop\-Action}!finished\-With\-A\-Unit@{finished\-With\-A\-Unit}}
\index{finished\-With\-A\-Unit@{finished\-With\-A\-Unit}!DropAction@{\-Drop\-Action}}
\subsubsection[{finished\-With\-A\-Unit}]{\setlength{\rightskip}{0pt plus 5cm}bool {\bf \-Drop\-Action\-::finished\-With\-A\-Unit} (
\begin{DoxyParamCaption}
{}
\end{DoxyParamCaption}
)\hspace{0.3cm}{\ttfamily  \mbox{[}virtual\mbox{]}}}}\label{classDropAction_aeb374f277b94e0058009b8832d8a6cc6}


\-Reimplemented from \hyperlink{classGroupMicroActionBaseClass_a73937469414ab133fd34b6a222d607a8}{\-Group\-Micro\-Action\-Base\-Class}.



\-Definition at line 65 of file \-Drop\-Action.\-cpp.


\begin{DoxyCode}
{
        return false;
}
\end{DoxyCode}
\hypertarget{classDropAction_a886fef6e0edd0f32a46e48ba330a1900}{\index{\-Drop\-Action@{\-Drop\-Action}!get\-Finished\-Units@{get\-Finished\-Units}}
\index{get\-Finished\-Units@{get\-Finished\-Units}!DropAction@{\-Drop\-Action}}
\subsubsection[{get\-Finished\-Units}]{\setlength{\rightskip}{0pt plus 5cm}{\bf \-Unit\-Group} {\bf \-Drop\-Action\-::get\-Finished\-Units} (
\begin{DoxyParamCaption}
{}
\end{DoxyParamCaption}
)\hspace{0.3cm}{\ttfamily  \mbox{[}virtual\mbox{]}}}}\label{classDropAction_a886fef6e0edd0f32a46e48ba330a1900}


\-Reimplemented from \hyperlink{classGroupMicroActionBaseClass_a3e6a363c97bd0b6ee8fd29311f1d73ff}{\-Group\-Micro\-Action\-Base\-Class}.



\-Definition at line 70 of file \-Drop\-Action.\-cpp.


\begin{DoxyCode}
{
        return UnitGroup();
}\end{DoxyCode}
\hypertarget{classDropAction_a3a670b3948bdd1b50613a55bc0e6f5af}{\index{\-Drop\-Action@{\-Drop\-Action}!get\-Requested\-Units@{get\-Requested\-Units}}
\index{get\-Requested\-Units@{get\-Requested\-Units}!DropAction@{\-Drop\-Action}}
\subsubsection[{get\-Requested\-Units}]{\setlength{\rightskip}{0pt plus 5cm}std\-::vector$<$ std\-::map$<$ {\bf \-B\-W\-A\-P\-I\-::\-Unit\-Type}, int $>$ $>$ {\bf \-Drop\-Action\-::get\-Requested\-Units} (
\begin{DoxyParamCaption}
{}
\end{DoxyParamCaption}
)\hspace{0.3cm}{\ttfamily  \mbox{[}virtual\mbox{]}}}}\label{classDropAction_a3a670b3948bdd1b50613a55bc0e6f5af}


\-Reimplemented from \hyperlink{classGroupMicroActionBaseClass_a4d05e6e1078a20da2948f148b112428e}{\-Group\-Micro\-Action\-Base\-Class}.



\-Definition at line 30 of file \-Drop\-Action.\-cpp.



\-References m\-Free\-Space, \-B\-W\-A\-P\-I\-::\-Unit\-Types\-::\-Protoss\-\_\-\-Reaver, \-B\-W\-A\-P\-I\-::\-Unit\-Types\-::\-Protoss\-\_\-\-Zealot, and \-B\-W\-A\-P\-I\-::\-Unit\-Type\-::space\-Required().


\begin{DoxyCode}
{
        std::vector<std::map<BWAPI::UnitType, int>> returnData;

        int maxNumOfBig = mFreeSpace / BWAPI::UnitTypes::Protoss_Reaver.
      spaceRequired();
        int maxNumOfSmall = mFreeSpace / BWAPI::UnitTypes::Protoss_Zealot.
      spaceRequired();

        int currentBig = maxNumOfBig;
        int currentSmall = 0;

        for(;;)
        {
                std::map<BWAPI::UnitType, int> currentData;

                currentData[BWAPI::UnitTypes::Protoss_Reaver] = currentBig;
                currentData[BWAPI::UnitTypes::Protoss_Zealot] = currentSmall;

                int spaceForSmall = mFreeSpace;
                spaceForSmall -= currentBig * BWAPI::UnitTypes::Protoss_Reaver.
      spaceRequired();
                spaceForSmall -= currentBig * BWAPI::UnitTypes::Protoss_Zealot.
      spaceRequired();

                if(spaceForSmall >= BWAPI::UnitTypes::Protoss_Zealot.
      spaceRequired())
                        ++currentSmall;
                else if(currentBig == 0)
                        break;
                else
                {
                        currentSmall = 0;
                        --currentBig;
                }
        }

        return returnData;
}
\end{DoxyCode}


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


\hypertarget{classDropAction_aa5e3d137b92ec1d9ad57ab32e3d3b319}{\index{\-Drop\-Action@{\-Drop\-Action}!has\-Ended@{has\-Ended}}
\index{has\-Ended@{has\-Ended}!DropAction@{\-Drop\-Action}}
\subsubsection[{has\-Ended}]{\setlength{\rightskip}{0pt plus 5cm}bool {\bf \-Drop\-Action\-::has\-Ended} (
\begin{DoxyParamCaption}
{}
\end{DoxyParamCaption}
)\hspace{0.3cm}{\ttfamily  \mbox{[}inline, virtual\mbox{]}}}}\label{classDropAction_aa5e3d137b92ec1d9ad57ab32e3d3b319}


\-Reimplemented from \hyperlink{classGroupMicroActionBaseClass_a3b4622238cdbc765a77a8a70b573e135}{\-Group\-Micro\-Action\-Base\-Class}.



\-Definition at line 12 of file \-Drop\-Action.\-h.



\-References m\-Shuttle.


\begin{DoxyCode}
{ return !mShuttle; }
\end{DoxyCode}
\hypertarget{classDropAction_aca737b7244866afde39dc5821da338f1}{\index{\-Drop\-Action@{\-Drop\-Action}!remove\-Unit@{remove\-Unit}}
\index{remove\-Unit@{remove\-Unit}!DropAction@{\-Drop\-Action}}
\subsubsection[{remove\-Unit}]{\setlength{\rightskip}{0pt plus 5cm}void {\bf \-Drop\-Action\-::remove\-Unit} (
\begin{DoxyParamCaption}
\item[{{\bf \-Unit}}]{unit}
\end{DoxyParamCaption}
)\hspace{0.3cm}{\ttfamily  \mbox{[}virtual\mbox{]}}}}\label{classDropAction_aca737b7244866afde39dc5821da338f1}


\-Reimplemented from \hyperlink{classGroupMicroActionBaseClass_adc97303ce5b6e129d5440408efcc9931}{\-Group\-Micro\-Action\-Base\-Class}.



\-Definition at line 8 of file \-Drop\-Action.\-cpp.



\-References \-Unit\-Group\-::erase(), m\-Free\-Space, m\-Shuttle, \-Group\-Micro\-Action\-Base\-Class\-::m\-Units, and \-Static\-Units\-::nullunit.


\begin{DoxyCode}
{
        mUnits.erase(unit);

        if(unit != mShuttle)
                mFreeSpace += unit->getType().spaceRequired();
        else
                mShuttle = StaticUnits::nullunit;
}
\end{DoxyCode}


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


\hypertarget{classDropAction_a24e46bf31b47284b36f1d2e6bbdd37ca}{\index{\-Drop\-Action@{\-Drop\-Action}!requesting\-Extra\-Units@{requesting\-Extra\-Units}}
\index{requesting\-Extra\-Units@{requesting\-Extra\-Units}!DropAction@{\-Drop\-Action}}
\subsubsection[{requesting\-Extra\-Units}]{\setlength{\rightskip}{0pt plus 5cm}bool {\bf \-Drop\-Action\-::requesting\-Extra\-Units} (
\begin{DoxyParamCaption}
{}
\end{DoxyParamCaption}
)\hspace{0.3cm}{\ttfamily  \mbox{[}virtual\mbox{]}}}}\label{classDropAction_a24e46bf31b47284b36f1d2e6bbdd37ca}


\-Reimplemented from \hyperlink{classGroupMicroActionBaseClass_a29a028e93091cc82dfeaec707a598596}{\-Group\-Micro\-Action\-Base\-Class}.



\-Definition at line 25 of file \-Drop\-Action.\-cpp.



\-References m\-Free\-Space.


\begin{DoxyCode}
{
        return mFreeSpace > 0;
}
\end{DoxyCode}
\hypertarget{classDropAction_aa379d8c022cecc5b2fc3992e568f89b0}{\index{\-Drop\-Action@{\-Drop\-Action}!update@{update}}
\index{update@{update}!DropAction@{\-Drop\-Action}}
\subsubsection[{update}]{\setlength{\rightskip}{0pt plus 5cm}bool {\bf \-Drop\-Action\-::update} (
\begin{DoxyParamCaption}
\item[{const {\bf \-Goal} \&}]{squad\-Goal, }
\item[{const {\bf \-Unit\-Group} \&}]{squad\-Unit\-Group}
\end{DoxyParamCaption}
)\hspace{0.3cm}{\ttfamily  \mbox{[}virtual\mbox{]}}}}\label{classDropAction_aa379d8c022cecc5b2fc3992e568f89b0}


\-Implements \hyperlink{classGroupMicroActionBaseClass_aec053b42b11b2e47d9911abdb7266a85}{\-Group\-Micro\-Action\-Base\-Class}.



\-Definition at line 3 of file \-Drop\-Action.\-cpp.


\begin{DoxyCode}
{
        return false;
}
\end{DoxyCode}


\subsection{\-Member \-Data \-Documentation}
\hypertarget{classDropAction_a827038faaeb1ce1509a6bc7ec039c23f}{\index{\-Drop\-Action@{\-Drop\-Action}!m\-Free\-Space@{m\-Free\-Space}}
\index{m\-Free\-Space@{m\-Free\-Space}!DropAction@{\-Drop\-Action}}
\subsubsection[{m\-Free\-Space}]{\setlength{\rightskip}{0pt plus 5cm}int {\bf \-Drop\-Action\-::m\-Free\-Space}\hspace{0.3cm}{\ttfamily  \mbox{[}private\mbox{]}}}}\label{classDropAction_a827038faaeb1ce1509a6bc7ec039c23f}


\-Definition at line 25 of file \-Drop\-Action.\-h.



\-Referenced by add\-Unit(), get\-Requested\-Units(), remove\-Unit(), and requesting\-Extra\-Units().

\hypertarget{classDropAction_aabe0ac06a23f6eb67c3c70883633d0db}{\index{\-Drop\-Action@{\-Drop\-Action}!m\-Shuttle@{m\-Shuttle}}
\index{m\-Shuttle@{m\-Shuttle}!DropAction@{\-Drop\-Action}}
\subsubsection[{m\-Shuttle}]{\setlength{\rightskip}{0pt plus 5cm}{\bf \-Unit} {\bf \-Drop\-Action\-::m\-Shuttle}\hspace{0.3cm}{\ttfamily  \mbox{[}private\mbox{]}}}}\label{classDropAction_aabe0ac06a23f6eb67c3c70883633d0db}


\-Definition at line 23 of file \-Drop\-Action.\-h.



\-Referenced by has\-Ended(), and remove\-Unit().



\-The documentation for this class was generated from the following files\-:\begin{DoxyCompactItemize}
\item 
\-Skynet/\-Skynet/\hyperlink{DropAction_8h}{\-Drop\-Action.\-h}\item 
\-Skynet/\-Skynet/\hyperlink{DropAction_8cpp}{\-Drop\-Action.\-cpp}\end{DoxyCompactItemize}
