Ref T472, utility functions for aircraft categories

This commit is contained in:
Klaus Basan
2019-03-03 17:47:19 +01:00
committed by Mat Sutcliffe
parent b57003c4e8
commit 5846860382
4 changed files with 148 additions and 1 deletions

View File

@@ -21,6 +21,7 @@
#include <QJsonObject>
#include <QMap>
#include <QList>
#include <QStringList>
#include <QMetaType>
@@ -77,6 +78,9 @@ namespace BlackMisc
//! Level
void setLevel(int l1, int l2, int l3);
//! Levels depending on depth, 3.2 -> 3,2 / 1.0 -> 1 / 4.3.1 -> 4,3,1
QList<int> getLevel() const;
//! First level
int getFirstLevel() const { return m_l1; }
@@ -95,6 +99,12 @@ namespace BlackMisc
//! Matching path?
bool matchesPath(const QString &path, Qt::CaseSensitivity cs);
//! Is matching the level, 0 ignored
bool matchesLevel(int l1, int l2 = 0, int l3 = 0) const;
//! Is matching the level, 0 ignored
bool matchesLevel(const QList<int> &level) const;
//! Assignable?
bool isAssignable() const { return m_assignable; }
@@ -122,6 +132,9 @@ namespace BlackMisc
//! Level compare
int compareByLevel(const CAircraftCategory &other) const;
//! Higher level?
bool isHigherLevel(const CAircraftCategory &other) const;
//! NULL object
static const CAircraftCategory &null();