]> git.mxchange.org Git - flightgear.git/blob - src/Airports/parking.hxx
1d009c03cacbad84996188ec4b8af12b2e1685a5
[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 <string>
35 #include <vector>
36
37 #include "gnnode.hxx"
38
39 class FGTaxiRoute;
40
41
42 class FGParking : public FGTaxiNode {
43 private:
44   double heading;
45   double radius;
46   std::string parkingName;
47   std::string type;
48   std::string airlineCodes;
49  
50   bool available;
51   int pushBackPoint;
52   FGTaxiRoute *pushBackRoute;
53
54 public:
55   FGParking() :
56       heading(0),
57       radius(0),
58       available(true),
59       pushBackPoint(0),
60       pushBackRoute(0)
61   {
62   };
63
64   FGParking(const FGParking &other) :
65       FGTaxiNode   (other),
66       heading      (other.heading),
67       radius       (other.radius),
68       parkingName  (other.parkingName),
69       type         (other.type),
70       airlineCodes (other.airlineCodes),
71       available    (other.available),
72       pushBackPoint(other.pushBackPoint),
73       pushBackRoute(other.pushBackRoute)
74   {
75   };
76
77
78   FGParking& operator =(const FGParking &other)
79   {
80       FGTaxiNode::operator=(other);
81       heading      = other.heading;
82       radius       = other.radius;
83       parkingName  = other.parkingName;
84       type         = other.type;
85       airlineCodes = other.airlineCodes;
86       available    = other.available;
87       pushBackPoint= other.pushBackPoint;
88       pushBackRoute= other.pushBackRoute;
89       return *this;
90   };
91   ~FGParking();
92
93   void setHeading  (double hdg)  { heading     = hdg;  };
94   void setRadius   (double rad)  { radius      = rad;  };
95
96   void setName     (const std::string& name) { parkingName = name; };
97   void setType     (const std::string& tpe)  { type        = tpe;  };
98   void setCodes    (const std::string& codes){ airlineCodes= codes;};
99
100   void setPushBackRoute(FGTaxiRoute *val) { pushBackRoute = val; };
101   void setPushBackPoint(int val)          { pushBackPoint = val; };
102
103   bool isAvailable ()   const { return available;};
104   void setAvailable(bool val) { available = val; };
105   
106   double getHeading  () const { return heading;     };
107   double getRadius   () const { return radius;      };
108
109   std::string getType     () const { return type;        };
110   std::string getCodes    () const { return airlineCodes;};
111   std::string getName     () const { return parkingName; };
112
113   FGTaxiRoute * getPushBackRoute () { return pushBackRoute; };
114
115   int getPushBackPoint () { return pushBackPoint; };
116
117   bool operator< (const FGParking &other) const {
118     return radius < other.radius; };
119 };
120
121 typedef std::vector<FGParking> FGParkingVec;
122 typedef std::vector<FGParking>::iterator FGParkingVecIterator;
123 typedef std::vector<FGParking>::const_iterator FGParkingVecConstIterator;
124
125 #endif