BWAPI
Public Member Functions | Public Attributes
PositionPath Class Reference

#include <PositionPath.h>

List of all members.

Public Member Functions

 PositionPath ()
void addNode (Position pos)
void drawPath ()
int getLength ()

Public Attributes

bool isComplete
std::list< Positionpath

Detailed Description

Definition at line 5 of file PositionPath.h.


Constructor & Destructor Documentation

Definition at line 3 of file PositionPath.cpp.

        : isComplete(false)
{
}

Member Function Documentation

Definition at line 8 of file PositionPath.cpp.

References path.

Referenced by PathFinderClass::CreateCheapWalkPath().

{
        path.push_front(pos);
}

Here is the caller graph for this function:

Definition at line 13 of file PositionPath.cpp.

References BWAPI::Broodwar, BWAPI::Game::drawLineMap(), BWAPI::Positions::None, BWAPI::BulletTypes::None, path, BWAPI::Position::x(), BWAPI::Position::y(), and BWAPI::Colors::Yellow.

{
        Position previousPosition = BWAPI::Positions::None;
        for each(const Position &pos in path)
        {
                if(previousPosition != BWAPI::Positions::None)
                        BWAPI::Broodwar->drawLineMap(pos.x(), pos.y(), previousPosition.x(), previousPosition.y(), BWAPI::Colors::Yellow);

                previousPosition = pos;
        }
}

Here is the call graph for this function:

Definition at line 25 of file PositionPath.cpp.

References BWAPI::Position::getApproxDistance(), BWAPI::Positions::None, BWAPI::BulletTypes::None, and path.

{
        int totalLength = 0;
        Position previousPosition = BWAPI::Positions::None;
        for each(const Position &pos in path)
        {
                if(previousPosition != BWAPI::Positions::None)
                        totalLength += pos.getApproxDistance(previousPosition);

                previousPosition = pos;
        }

        return totalLength;
}

Here is the call graph for this function:


Member Data Documentation

Definition at line 12 of file PositionPath.h.

Referenced by PathFinderClass::CreateCheapWalkPath().

Definition at line 16 of file PositionPath.h.

Referenced by addNode(), PathFinderClass::CreateCheapWalkPath(), drawPath(), and getLength().


The documentation for this class was generated from the following files:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines