Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <QCoreApplication>
- #include <QDebug>
- #include <QString>
- class Target
- {
- protected:
- QString m_targetType;
- QString m_attribute;
- double m_velocity;
- double m_range;
- double m_elevationAngle;
- double m_azimuthAngle;
- public:
- Target(QString targetType = "Unknown",
- QString attribute = "Unknown",
- double velosity = 0,
- double range = 0,
- double elevetionAngle = 0,
- double azimuthAngle = 0)
- : m_targetType(targetType), m_attribute(attribute), m_velocity(velosity), m_range(range),
- m_elevationAngle(elevetionAngle), m_azimuthAngle(azimuthAngle)
- {
- /*m_targetType = targetType;
- m_attribute = attribute;
- m_velocity = velosity;
- m_range = range;
- m_elevationAngle = elevetionAngle;
- m_azimuthAngle = azimuthAngle;*/
- }
- void setTargetType(QString targetType)
- {
- m_targetType = targetType;
- }
- void getTargetInformation()
- {
- qDebug() << "Общие характеристики цели";
- qDebug() << "Тип цели" << m_targetType << "Признак свой-чужой" << m_attribute << "Скорость" << m_velocity << "Дальность до цели" << m_range << "Угол места" << m_elevationAngle << "Угол азимута" << m_azimuthAngle;
- }
- void setFriendOrStranger(QString attribute) {
- if (!attribute.compare("Friend")||!attribute.compare("Stranger"))
- m_attribute = attribute;
- else
- qDebug() << "Incorrect attribute";
- }
- };
- class Nurs : public Target
- {
- private:
- QString m_Nursname;
- double m_caliber;
- QString m_filler;
- int m_hazardRank = 2;
- public:
- Nurs(QString targetType = "",
- QString attribute = "",
- double velocity = 0,
- double range = 0,
- double elevetionAngle = 0,
- double azimuthAngle = 0,
- QString Nursname = "",
- double caliber = 0,
- QString filler = "") : Target (targetType, attribute, velocity, range, elevetionAngle, azimuthAngle),
- m_Nursname(Nursname), m_caliber(caliber), m_filler(filler)
- {
- /*m_Nursname = Nursname;
- m_caliber = caliber;
- m_filler = filler;*/
- }
- };
- class Plane : public Target
- {
- private:
- QString m_planeName;
- double m_maxVelocity;
- QString m_type;
- int m_hazardRank = 3;
- public:
- Plane(QString targetType = "",
- QString attribute = "",
- double velocity = 0,
- double range = 0,
- double elevetionAngle = 0,
- double azimuthAngle = 0,
- QString planeName = "",
- double maxVelocity = 0,
- QString type = "") : Target (targetType, attribute, velocity, range, elevetionAngle, azimuthAngle),
- m_planeName(planeName), m_maxVelocity(maxVelocity), m_type(type)
- {
- }
- };
- class BPLA : public Target
- {
- private:
- QString m_BPLAname;
- QString m_type;
- int m_hazardRank = 4;
- public:
- BPLA(QString targetType = "",
- QString attribute = "",
- double velocity = 0,
- double range = 0,
- double elevetionAngle = 0,
- double azimuthAngle = 0,
- QString BPLAname = "",
- QString type = "") : Target (targetType, attribute, velocity, range, elevetionAngle, azimuthAngle),
- m_BPLAname(BPLAname), m_type(type)
- {
- }
- void getInformation()
- {
- }
- };
- class Rocket : public Target
- {
- private:
- QString m_rocketName;
- QString m_filler;
- double m_maxVelocity;
- double m_maxHieght;
- int m_hazardRank = 1;
- public:
- Rocket(QString targetType = "",
- QString attribute = "",
- double velocity = 0,
- double range = 0,
- double elevetionAngle = 0,
- double azimuthAngle = 0,
- QString rocketName = "",
- QString filler = "",
- double maxVelocity = 0,
- double maxHieght = 0) : Target (targetType, attribute, velocity, range, elevetionAngle, azimuthAngle),
- m_rocketName(rocketName), m_filler(filler), m_maxVelocity(maxVelocity), m_maxHieght(maxHieght)
- {
- }
- void getInformation()
- {
- }
- };
- int main()
- {
- Rocket R_9M83("Rocket", "Friendly", 2000, 2000, 30, 20, "R_9M83", "Бризант", 5000, 7000);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement