]> git.mxchange.org Git - flightgear.git/blobdiff - src/ATC/ATC.hxx
This innocuous looking typo was crashing the sim whenever an AI plane was asked to...
[flightgear.git] / src / ATC / ATC.hxx
index c6c689a8d77138df00524d9d0a51397f03c0af12..0ea9d9c919dbbc7bed13e63482e8d59b29240fcd 100644 (file)
@@ -17,7 +17,7 @@
 //
 // You should have received a copy of the GNU General Public License
 // along with this program; if not, write to the Free Software
-// Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
 
 #ifndef _FG_ATC_HXX
 #define _FG_ATC_HXX
@@ -117,7 +117,7 @@ public:
        virtual void ReceiveUserCallback(int code);
        
        // Add plane to a stack
-       virtual void AddPlane(string pid);
+       virtual void AddPlane(const string& pid);
        
        // Remove plane from stack
        virtual int RemovePlane();
@@ -136,9 +136,9 @@ public:
        // Indicate that the frequency is in use
        inline void SetFreqInUse() { freqClear = false; receiving = true; }
        // Transmission to the ATC is finished and a response is required
-       void SetResponseReqd(string rid);
+       void SetResponseReqd(const string& rid);
        // Transmission finished - let ATC decide if a response is reqd and clear freq if necessary
-       void NotifyTransmissionFinished(string rid);
+       void NotifyTransmissionFinished(const string& rid);
        // Transmission finished and no response required
        inline void ReleaseFreq() { freqClear = true; receiving = false; }      // TODO - check that the plane releasing the freq is the right one etc.
        // The above 3 funcs under development!!
@@ -169,10 +169,10 @@ public:
        inline void set_freq(const int fq) {freq = fq;}
        inline int get_range() const { return range; }
        inline void set_range(const int rg) {range = rg;}
-       inline string get_ident() { return ident; }
-       inline void set_ident(const string id) { ident = id; }
-       inline string get_name() { return name; }
-       inline void set_name(const string nm) { name = nm; }
+       inline const string& get_ident() { return ident; }
+       inline void set_ident(const string& id) { ident = id; }
+       inline const string& get_name() { return name; }
+       inline void set_name(const string& nm) { name = nm; }
        
 protected:
        
@@ -180,11 +180,11 @@ protected:
        // Outputs the transmission either on screen or as audio depending on user preference
        // The refname is a string to identify this sample to the sound manager
        // The repeating flag indicates whether the message should be repeated continuously or played once.
-       void Render(string msg, string refname, bool repeating);
+       void Render(string& msg, const string& refname = "", bool repeating = false);
        
-       // Cease rendering a transmission.
+       // Cease rendering all transmission from this station.
        // Requires the sound manager refname if audio, else "".
-       void NoRender(string refname);
+       void NoRender(const string& refname);
        
        // Transmit a message when channel becomes free of other dialog
     void Transmit(int callback_code = 0);
@@ -206,10 +206,10 @@ protected:
        atc_type _type;
        
        // Rendering related stuff
-       bool voice;                     // Flag - true if we are using voice
-       bool playing;           // Indicates a message in progress      
-       bool voiceOK;           // Flag - true if at least one voice has loaded OK
-       FGATCVoice* vPtr;
+       bool _voice;                    // Flag - true if we are using voice
+       bool _playing;          // Indicates a message in progress      
+       bool _voiceOK;          // Flag - true if at least one voice has loaded OK
+       FGATCVoice* _vPtr;
 
        string pending_transmission;    // derived classes set this string before calling Transmit(...) 
        bool freqClear;         // Flag to indicate if the frequency is clear of ongoing dialog