\hypertarget{classArconZealotKillUnDetected}{\section{\-Arcon\-Zealot\-Kill\-Un\-Detected \-Class \-Reference}
\label{classArconZealotKillUnDetected}\index{\-Arcon\-Zealot\-Kill\-Un\-Detected@{\-Arcon\-Zealot\-Kill\-Un\-Detected}}
}


{\ttfamily \#include $<$\-Arcon\-Zealot\-Kill\-Un\-Detected.\-h$>$}



\-Inheritance diagram for \-Arcon\-Zealot\-Kill\-Un\-Detected\-:\nopagebreak
\begin{figure}[H]
\begin{center}
\leavevmode
\includegraphics[width=238pt]{classArconZealotKillUnDetected__inherit__graph}
\end{center}
\end{figure}


\-Collaboration diagram for \-Arcon\-Zealot\-Kill\-Un\-Detected\-:\nopagebreak
\begin{figure}[H]
\begin{center}
\leavevmode
\includegraphics[width=238pt]{classArconZealotKillUnDetected__coll__graph}
\end{center}
\end{figure}
\subsection*{\-Public \-Member \-Functions}
\begin{DoxyCompactItemize}
\item 
\hyperlink{classArconZealotKillUnDetected_a224d1aa5b108636dad572c4791f65c50}{\-Arcon\-Zealot\-Kill\-Un\-Detected} (\hyperlink{Interface_8h_ab8fbb9e601c27f783b69f16c5a1fd40a}{\-Unit} unit)
\item 
bool \hyperlink{classArconZealotKillUnDetected_a894f720d193baf5e0e278dfb2f7ea938}{update} (const \hyperlink{classGoal}{\-Goal} \&squad\-Goal, const \hyperlink{classUnitGroup}{\-Unit\-Group} \&squad\-Unit\-Group)
\end{DoxyCompactItemize}


\subsection{\-Detailed \-Description}


\-Definition at line 6 of file \-Arcon\-Zealot\-Kill\-Un\-Detected.\-h.



\subsection{\-Constructor \& \-Destructor \-Documentation}
\hypertarget{classArconZealotKillUnDetected_a224d1aa5b108636dad572c4791f65c50}{\index{\-Arcon\-Zealot\-Kill\-Un\-Detected@{\-Arcon\-Zealot\-Kill\-Un\-Detected}!\-Arcon\-Zealot\-Kill\-Un\-Detected@{\-Arcon\-Zealot\-Kill\-Un\-Detected}}
\index{\-Arcon\-Zealot\-Kill\-Un\-Detected@{\-Arcon\-Zealot\-Kill\-Un\-Detected}!ArconZealotKillUnDetected@{\-Arcon\-Zealot\-Kill\-Un\-Detected}}
\subsubsection[{\-Arcon\-Zealot\-Kill\-Un\-Detected}]{\setlength{\rightskip}{0pt plus 5cm}{\bf \-Arcon\-Zealot\-Kill\-Un\-Detected\-::\-Arcon\-Zealot\-Kill\-Un\-Detected} (
\begin{DoxyParamCaption}
\item[{{\bf \-Unit}}]{unit}
\end{DoxyParamCaption}
)\hspace{0.3cm}{\ttfamily  \mbox{[}inline\mbox{]}}}}\label{classArconZealotKillUnDetected_a224d1aa5b108636dad572c4791f65c50}


\-Definition at line 9 of file \-Arcon\-Zealot\-Kill\-Un\-Detected.\-h.


\begin{DoxyCode}
: SingleMicroActionBaseClass(unit) {}
\end{DoxyCode}


\subsection{\-Member \-Function \-Documentation}
\hypertarget{classArconZealotKillUnDetected_a894f720d193baf5e0e278dfb2f7ea938}{\index{\-Arcon\-Zealot\-Kill\-Un\-Detected@{\-Arcon\-Zealot\-Kill\-Un\-Detected}!update@{update}}
\index{update@{update}!ArconZealotKillUnDetected@{\-Arcon\-Zealot\-Kill\-Un\-Detected}}
\subsubsection[{update}]{\setlength{\rightskip}{0pt plus 5cm}bool {\bf \-Arcon\-Zealot\-Kill\-Un\-Detected\-::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{classArconZealotKillUnDetected_a894f720d193baf5e0e278dfb2f7ea938}


\-Implements \hyperlink{classSingleMicroActionBaseClass_aecc4881945144ca283aaf4dfd9397a4f}{\-Single\-Micro\-Action\-Base\-Class}.



\-Definition at line 8 of file \-Arcon\-Zealot\-Kill\-Un\-Detected.\-cpp.



\-References \-B\-W\-A\-P\-I\-::\-Orders\-::\-Completing\-Archonsummon, \-Singleton$<$ T $>$\-::\-Instance(), \-Single\-Micro\-Action\-Base\-Class\-::m\-Unit, \-B\-W\-A\-P\-I\-::\-Unit\-Types\-::\-Protoss\-\_\-\-Archon, \-B\-W\-A\-P\-I\-::\-Unit\-Types\-::\-Protoss\-\_\-\-Zealot, and \-B\-W\-A\-P\-I\-::\-Unit\-Types\-::\-Zerg\-\_\-\-Lurker.


\begin{DoxyCode}
{
        if(mUnit->getOrder() == BWAPI::Orders::CompletingArchonsummon)
                return true;

        const int minDistance = 32*5;

        Unit lurker;
        int lurkerDistance = std::numeric_limits<int>::max();
        for each(Unit unit in UnitTracker::Instance().selectAllEnemy())
        {
                if(unit->exists() && !unit->isDetected() && (unit->isCloaked() 
      || unit->getType().hasPermanentCloak() || (unit->getType() == 
      BWAPI::UnitTypes::Zerg_Lurker && unit->isBurrowed())))
                {
                        int thisDistance = mUnit->getDistance(unit);
                        if(thisDistance < lurkerDistance)
                        {
                                lurkerDistance = thisDistance;
                                lurker = unit;
                        }
                }
        }

        if(!lurker || lurkerDistance > minDistance)
                return false;

        BWAPI::UnitType typeToFind = mUnit->getType() == 
      BWAPI::UnitTypes::Protoss_Archon ? BWAPI::UnitTypes::Protoss_Zealot : 
      BWAPI::UnitTypes::Protoss_Archon;
        Unit other = UnitTracker::Instance().selectAllUnits(typeToFind).
      getClosestUnit(lurker);

        if(!other)
                return false;

        int otherDistance = other->getDistance(lurker);
        if(otherDistance > minDistance)
                return false;

        if(typeToFind == BWAPI::UnitTypes::Protoss_Archon)
        {
                if(mUnit != UnitTracker::Instance().selectAllUnits(
      BWAPI::UnitTypes::Protoss_Zealot).getClosestUnit(lurker))
                        return false;

                mUnit->move(lurker->getPosition());
                return true;
        }
        else
        {
                if(otherDistance <= 14)
                {
                        mUnit->attack(other);
                        return true;
                }
                else
                {
                        mUnit->move(other->getPosition());
                        return true;
                }
        }

        return false;
}\end{DoxyCode}


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




\-The documentation for this class was generated from the following files\-:\begin{DoxyCompactItemize}
\item 
\-Skynet/\-Skynet/\hyperlink{ArconZealotKillUnDetected_8h}{\-Arcon\-Zealot\-Kill\-Un\-Detected.\-h}\item 
\-Skynet/\-Skynet/\hyperlink{ArconZealotKillUnDetected_8cpp}{\-Arcon\-Zealot\-Kill\-Un\-Detected.\-cpp}\end{DoxyCompactItemize}
