File indexing completed on 2025-01-26 04:25:02
0001 // 0002 // Created by gabridc on 5/6/21. 0003 // 0004 #include "city.h" 0005 0006 City::City(const QString &cityID, const QString &name, const QString &continent, const QString &country, const double &latitude, const double &longitude, QObject *parent) : QObject(parent) 0007 , m_cityID(cityID) 0008 , m_name(name) 0009 , m_continent(continent) 0010 , m_country(country) 0011 , m_latitude(latitude) 0012 , m_longitude(longitude) 0013 0014 { 0015 0016 } 0017 0018 City::City(QObject* parent) : QObject(parent) 0019 { 0020 } 0021 0022 QString City::id() const 0023 { 0024 return m_cityID; 0025 } 0026 0027 QString City::name() const 0028 { 0029 return m_name; 0030 } 0031 0032 QString City::continent() const 0033 { 0034 return m_continent; 0035 } 0036 0037 QString City::country() const 0038 { 0039 return m_country; 0040 } 0041 0042 bool City::isValid() const 0043 { 0044 return !m_cityID.isEmpty(); 0045 } 0046 0047 bool City::match(double latitude, double longitude) 0048 { 0049 if(m_latitude == latitude && m_longitude == longitude) 0050 { 0051 return true; 0052 } 0053 0054 return false; 0055 }