\hypertarget{classBehaviour}{\section{\-Behaviour \-Class \-Reference}
\label{classBehaviour}\index{\-Behaviour@{\-Behaviour}}
}


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

\subsection*{\-Public \-Member \-Functions}
\begin{DoxyCompactItemize}
\item 
\hyperlink{classBehaviour_ad5778e83e92e2461e8baef933931e593}{\-Behaviour} ()
\item 
\hyperlink{classBehaviour_ac108d01f8815dfc28145c00456565cc1}{\-Behaviour} (\hyperlink{Interface_8h_ab8fbb9e601c27f783b69f16c5a1fd40a}{\-Unit} unit)
\item 
\hyperlink{classBehaviour_abda688bb444970cfbc033b988d44b178}{\-Behaviour} (\hyperlink{Interface_8h_ab8fbb9e601c27f783b69f16c5a1fd40a}{\-Unit} unit, const std\-::list$<$ \hyperlink{MicroAction_8h_a4fdf869181bbff2b7aae549b0df12b5c}{\-Micro\-Action} $>$ \&micro\-Actions)
\item 
void \hyperlink{classBehaviour_a293449bb7cd3e3d50950780db3a71cf4}{add\-Micro\-Action} (\hyperlink{MicroAction_8h_a4fdf869181bbff2b7aae549b0df12b5c}{\-Micro\-Action} action)
\item 
void \hyperlink{classBehaviour_a737503bb00f0cf988113bdcba47b6883}{update} (const \hyperlink{classGoal}{\-Goal} \&squad\-Goal, const \hyperlink{classUnitGroup}{\-Unit\-Group} \&squad\-Unit\-Group)
\item 
void \hyperlink{classBehaviour_a408a6f6281546827356972ace89d91bc}{on\-Deleted} ()
\item 
void \hyperlink{classBehaviour_a899a3dea735508154ac9ffa8e89504ce}{set} (\hyperlink{Interface_8h_ab8fbb9e601c27f783b69f16c5a1fd40a}{\-Unit} unit)
\item 
void \hyperlink{classBehaviour_a0401e95d2785f40b26a05f647b00eb97}{set} (\hyperlink{Interface_8h_ab8fbb9e601c27f783b69f16c5a1fd40a}{\-Unit} unit, const std\-::list$<$ \hyperlink{MicroAction_8h_a4fdf869181bbff2b7aae549b0df12b5c}{\-Micro\-Action} $>$ \&micro\-Actions)
\item 
void \hyperlink{classBehaviour_ae065327a21d0ca26b0dfd4a97522929d}{create\-Default\-Actions} ()
\end{DoxyCompactItemize}
\subsection*{\-Private \-Attributes}
\begin{DoxyCompactItemize}
\item 
\hyperlink{Interface_8h_ab8fbb9e601c27f783b69f16c5a1fd40a}{\-Unit} \hyperlink{classBehaviour_a0dd60aa99210411c24b0afe3a6f3a7d9}{m\-Unit}
\item 
std\-::list$<$ \hyperlink{MicroAction_8h_a4fdf869181bbff2b7aae549b0df12b5c}{\-Micro\-Action} $>$ \hyperlink{classBehaviour_a76e34230d47f9c25b70912cd8e59068e}{m\-Micro\-Actions}
\end{DoxyCompactItemize}


\subsection{\-Detailed \-Description}


\-Definition at line 7 of file \-Behaviour.\-h.



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


\-Definition at line 10 of file \-Behaviour.\-h.


\begin{DoxyCode}
{}
\end{DoxyCode}
\hypertarget{classBehaviour_ac108d01f8815dfc28145c00456565cc1}{\index{\-Behaviour@{\-Behaviour}!\-Behaviour@{\-Behaviour}}
\index{\-Behaviour@{\-Behaviour}!Behaviour@{\-Behaviour}}
\subsubsection[{\-Behaviour}]{\setlength{\rightskip}{0pt plus 5cm}{\bf \-Behaviour\-::\-Behaviour} (
\begin{DoxyParamCaption}
\item[{{\bf \-Unit}}]{unit}
\end{DoxyParamCaption}
)}}\label{classBehaviour_ac108d01f8815dfc28145c00456565cc1}


