mirror of
https://github.com/azaion/autopilot.git
synced 2026-04-22 21:36:34 +00:00
45c19baa45
- autopilot -> drone_controller - rtsp_ai_player -> ai_controller - added top level qmake project file - updated documentation - moved small demo applications from tmp/ to misc/
69 lines
1.5 KiB
C++
69 lines
1.5 KiB
C++
#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;
|
|
}
|