VoltAir
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Groups Pages
Signals | Public Member Functions | Properties | List of all members
LevelProgression Class Reference

Grouping of related Environments together into a logical, ordered list. More...

Inheritance diagram for LevelProgression:
QObject

Signals

void nameChanged ()
 Emitted when name changes. More...
 
void multiplayerChanged ()
 Emitted when multiplayer changes. More...
 
void environmentsChanged ()
 Emitted when environments changes. More...
 
void screenshotFileNameChanged ()
 Emitted when screenshotFileName changes. More...
 
void achievementToUnlockOnPerfectionChanged ()
 Emitted when achievementToUnlockOnPerfection changes. More...
 

Public Member Functions

 LevelProgression (QObject *parent=nullptr)
 Constructs a LevelProgression. More...
 
const QStringgetName () const
 Returns name. More...
 
void setName (const QString &value)
 Sets name. More...
 
bool isMultiplayer () const
 Returns multiplayer. More...
 
void setMultiplayer (bool value)
 Sets multiplayer. More...
 
QQmlListProperty< EnvironmentgetEnvironmentsListProperty ()
 Returns environments. More...
 
QList< Environment * > & getEnvironments ()
 Returns environments as a QList. More...
 
const QList< Environment * > & getEnvironments () const
 Returns environments as a const QList. More...
 
int getNumLevels () const
 Returns numLevels. More...
 
const QStringgetScreenshotFileName () const
 Returns screenshotFileName. More...
 
void setScreenshotFileName (const QString &value)
 Sets screenshotFileName. More...
 
const QStringgetAchievementToUnlockOnPerfection () const
 Returns achievementToUnlockOnPerfection. More...
 
void setAchievementToUnlockOnPerfection (const QString &value)
 Sets achievementToUnlockOnPerfection. More...
 
Q_INVOKABLE bool isSinglePlayer () const
 Returns whether or not the LevelProgression is for only one player. More...
 
Q_INVOKABLE bool hasLevel (const QString &levelName) const
 Returns whether or not the LevelProgression contains a LevelInfo named levelName. More...
 
Q_INVOKABLE LevelInfogetLevelInfoByName (const QString &levelName) const
 Returns child LevelInfo identified by levelName, or null if not found. More...
 
Q_INVOKABLE LevelInfogetStartingLevelInfo () const
 Returns child LevelInfo representing the first level in the progression. More...
 
Q_INVOKABLE EnvironmentgetEnvironmentByName (const QString &environmentName) const
 Returns child Environment identified by environmentName, or null if not found. More...
 
Q_INVOKABLE int getIndexOfEnvironment (const QString &environmentName) const
 Returns the index of the child Environment identified by environmentName, or -1 if not found. More...
 
Q_INVOKABLE EnvironmentgetEnvironmentFromLevelName (const QString &levelName) const
 Returns child Environment containing a LevelInfo identified by levelName, or null if not found. More...
 
Q_INVOKABLE int getIndexOfEnvironmentFromLevelName (const QString &levelName) const
 Returns index of child Environment containing a LevelInfo identified by levelName, or -1 if not found. More...
 
Q_INVOKABLE LevelInfogetNextLevelInfo (const QString &currentLevelName, bool *wasLastLevel) const
 Returns the child LevelInfo representing the next level in the progression after the level identified by currentLevelName. More...
 
Q_INVOKABLE int compareLevels (const QString &levelNameA, const QString &levelNameB) const
 Compares the specified levels in terms of how far in the progression they are. More...
 
- Public Member Functions inherited from QObject
 QObject (QObject *parent)
 
virtual bool event (QEvent *e)
 
virtual bool eventFilter (QObject *watched, QEvent *event)
 
virtual const QMetaObjectmetaObject () const
 
QString objectName () const
 
void setObjectName (const QString &name)
 
bool isWidgetType () const
 
bool isWindowType () const
 
bool signalsBlocked () const
 
bool blockSignals (bool block)
 
QThreadthread () const
 
void moveToThread (QThread *targetThread)
 
int startTimer (int interval, Qt::TimerType timerType)
 
void killTimer (int id)
 
findChild (const QString &name, QFlags< Qt::FindChildOption > options) const
 
QList< T > findChildren (const QString &name, QFlags< Qt::FindChildOption > options) const
 
QList< T > findChildren (const QRegExp &regExp, QFlags< Qt::FindChildOption > options) const
 
QList< T > findChildren (const QRegularExpression &re, QFlags< Qt::FindChildOption > options) const
 
const QObjectList & children () const
 
