\hypertarget{classBorderTrackerClass}{\section{\-Border\-Tracker\-Class \-Class \-Reference}
\label{classBorderTrackerClass}\index{\-Border\-Tracker\-Class@{\-Border\-Tracker\-Class}}
}


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

\subsection*{\-Public \-Member \-Functions}
\begin{DoxyCompactItemize}
\item 
\hyperlink{classBorderTrackerClass_acdbaec78fe4226367ed09571af6c797e}{\-Border\-Tracker\-Class} ()
\item 
const std\-::map$<$ \hyperlink{BorderPosition_8h_ae7457ead7ae8316010fa8fc9c362cfe0}{\-Position\-Type}, \*
std\-::set$<$ \hyperlink{classBorderPosition}{\-Border\-Position} $>$ $>$ \& \hyperlink{classBorderTrackerClass_a6ff09df82825743fa342c9266e3bb14e}{get\-Border\-Positions} () const 
\item 
const std\-::set$<$ \hyperlink{classBorderPosition}{\-Border\-Position} $>$ \& \hyperlink{classBorderTrackerClass_abedaf6f370432f6c6acbe5035bd49340}{get\-Border\-Positions} (\hyperlink{BorderPosition_8h_ae7457ead7ae8316010fa8fc9c362cfe0}{\-Position\-Type} type)
\item 
void \hyperlink{classBorderTrackerClass_a510792e330b9b691f0c1d3a00b1ce508}{on\-Begin} ()
\item 
void \hyperlink{classBorderTrackerClass_a0492f1101f97f6bbfe0b60e4cf5e54ff}{update} ()
\item 
void \hyperlink{classBorderTrackerClass_ad86873e34fba641f7065a8449224bc59}{toggle\-Debug\-Info} ()
\end{DoxyCompactItemize}
\subsection*{\-Private \-Member \-Functions}
\begin{DoxyCompactItemize}
\item 
void \hyperlink{classBorderTrackerClass_a7566d2ec3ef72879c30d1902418945ae}{recalculate\-Borders} ()
\item 
void \hyperlink{classBorderTrackerClass_a551a3fd73a7f1b2369984161f77d9c4e}{draw\-Debug\-Info} (std\-::map$<$ \hyperlink{BorderPosition_8h_ae7457ead7ae8316010fa8fc9c362cfe0}{\-Position\-Type}, std\-::set$<$ \hyperlink{classBorderPosition}{\-Border\-Position} $>$$>$\-::const\-\_\-iterator it)
\end{DoxyCompactItemize}
\subsection*{\-Private \-Attributes}
\begin{DoxyCompactItemize}
\item 
std\-::map$<$ \hyperlink{BorderPosition_8h_ae7457ead7ae8316010fa8fc9c362cfe0}{\-Position\-Type}, \*
std\-::set$<$ \hyperlink{classBorderPosition}{\-Border\-Position} $>$ $>$ \hyperlink{classBorderTrackerClass_a67a1dba87c6fcadf053cb09adfa54cb5}{m\-Border\-Positions}
\item 
std\-::set$<$ \hyperlink{Base_8h_aeee60104d9f1947526194ec22d997f69}{\-Base} $>$ \hyperlink{classBorderTrackerClass_a94a7f7aa0cd114fd403d7d631d86a296}{m\-My\-Bases}
\item 
std\-::set$<$ \hyperlink{Base_8h_aeee60104d9f1947526194ec22d997f69}{\-Base} $>$ \hyperlink{classBorderTrackerClass_acec813539b168517fec3f2c6d4338b2c}{m\-Enemy\-Bases}
\item 
std\-::set$<$ \hyperlink{Chokepoint_8h_ac1a1ed6cb736b2e1294c4740cd6c9e00}{\-Region} $>$ \hyperlink{classBorderTrackerClass_a24f7a0ee4735f7606c5a9e033b049e93}{m\-My\-Regions}
\item 
std\-::set$<$ \hyperlink{Chokepoint_8h_ac1a1ed6cb736b2e1294c4740cd6c9e00}{\-Region} $>$ \hyperlink{classBorderTrackerClass_ac5ae40bafb8b545d5170333e7235f9cd}{m\-My\-Forward\-Regions}
\item 
std\-::set$<$ \hyperlink{Chokepoint_8h_ac1a1ed6cb736b2e1294c4740cd6c9e00}{\-Region} $>$ \hyperlink{classBorderTrackerClass_a47aaee7df5748f824377325c326f7ee1}{m\-Enemy\-Regions}
\item 
std\-::set$<$ \hyperlink{Chokepoint_8h_a865bdcf45811a239597170e10efc411f}{\-Chokepoint} $>$ \hyperlink{classBorderTrackerClass_a276b68793ba3b62777da2b8b789fefbb}{m\-My\-Border}
\item 
std\-::set$<$ \hyperlink{Chokepoint_8h_a865bdcf45811a239597170e10efc411f}{\-Chokepoint} $>$ \hyperlink{classBorderTrackerClass_a44983353e2d14ee518967308dcd185fc}{m\-My\-Forward\-Border}
\item 
std\-::set$<$ \hyperlink{Chokepoint_8h_a865bdcf45811a239597170e10efc411f}{\-Chokepoint} $>$ \hyperlink{classBorderTrackerClass_a8e90a8bec455c471838b51c48501f245}{m\-Enemy\-Border}
\item 
bool \hyperlink{classBorderTrackerClass_a423b1907b2c448a2e75090fe31fa57de}{m\-Show\-Debug\-Info}
\item 
std\-::set$<$ \hyperlink{Chokepoint_8h_ac1a1ed6cb736b2e1294c4740cd6c9e00}{\-Region} $>$ \hyperlink{classBorderTrackerClass_a1f33f0fe3e449b4f4caabe588b07eee0}{m\-Large\-Regions}
\end{DoxyCompactItemize}


