/* * SPDX-FileName: atc_mgr.hxx * SPDX-FileComment: Started August 1, 2010; based on earlier work by David C. Luff * SPDX-FileCopyrightText: Written by Durk Talsma. * SPDX-FileContributor: Updated by Jonathan Redpath. Started June 12, 2019. Documenting and extending functionality of the ATC subsystem * SPDX-License-Identifier: GPL-2.0-or-later */ /************************************************************************** * The ATC Manager interfaces the users aircraft within the AI traffic system * and also monitors the ongoing AI traffic patterns for potential conflicts * and interferes where necessary. *************************************************************************/ #pragma once #include #include #include #include #include #include typedef std::vector AtcVec; typedef std::vector::iterator AtcVecIterator; /** * This subsystem performs two tasks. It provides the ATC controllers for the AI aircraft * and shaddows the users aircraft and does the basic ATC and AI interaction. */ class FGATCManager : public SGSubsystem { private: AtcVec activeStations; FGATCController *controller; FGATCController *prevController; // The ATC controller that is responsible for the user's aircraft. bool networkVisible = false; bool initSucceeded = false; SGPropertyNode_ptr transNum; SGPropertyNode_ptr splashAlpha; double startTime = 0.0; std::string destination; std::unique_ptr userAircraftTrafficRef; std::unique_ptr userAircraftScheduledFlight; SGPropertyNode_ptr _routeManagerDestinationAirportNode; public: FGATCManager(); virtual ~FGATCManager(); // Subsystem API. void postinit() override; void shutdown() override; void update(double time) override; // Subsystem identification. static const char* staticSubsystemClassId() { return "ATC"; } void addController(FGATCController* controller); void removeController(FGATCController* controller); void reposition(); private: void initControllers(); void signalReady(); };