mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-04-13 15:45:42 +08:00
* GUI component for aircraft parts * remote aircraft selector component * Adjusted GUI for internals component * Enable / disable debug messages from GUI * Allow to init engines directly * Removed unused async sort in sequence In same step fixed found issues in interpolator * allow to set max rendered aircraft
67 lines
2.3 KiB
C++
67 lines
2.3 KiB
C++
/* Copyright (C) 2014
|
|
* swift project Community / Contributors
|
|
*
|
|
* This file is part of swift project. It is subject to the license terms in the LICENSE file found in the top-level
|
|
* directory of this distribution and at http://www.swift-project.org/license.html. No part of swift project,
|
|
* including this file, may be copied, modified, propagated, or distributed except according to the terms
|
|
* contained in the LICENSE file.
|
|
*/
|
|
|
|
//! \file
|
|
|
|
#ifndef BLACKMISC_AIRCRAFTENGINELIST_H
|
|
#define BLACKMISC_AIRCRAFTENGINELIST_H
|
|
|
|
#include "aircraftengine.h"
|
|
#include "blackmisc/collection.h"
|
|
#include "blackmisc/sequence.h"
|
|
#include <initializer_list>
|
|
|
|
namespace BlackMisc
|
|
{
|
|
namespace Aviation
|
|
{
|
|
//! Value object encapsulating a list of aircraft engines.
|
|
class CAircraftEngineList : public CSequence<CAircraftEngine>
|
|
{
|
|
public:
|
|
//! Default constructor.
|
|
CAircraftEngineList() = default;
|
|
|
|
//! Construct by bool values for engines 1,2 ...
|
|
CAircraftEngineList(std::initializer_list<bool> enginesOnOff);
|
|
|
|
//! Construct from a base class object.
|
|
CAircraftEngineList(const CSequence<CAircraftEngine> &other);
|
|
|
|
//! Get engine 1..n
|
|
CAircraftEngine getEngine(int engineNumber) const;
|
|
|
|
//! Engine number 1..x on?
|
|
bool isEngineOn(int engineNumber) const;
|
|
|
|
//! \copydoc CValueObject::toQVariant
|
|
virtual QVariant toQVariant() const override { return QVariant::fromValue(*this); }
|
|
|
|
//! \copydoc CValueObject::convertFromQVariant
|
|
virtual void convertFromQVariant(const QVariant &variant) override { BlackMisc::setFromQVariant(this, variant); }
|
|
|
|
//! \copydoc CValueObject::toJson
|
|
virtual QJsonObject toJson() const override;
|
|
|
|
//! \copydoc CValueObject::convertFromJson
|
|
virtual void convertFromJson(const QJsonObject &json) override;
|
|
|
|
//! Register metadata
|
|
static void registerMetadata();
|
|
};
|
|
|
|
} //namespace
|
|
} // namespace
|
|
|
|
Q_DECLARE_METATYPE(BlackMisc::Aviation::CAircraftEngineList)
|
|
Q_DECLARE_METATYPE(BlackMisc::CCollection<BlackMisc::Aviation::CAircraftEngine>)
|
|
Q_DECLARE_METATYPE(BlackMisc::CSequence<BlackMisc::Aviation::CAircraftEngine>)
|
|
|
|
#endif //guard
|