\subsection{\-Detailed \-Description}


\-Definition at line 8 of file \-Border\-Tracker.\-h.



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


\-Definition at line 11 of file \-Border\-Tracker.\-h.


\begin{DoxyCode}
{}
\end{DoxyCode}


\subsection{\-Member \-Function \-Documentation}
\hypertarget{classBorderTrackerClass_a551a3fd73a7f1b2369984161f77d9c4e}{\index{\-Border\-Tracker\-Class@{\-Border\-Tracker\-Class}!draw\-Debug\-Info@{draw\-Debug\-Info}}
\index{draw\-Debug\-Info@{draw\-Debug\-Info}!BorderTrackerClass@{\-Border\-Tracker\-Class}}
\subsubsection[{draw\-Debug\-Info}]{\setlength{\rightskip}{0pt plus 5cm}void {\bf \-Border\-Tracker\-Class\-::draw\-Debug\-Info} (
\begin{DoxyParamCaption}
\item[{std\-::map$<$ {\bf \-Position\-Type}, std\-::set$<$ {\bf \-Border\-Position} $>$$>$\-::const\-\_\-iterator}]{it}
\end{DoxyParamCaption}
)\hspace{0.3cm}{\ttfamily  \mbox{[}private\mbox{]}}}}\label{classBorderTrackerClass_a551a3fd73a7f1b2369984161f77d9c4e}


\-Definition at line 278 of file \-Border\-Tracker.\-cpp.



\-References \-B\-W\-A\-P\-I\-::\-Colors\-::\-Blue, \-Position\-Type\-Def\-::\-Bot\-Control\-Region, \-Position\-Type\-Def\-::\-Contain\-Chokepoint, \-Position\-Type\-Def\-::\-Defense\-Chokepoint, \-Position\-Type\-Def\-::\-Enemy\-Chokepoint, \-Position\-Type\-Def\-::\-Enemy\-Control\-Region, \-Position\-Type\-Def\-::\-Forward\-Chokepoint, \-Position\-Type\-Def\-::\-Forward\-Region, \-B\-W\-A\-P\-I\-::\-Colors\-::\-Green, \-B\-W\-A\-P\-I\-::\-Colors\-::\-Grey, m\-Border\-Positions, \-B\-W\-A\-P\-I\-::\-Colors\-::\-Orange, \-B\-W\-A\-P\-I\-::\-Colors\-::\-Purple, \-B\-W\-A\-P\-I\-::\-Colors\-::\-Red, and \-B\-W\-A\-P\-I\-::\-Colors\-::\-Yellow.



\-Referenced by update().


\begin{DoxyCode}
{
        if(it == mBorderPositions.end() || it->second.size() == 0)
                return;

        for(std::set<BorderPosition>::const_iterator bp = it->second.begin(); 
      bp != it->second.end(); ++bp)
        {
                switch(bp->mType.underlying())
                {
                case PositionType::ContainChokepoint:
                case PositionType::ForwardChokepoint:
                case PositionType::EnemyChokepoint:
                case PositionType::DefenseChokepoint:
                        {
                                BWAPI::Color color = bp->mType == 
      PositionType::DefenseChokepoint ? BWAPI::Colors::Green : (bp->mType == 
      PositionType::EnemyChokepoint ? BWAPI::Colors::Red : (bp->mType == 
      PositionType::ForwardChokepoint ? BWAPI::Colors::Blue : BWAPI::Colors::Yellow))
      ;
                                bp->mChoke->draw(color);
                                break;
                        }
                case PositionType::EnemyControlRegion:
                case PositionType::BotControlRegion:
                case PositionType::ForwardRegion:
                        {
                                BWAPI::Color color = bp->mType == 
      PositionType::BotControlRegion ? BWAPI::Colors::Grey : (bp->mType == 
      PositionType::ForwardRegion ? BWAPI::Colors::Orange : BWAPI::Colors::Purple);
                                bp->mRegion->draw(color);
                                break;
                        }
                }
        }
}\end{DoxyCode}


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


