mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-03-22 06:45:37 +08:00
62 lines
1.6 KiB
C++
62 lines
1.6 KiB
C++
// SPDX-FileCopyrightText: Copyright (C) 2014 swift Project Community / Contributors
|
|
// SPDX-License-Identifier: GPL-3.0-or-later OR LicenseRef-swift-pilot-client-1
|
|
|
|
//! \file
|
|
|
|
#ifndef SWIFT_MISC_AVIATION_AIRCRAFTENGINES_H
|
|
#define SWIFT_MISC_AVIATION_AIRCRAFTENGINES_H
|
|
|
|
#include "misc/metaclass.h"
|
|
#include "misc/valueobject.h"
|
|
#include "misc/swiftmiscexport.h"
|
|
|
|
#include <QMetaType>
|
|
#include <QString>
|
|
|
|
SWIFT_DECLARE_VALUEOBJECT_MIXINS(swift::misc::aviation, CAircraftEngine)
|
|
|
|
namespace swift::misc::aviation
|
|
{
|
|
//! Value object encapsulating information about aircraft's engines
|
|
class SWIFT_MISC_EXPORT CAircraftEngine : public CValueObject<CAircraftEngine>
|
|
{
|
|
public:
|
|
//! Default constructor
|
|
CAircraftEngine() {}
|
|
|
|
//! Constructor
|
|
//! \remark numbers are 1 based!
|
|
CAircraftEngine(int number, bool on);
|
|
|
|
//! Get engine number
|
|
//! \remark numbers are 1 based!
|
|
int getNumber() const { return m_number; }
|
|
|
|
//! Set engine number
|
|
//! \remark numbers are 1 based!
|
|
void setNumber(int number);
|
|
|
|
//! Is on/off?
|
|
bool isOn() const { return m_on; }
|
|
|
|
//! Set to on/off
|
|
void setOn(bool on) { m_on = on; }
|
|
|
|
//! \copydoc swift::misc::mixin::String::toQString
|
|
QString convertToQString(bool i18n = false) const;
|
|
|
|
private:
|
|
int m_number = 1;
|
|
bool m_on = true;
|
|
|
|
SWIFT_METACLASS(
|
|
CAircraftEngine,
|
|
SWIFT_METAMEMBER(number, 0, DisabledForJson),
|
|
SWIFT_METAMEMBER(on));
|
|
};
|
|
} // namespace
|
|
|
|
Q_DECLARE_METATYPE(swift::misc::aviation::CAircraftEngine)
|
|
|
|
#endif // guard
|