#include "az_action_point.h" AzActionPoint::AzActionPoint( const AzCoordinate &point, int height, AzActionPointType actionPointType, uint actionSpesific) : mPoint(point) , mHeight(height) , mType(actionPointType) , mActionSpesific(actionSpesific) {} AzCoordinate AzActionPoint::getPoint(void) const { return mPoint; } int AzActionPoint::getHeight(void) const { return mHeight; } AzActionPointType AzActionPoint::getType(void) const { return mType; } string AzActionPoint::getTypeStr(void) const { static const string typeStrs[] = {"None", "Waypoint", "Search", "Return"}; return typeStrs[mType]; } string AzActionPoint::getActionSpecificStr(void) const { if (isTank() == true && isArtillery() == true) { return "tank or artillery"; } else if (isTank() == true) { return "tank"; } else if (isArtillery() == true) { return "artillery"; } else { return "none"; } } bool AzActionPoint::isTank(void) const { return mActionSpesific & AZ_ACTION_SPECIFIC_TANK; } bool AzActionPoint::isArtillery(void) const { return mActionSpesific & AZ_ACTION_SPECIFIC_ARTILLERY; } ostream &operator<<(ostream &os, const AzActionPoint &obj) { os << "Point: " << obj.mPoint << endl; os << "Height: " << obj.mHeight << endl; os << "Type: " << obj.getTypeStr() << endl; // TODO!! This is braindead. os << "Action specific type: " + obj.getActionSpecificStr() << endl; return os; }