\-Definition at line 12 of file \-Behaviour.\-cpp.



\-References create\-Default\-Actions().


\begin{DoxyCode}
        : mUnit(unit)
{
        createDefaultActions();
}
\end{DoxyCode}


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


\hypertarget{classBehaviour_abda688bb444970cfbc033b988d44b178}{\index{\-Behaviour@{\-Behaviour}!\-Behaviour@{\-Behaviour}}
\index{\-Behaviour@{\-Behaviour}!Behaviour@{\-Behaviour}}
\subsubsection[{\-Behaviour}]{\setlength{\rightskip}{0pt plus 5cm}{\bf \-Behaviour\-::\-Behaviour} (
\begin{DoxyParamCaption}
\item[{{\bf \-Unit}}]{unit, }
\item[{const std\-::list$<$ {\bf \-Micro\-Action} $>$ \&}]{micro\-Actions}
\end{DoxyParamCaption}
)}}\label{classBehaviour_abda688bb444970cfbc033b988d44b178}


\-Definition at line 18 of file \-Behaviour.\-cpp.


\begin{DoxyCode}
        : mUnit(unit)
        , mMicroActions(microActions)
{
}
\end{DoxyCode}


\subsection{\-Member \-Function \-Documentation}
\hypertarget{classBehaviour_a293449bb7cd3e3d50950780db3a71cf4}{\index{\-Behaviour@{\-Behaviour}!add\-Micro\-Action@{add\-Micro\-Action}}
\index{add\-Micro\-Action@{add\-Micro\-Action}!Behaviour@{\-Behaviour}}
\subsubsection[{add\-Micro\-Action}]{\setlength{\rightskip}{0pt plus 5cm}void {\bf \-Behaviour\-::add\-Micro\-Action} (
\begin{DoxyParamCaption}
\item[{{\bf \-Micro\-Action}}]{action}
\end{DoxyParamCaption}
)}}\label{classBehaviour_a293449bb7cd3e3d50950780db3a71cf4}


\-Definition at line 24 of file \-Behaviour.\-cpp.



\-References m\-Micro\-Actions.


\begin{DoxyCode}
{
        mMicroActions.push_front(action);
}
\end{DoxyCode}
\hypertarget{classBehaviour_ae065327a21d0ca26b0dfd4a97522929d}{\index{\-Behaviour@{\-Behaviour}!create\-Default\-Actions@{create\-Default\-Actions}}
\index{create\-Default\-Actions@{create\-Default\-Actions}!Behaviour@{\-Behaviour}}
\subsubsection[{create\-Default\-Actions}]{\setlength{\rightskip}{0pt plus 5cm}void {\bf \-Behaviour\-::create\-Default\-Actions} (
\begin{DoxyParamCaption}
{}
\end{DoxyParamCaption}
)}}\label{classBehaviour_ae065327a21d0ca26b0dfd4a97522929d}


\-Definition at line 69 of file \-Behaviour.\-cpp.



\-References \-B\-W\-A\-P\-I\-::\-Unit\-Type\-::is\-Detector(), m\-Micro\-Actions, m\-Unit, \-B\-W\-A\-P\-I\-::\-Unit\-Types\-::\-Protoss\-\_\-\-Arbiter, \-B\-W\-A\-P\-I\-::\-Unit\-Types\-::\-Protoss\-\_\-\-Archon, \-B\-W\-A\-P\-I\-::\-Unit\-Types\-::\-Protoss\-\_\-\-Corsair, \-B\-W\-A\-P\-I\-::\-Unit\-Types\-::\-Protoss\-\_\-\-High\-\_\-\-Templar, \-B\-W\-A\-P\-I\-::\-Unit\-Types\-::\-Protoss\-\_\-\-Reaver, \-B\-W\-A\-P\-I\-::\-Unit\-Types\-::\-Protoss\-\_\-\-Zealot, \-B\-W\-A\-P\-I\-::\-Unit\-Types\-::\-Terran\-\_\-\-Siege\-\_\-\-Tank\-\_\-\-Siege\-\_\-\-Mode, \-B\-W\-A\-P\-I\-::\-Unit\-Types\-::\-Terran\-\_\-\-Vulture\-\_\-\-Spider\-\_\-\-Mine, and \-B\-W\-A\-P\-I\-::\-Unit\-Types\-::\-Zerg\-\_\-\-Scourge.