void setParent (QObject *parent)
 
void installEventFilter (QObject *filterObj)
 
void removeEventFilter (QObject *obj)
 
QMetaObject::Connection connect (const QObject *sender, const char *signal, const char *method, Qt::ConnectionType type) const
 
bool disconnect (const char *signal, const QObject *receiver, const char *method) const
 
bool disconnect (const QObject *receiver, const char *method) const
 
void dumpObjectTree ()
 
void dumpObjectInfo ()
 
bool setProperty (const char *name, const QVariant &value)
 
QVariant property (const char *name) const
 
QList< QByteArraydynamicPropertyNames () const
 
void destroyed (QObject *obj)
 
void objectNameChanged (const QString &objectName)
 
QObjectparent () const
 
bool inherits (const char *className) const
 
void deleteLater ()
 

Properties

QString name
 Human-readable name of the LevelProgression. More...
 
bool multiplayer
 Whether or not the LevelProgression is for multiple players. More...
 
QQmlListProperty< Environmentenvironments
 QML mutable list of Envrionments that compose this progression. More...
 
int numLevels
 Total number of levels that comprise this LevelProgression. More...
 
QString screenshotFileName
 Name of image asset file for the LevelProgression screenshot / thumbnail. More...
 
QString achievementToUnlockOnPerfection
 Name of the achievement to unlock upon "perfecting" the progression, which is defined as earning all 4 stars on each level in the progression. More...
 
- Properties inherited from QObject
 objectName
 

Additional Inherited Members

- Static Public Member Functions inherited from QObject
QString tr (const char *sourceText, const char *disambiguation, int n)
 
QString trUtf8 (const char *sourceText, const char *disambiguation, int n)
 
QMetaObject::Connection connect (const QObject *sender, const char *signal, const QObject *receiver, const char *method, Qt::ConnectionType type)
 
QMetaObject::Connection connect (const QObject *sender, const QMetaMethod &signal, const QObject *receiver, const QMetaMethod &method, Qt::ConnectionType type)
 
QMetaObject::Connection connect (const QObject *sender, PointerToMemberFunction signal, const QObject *receiver, PointerToMemberFunction method, Qt::ConnectionType type)
 
QMetaObject::Connection connect (const QObject *sender, PointerToMemberFunction signal, Functor functor)
 
QMetaObject::Connection connect (const QObject *sender, PointerToMemberFunction signal, const QObject *context, Functor functor, Qt::ConnectionType type)
 
bool disconnect (const QObject *sender, const char *signal, const QObject *receiver, const char *method)
 
bool disconnect (const QObject *sender, const QMetaMethod &signal, const QObject *receiver, const QMetaMethod &method)
 
bool disconnect (const QMetaObject::Connection &connection)
 
bool disconnect (const QObject *sender, PointerToMemberFunction signal, const QObject *receiver, PointerToMemberFunction method)
 
- Protected Member Functions inherited from QObject
QObjectsender () const
 
int senderSignalIndex () const
 
int receivers (const char *signal) const
 
bool isSignalConnected (const QMetaMethod &signal) const
 
virtual void timerEvent (QTimerEvent *event)
 
virtual void childEvent (QChildEvent *event)
 
virtual void customEvent (QEvent *event)
 
virtual void connectNotify (const QMetaMethod &signal)
 
virtual void disconnectNotify (const QMetaMethod &signal)
 

Detailed Description

Grouping of related Environments together into a logical, ordered list.

This class also contains metadata that defines the LevelProgression and can be used for loading or displaying of it. Additionally, this class provides functions for determining the unique order of the Environments' LevelInfos.

Note
All LevelInfos in all resident Environments should be unique to the LevelProgression.

Constructor & Destructor Documentation

LevelProgression::LevelProgression ( QObject parent = nullptr)
explicit

Constructs a LevelProgression.

Parameters
parentParent object

Member Function Documentation

void LevelProgression::achievementToUnlockOnPerfectionChanged ( )
signal

Emitted when achievementToUnlockOnPerfection changes.

Q_INVOKABLE int LevelProgression::compareLevels ( const QString levelNameA,
const QString levelNameB 
) const

Compares the specified levels in terms of how far in the progression they are.

Returns
Negative if levelNameA < levelNameB, 0 if levelNameA == levelNameB, and positive if levelNameA > levelNameB.
Note
If both levelNameA and levelNameB are not part of the progression, then 0 will be returned.
void LevelProgression::environmentsChanged ( )
signal

Emitted when environments changes.