\hypertarget{classBorderTrackerClass_a6ff09df82825743fa342c9266e3bb14e}{\index{\-Border\-Tracker\-Class@{\-Border\-Tracker\-Class}!get\-Border\-Positions@{get\-Border\-Positions}}
\index{get\-Border\-Positions@{get\-Border\-Positions}!BorderTrackerClass@{\-Border\-Tracker\-Class}}
\subsubsection[{get\-Border\-Positions}]{\setlength{\rightskip}{0pt plus 5cm}const std\-::map$<${\bf \-Position\-Type}, std\-::set$<${\bf \-Border\-Position}$>$ $>$\& {\bf \-Border\-Tracker\-Class\-::get\-Border\-Positions} (
\begin{DoxyParamCaption}
{}
\end{DoxyParamCaption}
) const\hspace{0.3cm}{\ttfamily  \mbox{[}inline\mbox{]}}}}\label{classBorderTrackerClass_a6ff09df82825743fa342c9266e3bb14e}


\-Definition at line 13 of file \-Border\-Tracker.\-h.



\-References m\-Border\-Positions.


\begin{DoxyCode}
{ return mBorderPositions; }
\end{DoxyCode}
\hypertarget{classBorderTrackerClass_abedaf6f370432f6c6acbe5035bd49340}{\index{\-Border\-Tracker\-Class@{\-Border\-Tracker\-Class}!get\-Border\-Positions@{get\-Border\-Positions}}
\index{get\-Border\-Positions@{get\-Border\-Positions}!BorderTrackerClass@{\-Border\-Tracker\-Class}}
\subsubsection[{get\-Border\-Positions}]{\setlength{\rightskip}{0pt plus 5cm}const std\-::set$<${\bf \-Border\-Position}$>$\& {\bf \-Border\-Tracker\-Class\-::get\-Border\-Positions} (
\begin{DoxyParamCaption}
\item[{{\bf \-Position\-Type}}]{type}
\end{DoxyParamCaption}
)\hspace{0.3cm}{\ttfamily  \mbox{[}inline\mbox{]}}}}\label{classBorderTrackerClass_abedaf6f370432f6c6acbe5035bd49340}


\-Definition at line 14 of file \-Border\-Tracker.\-h.



\-References m\-Border\-Positions.


\begin{DoxyCode}
{ return mBorderPositions[type]; }
\end{DoxyCode}
\hypertarget{classBorderTrackerClass_a510792e330b9b691f0c1d3a00b1ce508}{\index{\-Border\-Tracker\-Class@{\-Border\-Tracker\-Class}!on\-Begin@{on\-Begin}}
\index{on\-Begin@{on\-Begin}!BorderTrackerClass@{\-Border\-Tracker\-Class}}
\subsubsection[{on\-Begin}]{\setlength{\rightskip}{0pt plus 5cm}void {\bf \-Border\-Tracker\-Class\-::on\-Begin} (
\begin{DoxyParamCaption}
{}
\end{DoxyParamCaption}
)}}\label{classBorderTrackerClass_a510792e330b9b691f0c1d3a00b1ce508}


\-Definition at line 6 of file \-Border\-Tracker.\-cpp.



\-References \-Singleton$<$ T $>$\-::\-Instance(), and m\-Large\-Regions.


\begin{DoxyCode}
{
        for each(Region region in TerrainAnaysis::Instance().getRegions())
        {
                if(region->getSize() > 100000)
                        mLargeRegions.insert(region);
        }
}
\end{DoxyCode}


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


\hypertarget{classBorderTrackerClass_a7566d2ec3ef72879c30d1902418945ae}{\index{\-Border\-Tracker\-Class@{\-Border\-Tracker\-Class}!recalculate\-Borders@{recalculate\-Borders}}
\index{recalculate\-Borders@{recalculate\-Borders}!BorderTrackerClass@{\-Border\-Tracker\-Class}}
\subsubsection[{recalculate\-Borders}]{\setlength{\rightskip}{0pt plus 5cm}void {\bf \-Border\-Tracker\-Class\-::recalculate\-Borders} (
\begin{DoxyParamCaption}
{}
\end{DoxyParamCaption}
)\hspace{0.3cm}{\ttfamily  \mbox{[}private\mbox{]}}}}\label{classBorderTrackerClass_a7566d2ec3ef72879c30d1902418945ae}


\-Definition at line 47 of file \-Border\-Tracker.\-cpp.



