mirror of
https://github.com/azaion/autopilot.git
synced 2026-04-22 08:26:33 +00:00
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/
This commit is contained in:
@@ -0,0 +1,68 @@
|
||||
#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;
|
||||
}
|
||||
Reference in New Issue
Block a user