\hypertarget{classAOEThreatClass}{\section{\-A\-O\-E\-Threat\-Class \-Class \-Reference}
\label{classAOEThreatClass}\index{\-A\-O\-E\-Threat\-Class@{\-A\-O\-E\-Threat\-Class}}
}


{\ttfamily \#include $<$\-A\-O\-E\-Threat.\-h$>$}



\-Collaboration diagram for \-A\-O\-E\-Threat\-Class\-:\nopagebreak
\begin{figure}[H]
\begin{center}
\leavevmode
\includegraphics[height=550pt]{classAOEThreatClass__coll__graph}
\end{center}
\end{figure}
\subsection*{\-Public \-Member \-Functions}
\begin{DoxyCompactItemize}
\item 
\hyperlink{classAOEThreatClass_a0f975109d5bc3338a2e9ffe40fa0fb55}{\-A\-O\-E\-Threat\-Class} (\hyperlink{Interface_8h_ab8fbb9e601c27f783b69f16c5a1fd40a}{\-Unit} unit)
\item 
\hyperlink{classAOEThreatClass_ac7ce7def184a17f0f54712461fef3bfd}{\-A\-O\-E\-Threat\-Class} (\hyperlink{classBWAPI_1_1Bullet}{\-B\-W\-A\-P\-I\-::\-Bullet} $\ast$bullet)
\item 
bool \hyperlink{classAOEThreatClass_a1a8c24553e8a10c3295a166453382010}{has\-Gone} () const 
\item 
\hyperlink{Interface_8h_a7ae5d695cf6b7c013c5ad30d124278e0}{\-Position} \hyperlink{classAOEThreatClass_ab37dd493f8bb38e0f041a2ae9ebfa9d5}{get\-Position} () const 
\item 
int \hyperlink{classAOEThreatClass_abde3682966871d6024663dfbe70dd285}{get\-Radius} () const 
\item 
\hyperlink{Interface_8h_ab8fbb9e601c27f783b69f16c5a1fd40a}{\-Unit} \hyperlink{classAOEThreatClass_af459954d240e5f7d86e96707dd8f210e}{get\-Target} () const 
\item 
bool \hyperlink{classAOEThreatClass_aaf554675db137b86f2cc8bf6c90586c8}{is\-Air\-Threat} () const 
\item 
bool \hyperlink{classAOEThreatClass_a3f12e13e12f215515e142297e2cad95e}{is\-Ground\-Threat} () const 
\item 
bool \hyperlink{classAOEThreatClass_a382f4fbe22f49816f94d63732ae74766}{is\-Energy\-Threat} () const 
\item 
void \hyperlink{classAOEThreatClass_aace8aac2cd8861addbc0b5be99e69340}{draw} () const 
\end{DoxyCompactItemize}
\subsection*{\-Private \-Attributes}
\begin{DoxyCompactItemize}
\item 
\hyperlink{Interface_8h_ab8fbb9e601c27f783b69f16c5a1fd40a}{\-Unit} \hyperlink{classAOEThreatClass_ad7574e3a668d72b0418eb119fe6606b2}{m\-Unit}
\item 
\hyperlink{classBWAPI_1_1Bullet}{\-B\-W\-A\-P\-I\-::\-Bullet} $\ast$ \hyperlink{classAOEThreatClass_ab7aa5f4c9a2296a28dd045139acce76a}{m\-Bullet}
\end{DoxyCompactItemize}


\subsection{\-Detailed \-Description}


\-Definition at line 5 of file \-A\-O\-E\-Threat.\-h.



\subsection{\-Constructor \& \-Destructor \-Documentation}
\hypertarget{classAOEThreatClass_a0f975109d5bc3338a2e9ffe40fa0fb55}{\index{\-A\-O\-E\-Threat\-Class@{\-A\-O\-E\-Threat\-Class}!\-A\-O\-E\-Threat\-Class@{\-A\-O\-E\-Threat\-Class}}
\index{\-A\-O\-E\-Threat\-Class@{\-A\-O\-E\-Threat\-Class}!AOEThreatClass@{\-A\-O\-E\-Threat\-Class}}
\subsubsection[{\-A\-O\-E\-Threat\-Class}]{\setlength{\rightskip}{0pt plus 5cm}{\bf \-A\-O\-E\-Threat\-Class\-::\-A\-O\-E\-Threat\-Class} (
\begin{DoxyParamCaption}
\item[{{\bf \-Unit}}]{unit}
\end{DoxyParamCaption}
)}}\label{classAOEThreatClass_a0f975109d5bc3338a2e9ffe40fa0fb55}


\-Definition at line 3 of file \-A\-O\-E\-Threat.\-cpp.


\begin{DoxyCode}
        : mUnit(unit)
        , mBullet(NULL)
{
}
\end{DoxyCode}
\hypertarget{classAOEThreatClass_ac7ce7def184a17f0f54712461fef3bfd}{\index{\-A\-O\-E\-Threat\-Class@{\-A\-O\-E\-Threat\-Class}!\-A\-O\-E\-Threat\-Class@{\-A\-O\-E\-Threat\-Class}}
\index{\-A\-O\-E\-Threat\-Class@{\-A\-O\-E\-Threat\-Class}!AOEThreatClass@{\-A\-O\-E\-Threat\-Class}}
\subsubsection[{\-A\-O\-E\-Threat\-Class}]{\setlength{\rightskip}{0pt plus 5cm}{\bf \-A\-O\-E\-Threat\-Class\-::\-A\-O\-E\-Threat\-Class} (
\begin{DoxyParamCaption}
\item[{{\bf \-B\-W\-A\-P\-I\-::\-Bullet} $\ast$}]{bullet}
\end{DoxyParamCaption}
)}}\label{classAOEThreatClass_ac7ce7def184a17f0f54712461fef3bfd}


\-Definition at line 9 of file \-A\-O\-E\-Threat.\-cpp.


\begin{DoxyCode}
        : mUnit()
        , mBullet(bullet)
{
}
\end{DoxyCode}


\subsection{\-Member \-Function \-Documentation}
\hypertarget{classAOEThreatClass_aace8aac2cd8861addbc0b5be99e69340}{\index{\-A\-O\-E\-Threat\-Class@{\-A\-O\-E\-Threat\-Class}!draw@{draw}}
\index{draw@{draw}!AOEThreatClass@{\-A\-O\-E\-Threat\-Class}}
\subsubsection[{draw}]{\setlength{\rightskip}{0pt plus 5cm}void {\bf \-A\-O\-E\-Threat\-Class\-::draw} (
\begin{DoxyParamCaption}
{}
\end{DoxyParamCaption}
) const}}\label{classAOEThreatClass_aace8aac2cd8861addbc0b5be99e69340}


\-Definition at line 81 of file \-A\-O\-E\-Threat.\-cpp.



\-References \-B\-W\-A\-P\-I\-::\-Broodwar, \-B\-W\-A\-P\-I\-::\-Game\-::draw\-Circle\-Map(), get\-Position(), get\-Radius(), \-B\-W\-A\-P\-I\-::\-Colors\-::\-Red, \-B\-W\-A\-P\-I\-::\-Position\-::x(), and \-B\-W\-A\-P\-I\-::\-Position\-::y().


\begin{DoxyCode}
{
        const Position &pos = getPosition();
        BWAPI::Broodwar->drawCircleMap(pos.x(), pos.y(), getRadius(), 
      BWAPI::Colors::Red);
}
\end{DoxyCode}


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


\hypertarget{classAOEThreatClass_ab37dd493f8bb38e0f041a2ae9ebfa9d5}{\index{\-A\-O\-E\-Threat\-Class@{\-A\-O\-E\-Threat\-Class}!get\-Position@{get\-Position}}
\index{get\-Position@{get\-Position}!AOEThreatClass@{\-A\-O\-E\-Threat\-Class}}
\subsubsection[{get\-Position}]{\setlength{\rightskip}{0pt plus 5cm}{\bf \-Position} {\bf \-A\-O\-E\-Threat\-Class\-::get\-Position} (
\begin{DoxyParamCaption}
{}
\end{DoxyParamCaption}
) const}}\label{classAOEThreatClass_ab37dd493f8bb38e0f041a2ae9ebfa9d5}


\-Definition at line 20 of file \-A\-O\-E\-Threat.\-cpp.



\-References \-B\-W\-A\-P\-I\-::\-Bullet\-Types\-::\-E\-M\-P\-\_\-\-Missile, \-B\-W\-A\-P\-I\-::\-Bullet\-::exists(), \-B\-W\-A\-P\-I\-::\-Bullet\-::get\-Position(), \-B\-W\-A\-P\-I\-::\-Bullet\-::get\-Target\-Position(), \-B\-W\-A\-P\-I\-::\-Bullet\-::get\-Type(), \-B\-W\-A\-P\-I\-::\-Positions\-::\-Invalid, m\-Bullet, m\-Unit, \-B\-W\-A\-P\-I\-::\-Unit\-Types\-::\-Protoss\-\_\-\-Scarab, \-B\-W\-A\-P\-I\-::\-Bullet\-Types\-::\-Psionic\-\_\-\-Storm, and \-B\-W\-A\-P\-I\-::\-Unit\-Types\-::\-Terran\-\_\-\-Vulture\-\_\-\-Spider\-\_\-\-Mine.



\-Referenced by draw(), and has\-Gone().


\begin{DoxyCode}
{
        if(mUnit && mUnit->exists())
        {
                const BWAPI::UnitType &type = mUnit->getType();
                if(type == BWAPI::UnitTypes::Terran_Vulture_Spider_Mine)
                {
                        if(mUnit->getTarget())
                                return mUnit->getTarget()->getPosition();
                        else
                                return mUnit->getPosition();
                }
                else if(type == BWAPI::UnitTypes::Protoss_Scarab)
                {
                        if(mUnit->getTarget())
                                return mUnit->getTarget()->getPosition();
                        else
                                return BWAPI::Positions::Invalid;
                }
                else
                        return mUnit->getPosition();
        }
        else if(mBullet && mBullet->exists())
        {
                const BWAPI::BulletType &type = mBullet->getType();
                if(type == BWAPI::BulletTypes::Psionic_Storm)
                        return mBullet->getPosition();
                else if(type == BWAPI::BulletTypes::EMP_Missile)
                        return mBullet->getTargetPosition();
        }

        return BWAPI::Positions::Invalid;
}
\end{DoxyCode}


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




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


\hypertarget{classAOEThreatClass_abde3682966871d6024663dfbe70dd285}{\index{\-A\-O\-E\-Threat\-Class@{\-A\-O\-E\-Threat\-Class}!get\-Radius@{get\-Radius}}
\index{get\-Radius@{get\-Radius}!AOEThreatClass@{\-A\-O\-E\-Threat\-Class}}
\subsubsection[{get\-Radius}]{\setlength{\rightskip}{0pt plus 5cm}int {\bf \-A\-O\-E\-Threat\-Class\-::get\-Radius} (
\begin{DoxyParamCaption}
{}
\end{DoxyParamCaption}
) const}}\label{classAOEThreatClass_abde3682966871d6024663dfbe70dd285}


\-Definition at line 54 of file \-A\-O\-E\-Threat.\-cpp.



\-References \-B\-W\-A\-P\-I\-::\-Bullet\-Types\-::\-E\-M\-P\-\_\-\-Missile, \-B\-W\-A\-P\-I\-::\-Bullet\-::exists(), \-B\-W\-A\-P\-I\-::\-Bullet\-::get\-Type(), is\-Air\-Threat(), is\-Ground\-Threat(), m\-Bullet, m\-Unit, and \-B\-W\-A\-P\-I\-::\-Bullet\-Types\-::\-Psionic\-\_\-\-Storm.



\-Referenced by draw().


\begin{DoxyCode}
{
        if(mUnit && mUnit->exists())
        {
                int radius = 0;
                if(isAirThreat())
                        radius = mUnit->getType().airWeapon().
      medianSplashRadius();
                if(isGroundThreat())
                        radius = std::max(mUnit->getType().groundWeapon().
      medianSplashRadius(), radius);
                
                if(!mUnit->getTarget())
                        return radius / 2;
                else
                        return radius;
        }
        else if(mBullet && mBullet->exists())
        {
                const BWAPI::BulletType &type = mBullet->getType();
                if(type == BWAPI::BulletTypes::Psionic_Storm)
                        return 64;
                else if(type == BWAPI::BulletTypes::EMP_Missile)
                        return 96;
        }

        return 0;
}
\end{DoxyCode}


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




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


\hypertarget{classAOEThreatClass_af459954d240e5f7d86e96707dd8f210e}{\index{\-A\-O\-E\-Threat\-Class@{\-A\-O\-E\-Threat\-Class}!get\-Target@{get\-Target}}
\index{get\-Target@{get\-Target}!AOEThreatClass@{\-A\-O\-E\-Threat\-Class}}
\subsubsection[{get\-Target}]{\setlength{\rightskip}{0pt plus 5cm}{\bf \-Unit} {\bf \-A\-O\-E\-Threat\-Class\-::get\-Target} (
\begin{DoxyParamCaption}
{}
\end{DoxyParamCaption}
) const}}\label{classAOEThreatClass_af459954d240e5f7d86e96707dd8f210e}


\-Definition at line 87 of file \-A\-O\-E\-Threat.\-cpp.



\-References m\-Unit, and \-Static\-Units\-::nullunit.


\begin{DoxyCode}
{
        if(mUnit && mUnit->exists())
                return mUnit->getTarget();

        return StaticUnits::nullunit;
}
\end{DoxyCode}
\hypertarget{classAOEThreatClass_a1a8c24553e8a10c3295a166453382010}{\index{\-A\-O\-E\-Threat\-Class@{\-A\-O\-E\-Threat\-Class}!has\-Gone@{has\-Gone}}
\index{has\-Gone@{has\-Gone}!AOEThreatClass@{\-A\-O\-E\-Threat\-Class}}
\subsubsection[{has\-Gone}]{\setlength{\rightskip}{0pt plus 5cm}bool {\bf \-A\-O\-E\-Threat\-Class\-::has\-Gone} (
\begin{DoxyParamCaption}
{}
\end{DoxyParamCaption}
) const}}\label{classAOEThreatClass_a1a8c24553e8a10c3295a166453382010}


\-Definition at line 15 of file \-A\-O\-E\-Threat.\-cpp.



\-References get\-Position(), and \-B\-W\-A\-P\-I\-::\-Positions\-::\-Invalid.


\begin{DoxyCode}
{
        return getPosition() == BWAPI::Positions::Invalid;
}
\end{DoxyCode}


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


\hypertarget{classAOEThreatClass_aaf554675db137b86f2cc8bf6c90586c8}{\index{\-A\-O\-E\-Threat\-Class@{\-A\-O\-E\-Threat\-Class}!is\-Air\-Threat@{is\-Air\-Threat}}
\index{is\-Air\-Threat@{is\-Air\-Threat}!AOEThreatClass@{\-A\-O\-E\-Threat\-Class}}
\subsubsection[{is\-Air\-Threat}]{\setlength{\rightskip}{0pt plus 5cm}bool {\bf \-A\-O\-E\-Threat\-Class\-::is\-Air\-Threat} (
\begin{DoxyParamCaption}
{}
\end{DoxyParamCaption}
) const}}\label{classAOEThreatClass_aaf554675db137b86f2cc8bf6c90586c8}


\-Definition at line 95 of file \-A\-O\-E\-Threat.\-cpp.



\-References \-B\-W\-A\-P\-I\-::\-Bullet\-::exists(), \-B\-W\-A\-P\-I\-::\-Bullet\-::get\-Type(), m\-Bullet, and \-B\-W\-A\-P\-I\-::\-Bullet\-Types\-::\-Psionic\-\_\-\-Storm.



\-Referenced by get\-Radius().


\begin{DoxyCode}
{
        if(mBullet && mBullet->exists())
        {
                if(mBullet->getType() == BWAPI::BulletTypes::Psionic_Storm)
                        return true;
        }

        return false;
}
\end{DoxyCode}


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




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


\hypertarget{classAOEThreatClass_a382f4fbe22f49816f94d63732ae74766}{\index{\-A\-O\-E\-Threat\-Class@{\-A\-O\-E\-Threat\-Class}!is\-Energy\-Threat@{is\-Energy\-Threat}}
\index{is\-Energy\-Threat@{is\-Energy\-Threat}!AOEThreatClass@{\-A\-O\-E\-Threat\-Class}}
\subsubsection[{is\-Energy\-Threat}]{\setlength{\rightskip}{0pt plus 5cm}bool {\bf \-A\-O\-E\-Threat\-Class\-::is\-Energy\-Threat} (
\begin{DoxyParamCaption}
{}
\end{DoxyParamCaption}
) const}}\label{classAOEThreatClass_a382f4fbe22f49816f94d63732ae74766}


\-Definition at line 123 of file \-A\-O\-E\-Threat.\-cpp.



\-References \-B\-W\-A\-P\-I\-::\-Bullet\-Types\-::\-E\-M\-P\-\_\-\-Missile, \-B\-W\-A\-P\-I\-::\-Bullet\-::exists(), \-B\-W\-A\-P\-I\-::\-Bullet\-::get\-Type(), and m\-Bullet.


\begin{DoxyCode}
{
        if(mBullet && mBullet->exists())
        {
                if(mBullet->getType() == BWAPI::BulletTypes::EMP_Missile)
                        return true;
        }

        return false;
}\end{DoxyCode}


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


\hypertarget{classAOEThreatClass_a3f12e13e12f215515e142297e2cad95e}{\index{\-A\-O\-E\-Threat\-Class@{\-A\-O\-E\-Threat\-Class}!is\-Ground\-Threat@{is\-Ground\-Threat}}
\index{is\-Ground\-Threat@{is\-Ground\-Threat}!AOEThreatClass@{\-A\-O\-E\-Threat\-Class}}
\subsubsection[{is\-Ground\-Threat}]{\setlength{\rightskip}{0pt plus 5cm}bool {\bf \-A\-O\-E\-Threat\-Class\-::is\-Ground\-Threat} (
\begin{DoxyParamCaption}
{}
\end{DoxyParamCaption}
) const}}\label{classAOEThreatClass_a3f12e13e12f215515e142297e2cad95e}


\-Definition at line 106 of file \-A\-O\-E\-Threat.\-cpp.



\-References \-B\-W\-A\-P\-I\-::\-Bullet\-::exists(), \-B\-W\-A\-P\-I\-::\-Bullet\-::get\-Type(), m\-Bullet, m\-Unit, \-B\-W\-A\-P\-I\-::\-Unit\-Types\-::\-Protoss\-\_\-\-Scarab, \-B\-W\-A\-P\-I\-::\-Bullet\-Types\-::\-Psionic\-\_\-\-Storm, and \-B\-W\-A\-P\-I\-::\-Unit\-Types\-::\-Terran\-\_\-\-Vulture\-\_\-\-Spider\-\_\-\-Mine.



\-Referenced by get\-Radius().


\begin{DoxyCode}
{
        if(mUnit && mUnit->exists())
        {
                const BWAPI::UnitType &type = mUnit->getType();
                if(type == BWAPI::UnitTypes::Protoss_Scarab || type == 
      BWAPI::UnitTypes::Terran_Vulture_Spider_Mine)
                        return true;
        }
        else if(mBullet && mBullet->exists())
        {
                if(mBullet->getType() == BWAPI::BulletTypes::Psionic_Storm)
                        return true;
        }

        return false;
}
\end{DoxyCode}


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




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




\subsection{\-Member \-Data \-Documentation}
\hypertarget{classAOEThreatClass_ab7aa5f4c9a2296a28dd045139acce76a}{\index{\-A\-O\-E\-Threat\-Class@{\-A\-O\-E\-Threat\-Class}!m\-Bullet@{m\-Bullet}}
\index{m\-Bullet@{m\-Bullet}!AOEThreatClass@{\-A\-O\-E\-Threat\-Class}}
\subsubsection[{m\-Bullet}]{\setlength{\rightskip}{0pt plus 5cm}{\bf \-B\-W\-A\-P\-I\-::\-Bullet}$\ast$ {\bf \-A\-O\-E\-Threat\-Class\-::m\-Bullet}\hspace{0.3cm}{\ttfamily  \mbox{[}private\mbox{]}}}}\label{classAOEThreatClass_ab7aa5f4c9a2296a28dd045139acce76a}


\-Definition at line 25 of file \-A\-O\-E\-Threat.\-h.



\-Referenced by get\-Position(), get\-Radius(), is\-Air\-Threat(), is\-Energy\-Threat(), and is\-Ground\-Threat().

\hypertarget{classAOEThreatClass_ad7574e3a668d72b0418eb119fe6606b2}{\index{\-A\-O\-E\-Threat\-Class@{\-A\-O\-E\-Threat\-Class}!m\-Unit@{m\-Unit}}
\index{m\-Unit@{m\-Unit}!AOEThreatClass@{\-A\-O\-E\-Threat\-Class}}
\subsubsection[{m\-Unit}]{\setlength{\rightskip}{0pt plus 5cm}{\bf \-Unit} {\bf \-A\-O\-E\-Threat\-Class\-::m\-Unit}\hspace{0.3cm}{\ttfamily  \mbox{[}private\mbox{]}}}}\label{classAOEThreatClass_ad7574e3a668d72b0418eb119fe6606b2}


\-Definition at line 24 of file \-A\-O\-E\-Threat.\-h.



\-Referenced by get\-Position(), get\-Radius(), get\-Target(), and is\-Ground\-Threat().



\-The documentation for this class was generated from the following files\-:\begin{DoxyCompactItemize}
\item 
\-Skynet/\-Skynet/\hyperlink{AOEThreat_8h}{\-A\-O\-E\-Threat.\-h}\item 
\-Skynet/\-Skynet/\hyperlink{AOEThreat_8cpp}{\-A\-O\-E\-Threat.\-cpp}\end{DoxyCompactItemize}