\-References \-Position\-Type\-Def\-::\-Bot\-Control\-Region, \-Position\-Type\-Def\-::\-Defense\-Chokepoint, \-Position\-Type\-Def\-::\-Enemy\-Chokepoint, \-Position\-Type\-Def\-::\-Enemy\-Control\-Region, \-Position\-Type\-Def\-::\-Forward\-Chokepoint, \-Position\-Type\-Def\-::\-Forward\-Region, \-Singleton$<$ T $>$\-::\-Instance(), m\-Border\-Positions, m\-Enemy\-Bases, m\-Enemy\-Border, m\-Enemy\-Regions, m\-Large\-Regions, m\-My\-Bases, m\-My\-Border, m\-My\-Forward\-Border, m\-My\-Forward\-Regions, m\-My\-Regions, \-Position\-Type\-Def\-::\-Shared\-Chokepoint, and \-Position\-Type\-Def\-::\-Tech\-Defense\-Chokepoint.



\-Referenced by update().


\begin{DoxyCode}
{
        mMyRegions.clear();
        mMyForwardRegions.clear();
        mMyBorder.clear();
        mMyForwardBorder.clear();
        mEnemyRegions.clear();
        mEnemyBorder.clear();
        mBorderPositions.clear();

        std::set<Region> canReachSelf;
        std::set<Region> canReachEnemy;
        std::map<Region, int> regionTech;

        //Add all my regions to the set
        for each(Base base in mMyBases)
        {
                if(mLargeRegions.count(base->getRegion()) == 0)
                {
                        regionTech[base->getRegion()] += base->
      getNumberOfTechBuildings();
                        mMyRegions.insert(base->getRegion());
                        canReachSelf.insert(base->getRegion());
                }
        }

        //Add all enemy regions to the set
        for each(Base base in mEnemyBases)
        {
                if(mLargeRegions.count(base->getRegion()) == 0)
                {
                        regionTech[base->getRegion()] += base->
      getNumberOfTechBuildings();
                        mEnemyRegions.insert(base->getRegion());
                        canReachEnemy.insert(base->getRegion());
                }
        }

        //If there are enemy bases
        if(!mEnemyBases.empty())
        {
                bool exploring = true;
                while(exploring)
                {
                        exploring = false;

                        //Go through the regions
                        for each(Region region in TerrainAnaysis::Instance().
      getRegions())
                        {
                                for each(Chokepoint chokepoint in region->
      getChokepoints())
                                {
                                        Region secondRegion = chokepoint->
      getRegions().first;
                                        if(region == secondRegion)
                                                secondRegion = chokepoint->
      getRegions().second;

                                        //if this region is in the set and the
       connected region cannot be reached by the enemy, it can be considered ours.
                                        if(canReachSelf.count(region) != 0 && 
      mEnemyRegions.count(secondRegion) == 0 && canReachSelf.count(secondRegion) == 0
      )
                                        {
                                                canReachSelf.insert(
      secondRegion);
                                                exploring = true;
                                        }

                                        //if this region is in the set and the
       connected region cannot be reached by me, it can be considered the enemies.
                                        if(canReachEnemy.count(region) != 0 && 
      mMyRegions.count(secondRegion) == 0 && canReachEnemy.count(secondRegion) == 0)
                                        {
                                                canReachEnemy.insert(
      secondRegion);
                                                exploring = true;
                                        }
                                }
                        }
                }
        }

        for each(Region region in TerrainAnaysis::Instance().getRegions())
        {
                //if we can reach this region and the enemy can't, it can be
       ours
                if(canReachSelf.count(region) != 0 && canReachEnemy.count(
      region) == 0)
                {
                        mBorderPositions[PositionType::BotControlRegion].insert
      (BorderPosition(PositionType::BotControlRegion, region));
                        mMyRegions.insert(region);
                        mMyForwardRegions.insert(region);
                }

                //if we cant reach this region and the enemy can, it can be the
       enemies
                if(canReachSelf.count(region) == 0 && canReachEnemy.count(
      region) != 0)
                {
                        mBorderPositions[PositionType::EnemyControlRegion].
      insert(BorderPosition(PositionType::EnemyControlRegion, region));
                        mEnemyRegions.insert(region);
                }
        }

        //any chokepoints that dont straddle 2 regions are defense chokepoints
        for each(Region region in mMyRegions)
        {
                for each(Chokepoint chokepoint in region->getChokepoints())
                {
                        if(mMyBorder.count(chokepoint) == 0)
                                mMyBorder.insert(chokepoint);
                        else
                                mMyBorder.erase(chokepoint);
                }
        }

        std::map<Chokepoint, int> borderChokeTech;
        for each(Chokepoint chokepoint in mMyBorder)
        {
                Region startRegion = chokepoint->getRegions().first;
                if(mMyRegions.count(startRegion) == 0)
                        startRegion = chokepoint->getRegions().second;

                std::set<Region> visitedRegions;
                std::set<Region> unvisitedRegions;
                int controlledAreaTech = 0;
                unvisitedRegions.insert(startRegion);

                while(!unvisitedRegions.empty())
                {
                        std::set<Region>::iterator it = unvisitedRegions.begin(
      );
                        visitedRegions.insert(*it);

                        controlledAreaTech += regionTech[*it];

                        for each(Chokepoint connectedChoke in (*it)->
      getChokepoints())
                        {
                                if(mMyBorder.count(connectedChoke) != 0)
                                        continue;

                                Region connectedRegion = connectedChoke->
      getRegions().first;
                                if(connectedRegion == *it)
                                        connectedRegion = connectedChoke->
      getRegions().second;

                                if(visitedRegions.count(connectedRegion) == 0)
                                        unvisitedRegions.insert(connectedRegion
      );
                        }

                        unvisitedRegions.erase(it);
                }

                borderChokeTech[chokepoint] = controlledAreaTech;
        }

        for each(Region region in mEnemyRegions)
        {
                for each(Chokepoint chokepoint in region->getChokepoints())
                {
                        if (mEnemyBorder.count(chokepoint) == 0)
                                mEnemyBorder.insert(chokepoint);
                        else
                                mEnemyBorder.erase(chokepoint);
                }
        }

        mMyForwardBorder = mMyBorder;
        for each(Chokepoint chokepoint in mMyBorder)
        {
                mBorderPositions[PositionType::DefenseChokepoint].insert(
      BorderPosition(PositionType::DefenseChokepoint, chokepoint));

                if(mEnemyBorder.count(chokepoint) != 0)
                        mBorderPositions[PositionType::SharedChokepoint].insert
      (BorderPosition(PositionType::SharedChokepoint, chokepoint));

                if(borderChokeTech[chokepoint] > 0)
                        mBorderPositions[PositionType::TechDefenseChokepoint].
      insert(BorderPosition(PositionType::TechDefenseChokepoint, chokepoint));
        }

        for each(Chokepoint chokepoint in mEnemyBorder)
        {
                mBorderPositions[PositionType::EnemyChokepoint].insert(
      BorderPosition(PositionType::EnemyChokepoint, chokepoint));
        }

        if(!mEnemyBases.empty())
        {
                bool expanding = true;
                while(expanding)
                {
                        expanding = false;

                        for each(Chokepoint chokepoint in mMyForwardBorder)
                        {
                                //get the region the otherside of this
       chokepoint
                                Region region = chokepoint->getRegions().first;
                                if(mMyForwardRegions.count(region) != 0)
                                        region = chokepoint->getRegions().
      second;

                                //make sure it isn't an enemy region
                                if(mEnemyRegions.find(region) != mEnemyRegions.
      end())
                                        continue;

                                int oldCount = 0;
                                int newCount = 0;

                                //count the number of chokepoints part of our
       border and those not
                                for each(Chokepoint chokepoint in region->
      getChokepoints())
                                {
                                        if(mMyForwardBorder.find(chokepoint) !=
       mMyForwardBorder.end())
                                                ++oldCount;
                                        else
                                                ++newCount;
                                }

                                //if we can reduce the number of chokepoints
                                if(newCount <= oldCount)
                                {
                                        //reverse regions, so we consider this
       region ours.
                                        for each(Chokepoint chokepoint in 
      region->getChokepoints())
                                        {
                                                if(mMyForwardBorder.count(
      chokepoint) != 0)
                                                        mMyForwardBorder.erase(
      chokepoint);
                                                else
                                                        mMyForwardBorder.insert
      (chokepoint);
                                        }

                                        mMyForwardRegions.insert(region);

                                        expanding = true;
                                        break;
                                }
                        }
                }
        }

        for each(Chokepoint chokepoint in mMyForwardBorder)
        {
                if(mMyBorder.count(chokepoint) == 0)
                        mBorderPositions[PositionType::ForwardChokepoint].
      insert(BorderPosition(PositionType::ForwardChokepoint, chokepoint));
        }

        for each(Region region in mMyForwardRegions)
        {
                if(mMyRegions.count(region) == 0)
                        mBorderPositions[PositionType::ForwardRegion].insert(
      BorderPosition(PositionType::ForwardRegion, region));
        }
}
\end{DoxyCode}


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




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


