]> git.mxchange.org Git - flightgear.git/blob - src/Airports/parking.hxx
initialize release_keys array
[flightgear.git] / src / Airports / parking.hxx
1 // parking.hxx - A class to handle airport startup locations in
2 // FlightGear. This code is intended to be used by AI code and
3 // initial user-startup location selection.
4 //
5 // Written by Durk Talsma, started December 2004.
6 //
7 // Copyright (C) 2004 Durk Talsma.
8 //
9 // This program is free software; you can redistribute it and/or
10 // modify it under the terms of the GNU General Public License as
11 // published by the Free Software Foundation; either version 2 of the
12 // License, or (at your option) any later version.
13 //
14 // This program is distributed in the hope that it will be useful, but
15 // WITHOUT ANY WARRANTY; without even the implied warranty of
16 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
17 // General Public License for more details.
18 //
19 // You should have received a copy of the GNU General Public License
20 // along with this program; if not, write to the Free Software
21 // Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
22 //
23 // $Id$
24
25 #ifndef _PARKING_HXX_
26 #define _PARKING_HXX_
27
28 #ifndef __cplusplus
29 # error This library requires C++
30 #endif
31
32 #include <simgear/compiler.h>
33
34 #include STL_STRING
35 #include <vector>
36
37 #include "gnnode.hxx"
38
39 SG_USING_STD(string);
40 SG_USING_STD(vector);
41
42 class FGTaxiRoute;
43
44
45 class FGParking : public FGTaxiNode {
46 private:
47   double heading;
48   double radius;
49   string parkingName;
50   string type;
51   string airlineCodes;
52  
53   bool available;
54   int pushBackPoint;
55   FGTaxiRoute *pushBackRoute;
56
57 public:
58   FGParking() :
59       heading(0),
60       radius(0),
61       //parkingName(0),
62       //type(0),
63       //airlineCodes(0),
64       available(true),
65       pushBackPoint(-1),
66       pushBackRoute(0)
67   {
68   };
69
70   FGParking(const FGParking &other) :
71       FGTaxiNode   (other),
72       heading      (other.heading),
73       radius       (other.radius),
74       parkingName  (other.parkingName),
75       type         (other.type),
76       airlineCodes (other.airlineCodes),
77       available    (other.available),
78       pushBackPoint(other.pushBackPoint),
79       pushBackRoute(other.pushBackRoute)
80   {
81   };
82
83
84   FGParking& operator =(const FGParking &other)
85   {
86       FGTaxiNode::operator=(other);
87       heading      = other.heading;
88       radius       = other.radius;
89       parkingName  = other.parkingName;
90       type         = other.type;
91       airlineCodes = other.airlineCodes;
92       available    = other.available;
93       pushBackPoint= other.pushBackPoint;
94       pushBackRoute= other.pushBackRoute;
95       return *this;
96   };
97   ~FGParking();
98 //   FGParking(double lat,
99 //          double lon,
100 //          double hdg,
101 //          double rad,
102 //          int idx,
103 //          const string& name,
104 //          const string& tpe,
105 //          const string& codes);
106
107   void setHeading  (double hdg)  { heading     = hdg;  };
108   void setRadius   (double rad)  { radius      = rad;  };
109
110   void setName     (const string& name) { parkingName = name; };
111   void setType     (const string& tpe)  { type        = tpe;  };
112   void setCodes    (const string& codes){ airlineCodes= codes;};
113
114   void setPushBackRoute(FGTaxiRoute *val) { pushBackRoute = val; };
115   void setPushBackPoint(int val)          { pushBackPoint = val; };
116
117   bool isAvailable ()         { return available;};
118   void setAvailable(bool val) { available = val; };
119   
120   double getHeading  () { return heading;     };
121   double getRadius   () { return radius;      };
122
123   string getType     () { return type;        };
124   string getCodes    () { return airlineCodes;};
125   string getName     () { return parkingName; };
126
127   FGTaxiRoute * getPushBackRoute () { return pushBackRoute; };
128
129   int getPushBackPoint () { return pushBackPoint; };
130
131   bool operator< (const FGParking &other) const {
132     return radius < other.radius; };
133 };
134
135 typedef vector<FGParking> FGParkingVec;
136 typedef vector<FGParking>::iterator FGParkingVecIterator;
137 typedef vector<FGParking>::const_iterator FGParkingVecConstIterator;
138
139 #endif