Files
autopilot/drone_controller/az_action_point.cpp
T
Tuomas Järvinen 45c19baa45 Changed directory structure and renamed applications
- autopilot -> drone_controller
- rtsp_ai_player -> ai_controller
- added top level qmake project file
- updated documentation
- moved small demo applications from tmp/ to misc/
2024-10-19 14:44:34 +02:00

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;
}