\hypertarget{classBorderTrackerClass_ad86873e34fba641f7065a8449224bc59}{\index{\-Border\-Tracker\-Class@{\-Border\-Tracker\-Class}!toggle\-Debug\-Info@{toggle\-Debug\-Info}}
\index{toggle\-Debug\-Info@{toggle\-Debug\-Info}!BorderTrackerClass@{\-Border\-Tracker\-Class}}
\subsubsection[{toggle\-Debug\-Info}]{\setlength{\rightskip}{0pt plus 5cm}void {\bf \-Border\-Tracker\-Class\-::toggle\-Debug\-Info} (
\begin{DoxyParamCaption}
{}
\end{DoxyParamCaption}
)\hspace{0.3cm}{\ttfamily  \mbox{[}inline\mbox{]}}}}\label{classBorderTrackerClass_ad86873e34fba641f7065a8449224bc59}


\-Definition at line 19 of file \-Border\-Tracker.\-h.



\-References m\-Show\-Debug\-Info.


\begin{DoxyCode}
{ mShowDebugInfo = !mShowDebugInfo; }
\end{DoxyCode}
\hypertarget{classBorderTrackerClass_a0492f1101f97f6bbfe0b60e4cf5e54ff}{\index{\-Border\-Tracker\-Class@{\-Border\-Tracker\-Class}!update@{update}}
\index{update@{update}!BorderTrackerClass@{\-Border\-Tracker\-Class}}
\subsubsection[{update}]{\setlength{\rightskip}{0pt plus 5cm}void {\bf \-Border\-Tracker\-Class\-::update} (
\begin{DoxyParamCaption}
{}
\end{DoxyParamCaption}
)}}\label{classBorderTrackerClass_a0492f1101f97f6bbfe0b60e4cf5e54ff}


