Format
This commit is contained in:
@@ -34,16 +34,16 @@ namespace file
|
||||
{
|
||||
private:
|
||||
std::string designator;
|
||||
struct germanairlinesva::geodata::point center;
|
||||
struct geodata::point center;
|
||||
std::uint8_t radius;
|
||||
|
||||
public:
|
||||
Gate(std::string designator,
|
||||
struct germanairlinesva::geodata::point center,
|
||||
struct geodata::point center,
|
||||
std::uint8_t radius);
|
||||
|
||||
void toFile(std::ofstream &out) const;
|
||||
bool contains(germanairlinesva::geodata::point coordinates) const;
|
||||
bool contains(geodata::point coordinates) const;
|
||||
|
||||
inline const std::string to_string() const
|
||||
{
|
||||
|
||||
@@ -34,7 +34,7 @@ namespace file
|
||||
{
|
||||
private:
|
||||
std::string designator;
|
||||
struct germanairlinesva::geodata::box bounds;
|
||||
struct geodata::box bounds;
|
||||
std::uint8_t width;
|
||||
std::uint16_t length;
|
||||
std::uint16_t trueHeading;
|
||||
@@ -50,7 +50,7 @@ namespace file
|
||||
double width);
|
||||
// From database
|
||||
Runway(std::string designator,
|
||||
struct germanairlinesva::geodata::box bounds,
|
||||
struct geodata::box bounds,
|
||||
std::uint8_t width,
|
||||
std::uint16_t length,
|
||||
std::uint16_t trueHeading);
|
||||
|
||||
@@ -42,10 +42,7 @@ namespace file
|
||||
class SimDatabase
|
||||
{
|
||||
private:
|
||||
std::map<
|
||||
std::string,
|
||||
std::pair<std::vector<germanairlinesva::file::simdata::Gate>,
|
||||
std::vector<germanairlinesva::file::simdata::Runway>>>
|
||||
std::map<std::string, std::pair<std::vector<Gate>, std::vector<Runway>>>
|
||||
airports;
|
||||
|
||||
void fromFile();
|
||||
@@ -64,11 +61,11 @@ namespace file
|
||||
const std::vector<Runway>>
|
||||
operator[](std::string key)
|
||||
{
|
||||
try {
|
||||
return this->airports.at(key);
|
||||
} catch (std::out_of_range &ex) {
|
||||
return std::pair<const std::vector<Gate>,
|
||||
const std::vector<Runway>>();
|
||||
auto it = this->airports.find(key);
|
||||
if (it != this->airports.end()) {
|
||||
return this->airports[key];
|
||||
} else {
|
||||
return std::pair<std::vector<Gate>, std::vector<Runway>>();
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
@@ -20,15 +20,13 @@ namespace file
|
||||
const std::string defaultFile,
|
||||
const std::string sceneryPack,
|
||||
const std::string logFile,
|
||||
std::map<std::string,
|
||||
std::pair<std::vector<Gate>, std::vector<Runway>>>
|
||||
std::map<std::string, std::pair<std::vector<Gate>, std::vector<Runway>>>
|
||||
&airports);
|
||||
|
||||
void makeAirport(
|
||||
const std::string &kind,
|
||||
std::ifstream &infile,
|
||||
std::map<std::string,
|
||||
std::pair<std::vector<Gate>, std::vector<Runway>>>
|
||||
std::map<std::string, std::pair<std::vector<Gate>, std::vector<Runway>>>
|
||||
&airports,
|
||||
std::ofstream &logfile);
|
||||
void makeGate15(std::vector<Gate> &gates,
|
||||
|
||||
Reference in New Issue
Block a user