]> git.mxchange.org Git - flightgear.git/blob - src/Airports/parking.hxx
make headers include headers they depend on, don't rely on the c(xx)
[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
38 SG_USING_STD(string);
39 SG_USING_STD(vector);
40
41 double processPosition(const string& pos);
42
43 class FGParking {
44 private:
45   double latitude;
46   double longitude;
47   double heading;
48   double radius;
49   int index;
50   string parkingName;
51   string type;
52   string airlineCodes;
53  
54   bool available;
55
56   
57
58 public:
59   FGParking() { available = true;};
60   //FGParking(FGParking &other);
61   FGParking(double lat,
62             double lon,
63             double hdg,
64             double rad,
65             int idx,
66             const string& name,
67             const string& tpe,
68             const string& codes);
69   void setLatitude (const string& lat)  { latitude    = processPosition(lat);  };
70   void setLongitude(const string& lon)  { longitude   = processPosition(lon);  };
71   void setHeading  (double hdg)  { heading     = hdg;  };
72   void setRadius   (double rad)  { radius      = rad;  };
73   void setIndex    (int    idx)  { index       = idx;  };
74   void setName     (const string& name) { parkingName = name; };
75   void setType     (const string& tpe)  { type        = tpe;  };
76   void setCodes    (const string& codes){ airlineCodes= codes;};
77
78   bool isAvailable ()         { return available;};
79   void setAvailable(bool val) { available = val; };
80   
81   double getLatitude () { return latitude;    };
82   double getLongitude() { return longitude;   };
83   double getHeading  () { return heading;     };
84   double getRadius   () { return radius;      };
85   int    getIndex    () { return index;       };
86   string getType     () { return type;        };
87   string getCodes    () { return airlineCodes;};
88   string getName     () { return parkingName; };
89
90   bool operator< (const FGParking &other) const {return radius < other.radius; };
91 };
92
93 typedef vector<FGParking> FGParkingVec;
94 typedef vector<FGParking>::iterator FGParkingVecIterator;
95 typedef vector<FGParking>::const_iterator FGParkingVecConstIterator;
96
97 #endif