\-Referenced by \-Behaviour(), and set().


\begin{DoxyCode}
{
        const BWAPI::UnitType &unitType = mUnit->getType();

        std::list<std::set<BWAPI::UnitType>> targetPriorities;

        std::set<BWAPI::UnitType> firstTargets;

        if(unitType != BWAPI::UnitTypes::Protoss_Zealot)
                firstTargets.insert(BWAPI::UnitTypes::Terran_Vulture_Spider_Mine
      );

        if(unitType == BWAPI::UnitTypes::Protoss_Corsair)
                firstTargets.insert(BWAPI::UnitTypes::Zerg_Scourge);

        if(unitType == BWAPI::UnitTypes::Protoss_Zealot || unitType == 
      BWAPI::UnitTypes::Protoss_Archon)
        {
                firstTargets.insert(
      BWAPI::UnitTypes::Terran_Siege_Tank_Siege_Mode);
                mMicroActions.push_back(MicroAction(new 
      ArconZealotKillUnDetected(mUnit)));
        }

        targetPriorities.push_back(firstTargets);

        if(unitType.isDetector())
                mMicroActions.push_back(MicroAction(new DetectorAction(mUnit)))
      ;

        if(unitType == BWAPI::UnitTypes::Protoss_Arbiter)
                mMicroActions.push_back(MicroAction(new ArbiterAction(mUnit)));

        if(unitType == BWAPI::UnitTypes::Protoss_Reaver)
                mMicroActions.push_back(MicroAction(new TrainScarabAction(mUnit
      )));

        if(unitType == BWAPI::UnitTypes::Protoss_High_Templar)
                mMicroActions.push_back(MicroAction(new PsiStormAction(mUnit)))
      ;

        if(unitType == BWAPI::UnitTypes::Protoss_Zealot)
                mMicroActions.push_back(MicroAction(new MineDragAction(mUnit)))
      ;

        mMicroActions.push_back(MicroAction(new BasicUnitAction(mUnit, 
      targetPriorities)));
        mMicroActions.push_back(MicroAction(new GoalAction(mUnit)));
}\end{DoxyCode}


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




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


\hypertarget{classBehaviour_a408a6f6281546827356972ace89d91bc}{\index{\-Behaviour@{\-Behaviour}!on\-Deleted@{on\-Deleted}}
\index{on\-Deleted@{on\-Deleted}!Behaviour@{\-Behaviour}}
\subsubsection[{on\-Deleted}]{\setlength{\rightskip}{0pt plus 5cm}void {\bf \-Behaviour\-::on\-Deleted} (
\begin{DoxyParamCaption}
{}
\end{DoxyParamCaption}
)}}\label{classBehaviour_a408a6f6281546827356972ace89d91bc}


\-Definition at line 46 of file \-Behaviour.\-cpp.



\-References m\-Micro\-Actions, and m\-Unit.



\-Referenced by \-Observer\-Scout\-Task\-::return\-Unit().


\begin{DoxyCode}
{
        for each(MicroAction action in mMicroActions)
        {
                action->removeUnit(mUnit);
        }

        mMicroActions.clear();
        mUnit.reset();
}
\end{DoxyCode}


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


\hypertarget{classBehaviour_a899a3dea735508154ac9ffa8e89504ce}{\index{\-Behaviour@{\-Behaviour}!set@{set}}
\index{set@{set}!Behaviour@{\-Behaviour}}
\subsubsection[{set}]{\setlength{\rightskip}{0pt plus 5cm}void {\bf \-Behaviour\-::set} (
\begin{DoxyParamCaption}
\item[{{\bf \-Unit}}]{unit}
\end{DoxyParamCaption}
)}}\label{classBehaviour_a899a3dea735508154ac9ffa8e89504ce}


