void FGATCManager::shutdown()
{
- delete ai_ac;
- ai_ac = NULL;
+ ai_ac.clear();
activeStations.clear();
}
{
private:
AtcVec activeStations;
- FGAIAircraft* ai_ac;
+ SGSharedPtr<FGAIAircraft> ai_ac;
FGATCController *controller, *prevController; // The ATC controller that is responsible for the user's aircraft.
bool networkVisible;
bool initSucceeded;
allowPushback(true),
priority(0),
timer(0),
- latitude(0), longitude(0), heading(0), speed(0), altitude(0), radius(0),
- aircraft(NULL)
+ latitude(0), longitude(0), heading(0), speed(0), altitude(0), radius(0)
+{
+}
+
+FGTrafficRecord::~FGTrafficRecord()
{
}
}
}
}
+
+void FGTrafficRecord::setAircraft(FGAIAircraft *ref)
+{
+ aircraft = ref;
+}
+
+FGAIAircraft* FGTrafficRecord::getAircraft() const
+{
+ return aircraft.ptr();
+}
+
/**
* Check if another aircraft is ahead of the current one, and on the same
* return true / false is the is/isn't the case.
FGATCInstruction instruction;
double latitude, longitude, heading, speed, altitude, radius;
std::string runway;
- //FGAISchedule *trafficRef;
- FGAIAircraft *aircraft;
+ SGSharedPtr<FGAIAircraft> aircraft;
public:
FGTrafficRecord();
+ virtual ~FGTrafficRecord();
void setId(int val) {
id = val;
return runway;
};
//void setCallSign(string clsgn) { callsign = clsgn; };
- void setAircraft(FGAIAircraft *ref) {
- aircraft = ref;
- };
+ void setAircraft(FGAIAircraft *ref);
+
void updateState() {
state++;
allowTransmission=true;
};
//string getCallSign() { return callsign; };
- FGAIAircraft *getAircraft() const {
- return aircraft;
- };
+ FGAIAircraft *getAircraft() const;
+
int getTime() const {
return timer;
};