\-Definition at line 15 of file \-Border\-Tracker.\-cpp.



\-References \-Position\-Type\-Def\-::\-Bot\-Control\-Region, \-Position\-Type\-Def\-::\-Contain\-Chokepoint, \-Position\-Type\-Def\-::\-Defense\-Chokepoint, draw\-Debug\-Info(), \-Position\-Type\-Def\-::\-Enemy\-Chokepoint, \-Position\-Type\-Def\-::\-Enemy\-Control\-Region, \-Position\-Type\-Def\-::\-Forward\-Chokepoint, \-Position\-Type\-Def\-::\-Forward\-Region, \-Position\-Type\-Def\-::\-Hold\-Base, \-Singleton$<$ T $>$\-::\-Instance(), m\-Border\-Positions, m\-Enemy\-Bases, m\-Large\-Regions, m\-My\-Bases, m\-Show\-Debug\-Info, \-Position\-Type\-Def\-::\-Position, recalculate\-Borders(), \-B\-W\-A\-P\-I\-::\-Colors\-::\-Red, \-Position\-Type\-Def\-::\-Shared\-Chokepoint, and \-Position\-Type\-Def\-::\-Tech\-Defense\-Chokepoint.


\begin{DoxyCode}
{
        std::set<Base> myBases = BaseTracker::Instance().getImportantBases();
        std::set<Base> enemyBases = BaseTracker::Instance().
      getEnemyImportantBases();
        if(enemyBases != mEnemyBases || myBases != mMyBases)
        {
                mMyBases = myBases;
                mEnemyBases = enemyBases;
                recalculateBorders();
        }

        drawDebugInfo(mBorderPositions.find(PositionType::TechDefenseChokepoint
      ));

        if(mShowDebugInfo)
        {
                for each(Region region in mLargeRegions)
                {
                        region->draw(BWAPI::Colors::Red);
                }
                drawDebugInfo(mBorderPositions.find(
      PositionType::EnemyControlRegion));
                drawDebugInfo(mBorderPositions.find(
      PositionType::BotControlRegion));
                drawDebugInfo(mBorderPositions.find(PositionType::ForwardRegion
      ));
                drawDebugInfo(mBorderPositions.find(
      PositionType::ContainChokepoint));
                drawDebugInfo(mBorderPositions.find(
      PositionType::ForwardChokepoint));
                drawDebugInfo(mBorderPositions.find(
      PositionType::EnemyChokepoint));
                drawDebugInfo(mBorderPositions.find(
      PositionType::DefenseChokepoint));
                drawDebugInfo(mBorderPositions.find(
      PositionType::SharedChokepoint));
                drawDebugInfo(mBorderPositions.find(PositionType::Position));
                drawDebugInfo(mBorderPositions.find(PositionType::HoldBase));
        }
}
\end{DoxyCode}


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




\subsection{\-Member \-Data \-Documentation}
\hypertarget{classBorderTrackerClass_a67a1dba87c6fcadf053cb09adfa54cb5}{\index{\-Border\-Tracker\-Class@{\-Border\-Tracker\-Class}!m\-Border\-Positions@{m\-Border\-Positions}}
\index{m\-Border\-Positions@{m\-Border\-Positions}!BorderTrackerClass@{\-Border\-Tracker\-Class}}
\subsubsection[{m\-Border\-Positions}]{\setlength{\rightskip}{0pt plus 5cm}std\-::map$<${\bf \-Position\-Type}, std\-::set$<${\bf \-Border\-Position}$>$ $>$ {\bf \-Border\-Tracker\-Class\-::m\-Border\-Positions}\hspace{0.3cm}{\ttfamily  \mbox{[}private\mbox{]}}}}\label{classBorderTrackerClass_a67a1dba87c6fcadf053cb09adfa54cb5}


\-Definition at line 24 of file \-Border\-Tracker.\-h.



\-Referenced by draw\-Debug\-Info(), get\-Border\-Positions(), recalculate\-Borders(), and update().