\-Definition at line 57 of file \-Behaviour.\-cpp.



\-References create\-Default\-Actions(), and m\-Unit.



\-Referenced by \-Observer\-Scout\-Task\-::give\-Unit().


\begin{DoxyCode}
{
        mUnit = unit;
        createDefaultActions();
}
\end{DoxyCode}


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




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


\hypertarget{classBehaviour_a0401e95d2785f40b26a05f647b00eb97}{\index{\-Behaviour@{\-Behaviour}!set@{set}}
\index{set@{set}!Behaviour@{\-Behaviour}}
\subsubsection[{set}]{\setlength{\rightskip}{0pt plus 5cm}void {\bf \-Behaviour\-::set} (
\begin{DoxyParamCaption}
\item[{{\bf \-Unit}}]{unit, }
\item[{const std\-::list$<$ {\bf \-Micro\-Action} $>$ \&}]{micro\-Actions}
\end{DoxyParamCaption}
)}}\label{classBehaviour_a0401e95d2785f40b26a05f647b00eb97}


\-Definition at line 63 of file \-Behaviour.\-cpp.



\-References m\-Micro\-Actions, and m\-Unit.


\begin{DoxyCode}
{
        mUnit = unit;
        mMicroActions = microActions;
}
\end{DoxyCode}
\hypertarget{classBehaviour_a737503bb00f0cf988113bdcba47b6883}{\index{\-Behaviour@{\-Behaviour}!update@{update}}
\index{update@{update}!Behaviour@{\-Behaviour}}
\subsubsection[{update}]{\setlength{\rightskip}{0pt plus 5cm}void {\bf \-Behaviour\-::update} (
\begin{DoxyParamCaption}
\item[{const {\bf \-Goal} \&}]{squad\-Goal, }
\item[{const {\bf \-Unit\-Group} \&}]{squad\-Unit\-Group}
\end{DoxyParamCaption}
)}}\label{classBehaviour_a737503bb00f0cf988113bdcba47b6883}


\-Definition at line 29 of file \-Behaviour.\-cpp.



\-References m\-Micro\-Actions.



\-Referenced by \-Observer\-Scout\-Task\-::update().


\begin{DoxyCode}
{
        for each(MicroAction action in mMicroActions)
        {
                if(action->update(squadGoal, squadUnitGroup))
                        break;
        }

        for(std::list<MicroAction>::iterator it = mMicroActions.begin(); it != 
      mMicroActions.end();)
        {
                if((*it)->hasEnded())
                        mMicroActions.erase(it++);
                else
                        ++it;
        }
}
\end{DoxyCode}


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




\subsection{\-Member \-Data \-Documentation}
\hypertarget{classBehaviour_a76e34230d47f9c25b70912cd8e59068e}{\index{\-Behaviour@{\-Behaviour}!m\-Micro\-Actions@{m\-Micro\-Actions}}
\index{m\-Micro\-Actions@{m\-Micro\-Actions}!Behaviour@{\-Behaviour}}
\subsubsection[{m\-Micro\-Actions}]{\setlength{\rightskip}{0pt plus 5cm}std\-::list$<${\bf \-Micro\-Action}$>$ {\bf \-Behaviour\-::m\-Micro\-Actions}\hspace{0.3cm}{\ttfamily  \mbox{[}private\mbox{]}}}}\label{classBehaviour_a76e34230d47f9c25b70912cd8e59068e}


\-Definition at line 28 of file \-Behaviour.\-h.



\-Referenced by add\-Micro\-Action(), create\-Default\-Actions(), on\-Deleted(), set(), and update().

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


\-Definition at line 26 of file \-Behaviour.\-h.



\-Referenced by create\-Default\-Actions(), on\-Deleted(), and set().



\-The documentation for this class was generated from the following files\-:\begin{DoxyCompactItemize}
\item 
\-Skynet/\-Skynet/\hyperlink{Behaviour_8h}{\-Behaviour.\-h}\item 
\-Skynet/\-Skynet/\hyperlink{Behaviour_8cpp}{\-Behaviour.\-cpp}\end{DoxyCompactItemize}
