1
0
Fork 0

Return landing type. Simple AIPlane always returns full stop for now - more advanced classes are expected to override this if required. Also give some enums an ostream operator

This commit is contained in:
daveluff 2003-09-22 23:53:56 +00:00
parent adce42cef6
commit 98a752d9e7
2 changed files with 51 additions and 0 deletions

View file

@ -74,3 +74,40 @@ void FGAIPlane::Transmit(string msg) {
void FGAIPlane::RegisterTransmission(int code) { void FGAIPlane::RegisterTransmission(int code) {
} }
// Return what type of landing we're doing on this circuit
LandingType FGAIPlane::GetLandingOption() {
return(FULL_STOP);
}
ostream& operator << (ostream& os, PatternLeg pl) {
switch(pl) {
case(TAKEOFF_ROLL): return(os << "TAKEOFF ROLL");
case(CLIMBOUT): return(os << "CLIMBOUT");
case(TURN1): return(os << "TURN1");
case(CROSSWIND): return(os << "CROSSWIND");
case(TURN2): return(os << "TURN2");
case(DOWNWIND): return(os << "DOWNWIND");
case(TURN3): return(os << "TURN3");
case(BASE): return(os << "BASE");
case(TURN4): return(os << "TURN4");
case(FINAL): return(os << "FINAL");
case(LANDING_ROLL): return(os << "LANDING ROLL");
case(LEG_UNKNOWN): return(os << "UNKNOWN");
}
return(os << "ERROR - Unknown switch in PatternLeg operator << ");
}
ostream& operator << (ostream& os, LandingType lt) {
switch(lt) {
case(FULL_STOP): return(os << "FULL STOP");
case(STOP_AND_GO): return(os << "STOP AND GO");
case(TOUCH_AND_GO): return(os << "TOUCH AND GO");
case(AIP_LT_UNKNOWN): return(os << "UNKNOWN");
}
return(os << "ERROR - Unknown switch in LandingType operator << ");
}

View file

@ -44,6 +44,17 @@ enum PatternLeg {
LEG_UNKNOWN LEG_UNKNOWN
}; };
ostream& operator << (ostream& os, PatternLeg pl);
enum LandingType {
FULL_STOP,
STOP_AND_GO,
TOUCH_AND_GO,
AIP_LT_UNKNOWN
};
ostream& operator << (ostream& os, LandingType lt);
/***************************************************************** /*****************************************************************
* *
* FGAIPlane - this class is derived from FGAIEntity and adds the * FGAIPlane - this class is derived from FGAIEntity and adds the
@ -70,6 +81,9 @@ public:
// Return the current pattern leg the plane is flying. // Return the current pattern leg the plane is flying.
inline PatternLeg GetLeg() {return leg;} inline PatternLeg GetLeg() {return leg;}
// Return what type of landing we're doing on this circuit
LandingType GetLandingOption();
protected: protected:
PlaneRec plane; PlaneRec plane;