\hypertarget{classBorderTrackerClass_acec813539b168517fec3f2c6d4338b2c}{\index{\-Border\-Tracker\-Class@{\-Border\-Tracker\-Class}!m\-Enemy\-Bases@{m\-Enemy\-Bases}}
\index{m\-Enemy\-Bases@{m\-Enemy\-Bases}!BorderTrackerClass@{\-Border\-Tracker\-Class}}
\subsubsection[{m\-Enemy\-Bases}]{\setlength{\rightskip}{0pt plus 5cm}std\-::set$<${\bf \-Base}$>$ {\bf \-Border\-Tracker\-Class\-::m\-Enemy\-Bases}\hspace{0.3cm}{\ttfamily  \mbox{[}private\mbox{]}}}}\label{classBorderTrackerClass_acec813539b168517fec3f2c6d4338b2c}


\-Definition at line 27 of file \-Border\-Tracker.\-h.



\-Referenced by recalculate\-Borders(), and update().

\hypertarget{classBorderTrackerClass_a8e90a8bec455c471838b51c48501f245}{\index{\-Border\-Tracker\-Class@{\-Border\-Tracker\-Class}!m\-Enemy\-Border@{m\-Enemy\-Border}}
\index{m\-Enemy\-Border@{m\-Enemy\-Border}!BorderTrackerClass@{\-Border\-Tracker\-Class}}
\subsubsection[{m\-Enemy\-Border}]{\setlength{\rightskip}{0pt plus 5cm}std\-::set$<${\bf \-Chokepoint}$>$ {\bf \-Border\-Tracker\-Class\-::m\-Enemy\-Border}\hspace{0.3cm}{\ttfamily  \mbox{[}private\mbox{]}}}}\label{classBorderTrackerClass_a8e90a8bec455c471838b51c48501f245}


\-Definition at line 35 of file \-Border\-Tracker.\-h.



\-Referenced by recalculate\-Borders().

\hypertarget{classBorderTrackerClass_a47aaee7df5748f824377325c326f7ee1}{\index{\-Border\-Tracker\-Class@{\-Border\-Tracker\-Class}!m\-Enemy\-Regions@{m\-Enemy\-Regions}}
\index{m\-Enemy\-Regions@{m\-Enemy\-Regions}!BorderTrackerClass@{\-Border\-Tracker\-Class}}
\subsubsection[{m\-Enemy\-Regions}]{\setlength{\rightskip}{0pt plus 5cm}std\-::set$<${\bf \-Region}$>$ {\bf \-Border\-Tracker\-Class\-::m\-Enemy\-Regions}\hspace{0.3cm}{\ttfamily  \mbox{[}private\mbox{]}}}}\label{classBorderTrackerClass_a47aaee7df5748f824377325c326f7ee1}


\-Definition at line 31 of file \-Border\-Tracker.\-h.



\-Referenced by recalculate\-Borders().

\hypertarget{classBorderTrackerClass_a1f33f0fe3e449b4f4caabe588b07eee0}{\index{\-Border\-Tracker\-Class@{\-Border\-Tracker\-Class}!m\-Large\-Regions@{m\-Large\-Regions}}
\index{m\-Large\-Regions@{m\-Large\-Regions}!BorderTrackerClass@{\-Border\-Tracker\-Class}}
\subsubsection[{m\-Large\-Regions}]{\setlength{\rightskip}{0pt plus 5cm}std\-::set$<${\bf \-Region}$>$ {\bf \-Border\-Tracker\-Class\-::m\-Large\-Regions}\hspace{0.3cm}{\ttfamily  \mbox{[}private\mbox{]}}}}\label{classBorderTrackerClass_a1f33f0fe3e449b4f4caabe588b07eee0}


\-Definition at line 39 of file \-Border\-Tracker.\-h.



\-Referenced by on\-Begin(), recalculate\-Borders(), and update().

\hypertarget{classBorderTrackerClass_a94a7f7aa0cd114fd403d7d631d86a296}{\index{\-Border\-Tracker\-Class@{\-Border\-Tracker\-Class}!m\-My\-Bases@{m\-My\-Bases}}
\index{m\-My\-Bases@{m\-My\-Bases}!BorderTrackerClass@{\-Border\-Tracker\-Class}}
\subsubsection[{m\-My\-Bases}]{\setlength{\rightskip}{0pt plus 5cm}std\-::set$<${\bf \-Base}$>$ {\bf \-Border\-Tracker\-Class\-::m\-My\-Bases}\hspace{0.3cm}{\ttfamily  \mbox{[}private\mbox{]}}}}\label{classBorderTrackerClass_a94a7f7aa0cd114fd403d7d631d86a296}


\-Definition at line 26 of file \-Border\-Tracker.\-h.



\-Referenced by recalculate\-Borders(), and update().