const QString& LevelProgression::getAchievementToUnlockOnPerfection ( ) const
inline
Q_INVOKABLE Environment* LevelProgression::getEnvironmentByName ( const QString environmentName) const

Returns child Environment identified by environmentName, or null if not found.

Parameters
environmentNameName of Environment to search for
Q_INVOKABLE Environment* LevelProgression::getEnvironmentFromLevelName ( const QString levelName) const

Returns child Environment containing a LevelInfo identified by levelName, or null if not found.

Parameters
levelNameName of LevelInfo to use for retrieving the Environment
QList<Environment*>& LevelProgression::getEnvironments ( )
inline

Returns environments as a QList.

const QList<Environment*>& LevelProgression::getEnvironments ( ) const
inline

Returns environments as a const QList.

QQmlListProperty<Environment> LevelProgression::getEnvironmentsListProperty ( )

Returns environments.

Q_INVOKABLE int LevelProgression::getIndexOfEnvironment ( const QString environmentName) const

Returns the index of the child Environment identified by environmentName, or -1 if not found.

Parameters
environmentNameName of Environment to search for
Q_INVOKABLE int LevelProgression::getIndexOfEnvironmentFromLevelName ( const QString levelName) const

Returns index of child Environment containing a LevelInfo identified by levelName, or -1 if not found.

Parameters
levelNameName of LevelInfo to use for retrieving the Environment index
Q_INVOKABLE LevelInfo* LevelProgression::getLevelInfoByName ( const QString levelName) const

Returns child LevelInfo identified by levelName, or null if not found.

Parameters
levelNameName of LevelInfo to search for
const QString& LevelProgression::getName ( ) const
inline

Returns name.

Q_INVOKABLE LevelInfo* LevelProgression::getNextLevelInfo ( const QString currentLevelName,
bool *  wasLastLevel 
) const

Returns the child LevelInfo representing the next level in the progression after the level identified by currentLevelName.

This method returns null and sets wasLastLevel to true if currentLevelName represented the last level in the progression. Otherwise, this method returns and sets wasLastLevel to false if the currentLevelName was not found in the progression.

Parameters
currentLevelNameName of the current LevelInfo
wasLastLevelBoolean output parameter whose value denotes whether or not currentLevelName was the last level in the progression
int LevelProgression::getNumLevels ( ) const

Returns numLevels.

const QString& LevelProgression::getScreenshotFileName ( ) const
inline
Q_INVOKABLE LevelInfo* LevelProgression::getStartingLevelInfo ( ) const

Returns child LevelInfo representing the first level in the progression.

Q_INVOKABLE bool LevelProgression::hasLevel ( const QString levelName) const

Returns whether or not the LevelProgression contains a LevelInfo named levelName.

Parameters
levelNameName of LevelInfo to search for
bool LevelProgression::isMultiplayer ( ) const
inline

Returns multiplayer.

Q_INVOKABLE bool LevelProgression::isSinglePlayer ( ) const
inline

Returns whether or not the LevelProgression is for only one player.

void LevelProgression::multiplayerChanged ( )
signal

Emitted when multiplayer changes.

void LevelProgression::nameChanged ( )
signal

Emitted when name changes.

void LevelProgression::screenshotFileNameChanged ( )
signal

Emitted when screenshotFileName changes.

void LevelProgression::setAchievementToUnlockOnPerfection ( const QString value)

Sets achievementToUnlockOnPerfection.

Parameters
valueString to set achievementToUnlockOnPerfection to
void LevelProgression::setMultiplayer ( bool  value)

Sets multiplayer.

Parameters
valueBoolean to set multiplayer to
void LevelProgression::setName ( const QString value)

Sets name.

Parameters
valueString to set name to
void LevelProgression::setScreenshotFileName ( const QString value)

Sets screenshotFileName.

Parameters
valueString to set screenshotFileName to

Property Documentation

QString LevelProgression::achievementToUnlockOnPerfection
readwrite

Name of the achievement to unlock upon "perfecting" the progression, which is defined as earning all 4 stars on each level in the progression.

QQmlListProperty<Environment> LevelProgression::environments
read

QML mutable list of Envrionments that compose this progression.

bool LevelProgression::multiplayer
readwrite

Whether or not the LevelProgression is for multiple players.

QString LevelProgression::name
readwrite

Human-readable name of the LevelProgression.

int LevelProgression::numLevels
read

Total number of levels that comprise this LevelProgression.

QString LevelProgression::screenshotFileName
readwrite

Name of image asset file for the LevelProgression screenshot / thumbnail.