\hypertarget{BasicUnitAction_8cpp}{\section{\-Skynet/\-Skynet/\-Basic\-Unit\-Action.cpp \-File \-Reference}
\label{BasicUnitAction_8cpp}\index{\-Skynet/\-Skynet/\-Basic\-Unit\-Action.\-cpp@{\-Skynet/\-Skynet/\-Basic\-Unit\-Action.\-cpp}}
}
{\ttfamily \#include \char`\"{}\-Basic\-Unit\-Action.\-h\char`\"{}}\*
{\ttfamily \#include $<$limits$>$}\*
{\ttfamily \#include \char`\"{}\-Unit\-Tracker.\-h\char`\"{}}\*
{\ttfamily \#include \char`\"{}\-A\-O\-E\-Threat\-Tracker.\-h\char`\"{}}\*
{\ttfamily \#include \char`\"{}\-Unit\-Helper.\-h\char`\"{}}\*
\-Include dependency graph for \-Basic\-Unit\-Action.\-cpp\-:\nopagebreak
\begin{figure}[H]
\begin{center}
\leavevmode
\includegraphics[width=350pt]{BasicUnitAction_8cpp__incl}
\end{center}
\end{figure}
\subsection*{\-Functions}
\begin{DoxyCompactItemize}
\item 
void \hyperlink{BasicUnitAction_8cpp_ac7f8e9329536216e15a2ecf965fecb65}{stay\-At\-Range} (\hyperlink{Interface_8h_ab8fbb9e601c27f783b69f16c5a1fd40a}{\-Unit} unit, \hyperlink{Interface_8h_a7ae5d695cf6b7c013c5ad30d124278e0}{\-Position} target\-Positon, int max\-Range, int current\-Range)
\end{DoxyCompactItemize}


\subsection{\-Function \-Documentation}
\hypertarget{BasicUnitAction_8cpp_ac7f8e9329536216e15a2ecf965fecb65}{\index{\-Basic\-Unit\-Action.\-cpp@{\-Basic\-Unit\-Action.\-cpp}!stay\-At\-Range@{stay\-At\-Range}}
\index{stay\-At\-Range@{stay\-At\-Range}!BasicUnitAction.cpp@{\-Basic\-Unit\-Action.\-cpp}}
\subsubsection[{stay\-At\-Range}]{\setlength{\rightskip}{0pt plus 5cm}void {\bf stay\-At\-Range} (
\begin{DoxyParamCaption}
\item[{{\bf \-Unit}}]{unit, }
\item[{{\bf \-Position}}]{target\-Positon, }
\item[{int}]{max\-Range, }
\item[{int}]{current\-Range}
\end{DoxyParamCaption}
)}}\label{BasicUnitAction_8cpp_ac7f8e9329536216e15a2ecf965fecb65}


\-Definition at line 9 of file \-Basic\-Unit\-Action.\-cpp.



\-References \-Vector\-::normalise().



\-Referenced by \-Basic\-Unit\-Action\-::update().


\begin{DoxyCode}
{
        Position current = unit->getPosition();

        Vector direction = current - targetPositon;

        direction.normalise();
        direction *= float(maxRange - currentRange);
        direction += Vector(current);

        unit->move(direction);
}
\end{DoxyCode}


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




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