\hypertarget{classBorderTrackerClass_a276b68793ba3b62777da2b8b789fefbb}{\index{\-Border\-Tracker\-Class@{\-Border\-Tracker\-Class}!m\-My\-Border@{m\-My\-Border}}
\index{m\-My\-Border@{m\-My\-Border}!BorderTrackerClass@{\-Border\-Tracker\-Class}}
\subsubsection[{m\-My\-Border}]{\setlength{\rightskip}{0pt plus 5cm}std\-::set$<${\bf \-Chokepoint}$>$ {\bf \-Border\-Tracker\-Class\-::m\-My\-Border}\hspace{0.3cm}{\ttfamily  \mbox{[}private\mbox{]}}}}\label{classBorderTrackerClass_a276b68793ba3b62777da2b8b789fefbb}


\-Definition at line 33 of file \-Border\-Tracker.\-h.



\-Referenced by recalculate\-Borders().

\hypertarget{classBorderTrackerClass_a44983353e2d14ee518967308dcd185fc}{\index{\-Border\-Tracker\-Class@{\-Border\-Tracker\-Class}!m\-My\-Forward\-Border@{m\-My\-Forward\-Border}}
\index{m\-My\-Forward\-Border@{m\-My\-Forward\-Border}!BorderTrackerClass@{\-Border\-Tracker\-Class}}
\subsubsection[{m\-My\-Forward\-Border}]{\setlength{\rightskip}{0pt plus 5cm}std\-::set$<${\bf \-Chokepoint}$>$ {\bf \-Border\-Tracker\-Class\-::m\-My\-Forward\-Border}\hspace{0.3cm}{\ttfamily  \mbox{[}private\mbox{]}}}}\label{classBorderTrackerClass_a44983353e2d14ee518967308dcd185fc}


\-Definition at line 34 of file \-Border\-Tracker.\-h.



\-Referenced by recalculate\-Borders().

\hypertarget{classBorderTrackerClass_ac5ae40bafb8b545d5170333e7235f9cd}{\index{\-Border\-Tracker\-Class@{\-Border\-Tracker\-Class}!m\-My\-Forward\-Regions@{m\-My\-Forward\-Regions}}
\index{m\-My\-Forward\-Regions@{m\-My\-Forward\-Regions}!BorderTrackerClass@{\-Border\-Tracker\-Class}}
\subsubsection[{m\-My\-Forward\-Regions}]{\setlength{\rightskip}{0pt plus 5cm}std\-::set$<${\bf \-Region}$>$ {\bf \-Border\-Tracker\-Class\-::m\-My\-Forward\-Regions}\hspace{0.3cm}{\ttfamily  \mbox{[}private\mbox{]}}}}\label{classBorderTrackerClass_ac5ae40bafb8b545d5170333e7235f9cd}


\-Definition at line 30 of file \-Border\-Tracker.\-h.



\-Referenced by recalculate\-Borders().

\hypertarget{classBorderTrackerClass_a24f7a0ee4735f7606c5a9e033b049e93}{\index{\-Border\-Tracker\-Class@{\-Border\-Tracker\-Class}!m\-My\-Regions@{m\-My\-Regions}}
\index{m\-My\-Regions@{m\-My\-Regions}!BorderTrackerClass@{\-Border\-Tracker\-Class}}
\subsubsection[{m\-My\-Regions}]{\setlength{\rightskip}{0pt plus 5cm}std\-::set$<${\bf \-Region}$>$ {\bf \-Border\-Tracker\-Class\-::m\-My\-Regions}\hspace{0.3cm}{\ttfamily  \mbox{[}private\mbox{]}}}}\label{classBorderTrackerClass_a24f7a0ee4735f7606c5a9e033b049e93}


\-Definition at line 29 of file \-Border\-Tracker.\-h.



\-Referenced by recalculate\-Borders().

\hypertarget{classBorderTrackerClass_a423b1907b2c448a2e75090fe31fa57de}{\index{\-Border\-Tracker\-Class@{\-Border\-Tracker\-Class}!m\-Show\-Debug\-Info@{m\-Show\-Debug\-Info}}
\index{m\-Show\-Debug\-Info@{m\-Show\-Debug\-Info}!BorderTrackerClass@{\-Border\-Tracker\-Class}}
\subsubsection[{m\-Show\-Debug\-Info}]{\setlength{\rightskip}{0pt plus 5cm}bool {\bf \-Border\-Tracker\-Class\-::m\-Show\-Debug\-Info}\hspace{0.3cm}{\ttfamily  \mbox{[}private\mbox{]}}}}\label{classBorderTrackerClass_a423b1907b2c448a2e75090fe31fa57de}


\-Definition at line 37 of file \-Border\-Tracker.\-h.



\-Referenced by toggle\-Debug\-Info(), and update().



\-The documentation for this class was generated from the following files\-:\begin{DoxyCompactItemize}
\item 
\-Skynet/\-Skynet/\hyperlink{BorderTracker_8h}{\-Border\-Tracker.\-h}\item 
\-Skynet/\-Skynet/\hyperlink{BorderTracker_8cpp}{\-Border\-Tracker.\-cpp}\end{DoxyCompactItemize}
