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

Grouping of related LevelInfos together into an logical, ordered list. More...

Inheritance diagram for Environment:
QObject

Signals

void nameChanged ()
 Emitted when name changes. More...
 
void levelInfosChanged ()
 Emitted when levelInfos changes. More...
 
void bgmTrackChanged ()
 Emitted when bgmTrack changes. More...
 
void screenshotFileNameChanged ()
 Emitted when screenshotFileName changes. More...
 
void achievementToUnlockOnPassingChanged ()
 Emitted when achievementToUnlockOnPassing changes. More...
 
void achievementToUnlockOnCompletionChanged ()
 Emitted when achievementToUnlockOnCompletion changes. More...
 
void achievementsToRevealOnPassingChanged ()
 Emitted when achievementsToRevealOnPassing changes. More...
 

Public Member Functions

 Environment (QObject *parent=nullptr)
 Constructs an Environment. More...
 
const QStringgetName () const
 Returns name. More...
 
void setName (const QString &value)
 Sets name. More...
 
QList< LevelInfo * > & getLevelInfos ()
 Returns levelInfos as a QList. More...
 
const QList< LevelInfo * > & getLevelInfos () const
 Returns levelInfos as a const QList. More...
 
QQmlListProperty< LevelInfogetLevelInfosListProperty ()
 Returns levelInfos. More...
 
const QStringgetBGMTrack () const
 Returns bgmTrack. More...
 
void setBGMTrack (const QString &value)
 Sets bgmTrack. More...
 
const QStringgetScreenshotFileName () const
 Returns screenshotFileName. More...
 
void setScreenshotFileName (const QString &value)
 Sets screenshotFileName. More...
 
const QStringgetAchievementToUnlockOnPassing () const
 Returns achievementToUnlockOnPassing. More...
 
void setAchievementToUnlockOnPassing (const QString &value)
 Sets achievementToUnlockOnPassing. More...
 
const QStringgetAchievementToUnlockOnCompletion () const
 Returns achievementToUnlockOnCompletion. More...
 
void setAchievementToUnlockOnCompletion (const QString &value)
 Sets achievementToUnlockOnCompletion. More...
 
QStringListgetAchievementsToRevealOnPassing ()
 Returns achievementsToRevealOnPassing. More...
 
const QStringListgetAchievementsToRevealOnPassing () const
 Returns achievementsToRevealOnPassing. More...
 
void setAchievementsToRevealOnPassing (const QStringList &value)
 Sets achievementsToRevealOnPassing. More...
 
LevelProgressiongetLevelProgression () const
 Returns levelProgression. More...
 
Q_INVOKABLE LevelInfogetLevelInfoByName (const QString &levelName) const
 Returns the child LevelInfo identified by levelName, or nullptr if not found. More...
 
Q_INVOKABLE int getIndexOfLevelInfo (const QString &levelName) const
 Returns the index of the child LevelInfo identified by levelName, or -1 if not found. 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 Environment. More...
 
QQmlListProperty< LevelInfolevelInfos
 QML mutable list of levels that compose the Environment. More...
 
QString bgmTrack
 Name of sound asset file to be played in a loop as background music. More...
 
QString screenshotFileName
 Name of image asset file for the Environment screenshot / thumbnail. More...
 
QString achievementToUnlockOnPassing
 Name of the achievement to unlock upon "passing" the environment, which is defined as minimally earning 1 star on each level in the environment. More...
 
QString achievementToUnlockOnCompletion
 Name of the achievement to unlock upon "completing" the environment, which is defined as minimally earning 3 stars on each level in the environment. More...
 
QStringList achievementsToRevealOnPassing
 Names of the achievements to reveal upon "passing" the environment, which is defined as minimally earning 1 star on each level in the environment. More...
 
LevelProgression levelProgression
 LevelProgression to which this LevelInfo belongs, or nullptr if defined out of the context of a LevelProgression. 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 LevelInfos together into an logical, ordered list.

This class also contains metadata that defines the Environment and can be used for loading or displaying of it.

Note
Each LevelInfo in the list of LevelInfos that comprise an environment is unique to the Environment, and, importantly should also be unique across all Environments that comprise a LevelProgression.

Constructor & Destructor Documentation

Environment::Environment ( QObject parent = nullptr)
explicit

Constructs an Environment.

Parameters
parentParent object

Member Function Documentation

void Environment::achievementsToRevealOnPassingChanged ( )
signal

Emitted when achievementsToRevealOnPassing changes.

void Environment::achievementToUnlockOnCompletionChanged ( )
signal

Emitted when achievementToUnlockOnCompletion changes.

void Environment::achievementToUnlockOnPassingChanged ( )
signal

Emitted when achievementToUnlockOnPassing changes.

void Environment::bgmTrackChanged ( )
signal

Emitted when bgmTrack changes.

QStringList& Environment::getAchievementsToRevealOnPassing ( )
inline
const QStringList& Environment::getAchievementsToRevealOnPassing ( ) const
inline
const QString& Environment::getAchievementToUnlockOnCompletion ( ) const
inline
const QString& Environment::getAchievementToUnlockOnPassing ( ) const
inline
const QString& Environment::getBGMTrack ( ) const
inline

Returns bgmTrack.

Q_INVOKABLE int Environment::getIndexOfLevelInfo ( const QString levelName) const

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

Parameters
levelNameName of LevelInfo to search for
Q_INVOKABLE LevelInfo* Environment::getLevelInfoByName ( const QString levelName) const

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

Parameters
levelNameName of LevelInfo to search for
QList<LevelInfo*>& Environment::getLevelInfos ( )
inline

Returns levelInfos as a QList.

const QList<LevelInfo*>& Environment::getLevelInfos ( ) const
inline

Returns levelInfos as a const QList.

QQmlListProperty<LevelInfo> Environment::getLevelInfosListProperty ( )

Returns levelInfos.

LevelProgression* Environment::getLevelProgression ( ) const

Returns levelProgression.

const QString& Environment::getName ( ) const
inline

Returns name.

const QString& Environment::getScreenshotFileName ( ) const
inline
void Environment::levelInfosChanged ( )
signal

Emitted when levelInfos changes.

void Environment::nameChanged ( )
signal

Emitted when name changes.

void Environment::screenshotFileNameChanged ( )
signal

Emitted when screenshotFileName changes.

void Environment::setAchievementsToRevealOnPassing ( const QStringList value)

Sets achievementsToRevealOnPassing.

Parameters
valueList of strings to set achievementsToRevealOnPassing to
void Environment::setAchievementToUnlockOnCompletion ( const QString value)

Sets achievementToUnlockOnCompletion.

Parameters
valueString to set achievementToUnlockOnCompletion to
void Environment::setAchievementToUnlockOnPassing ( const QString value)

Sets achievementToUnlockOnPassing.

Parameters
valueString to set achievementToUnlockOnPassing to
void Environment::setBGMTrack ( const QString value)

Sets bgmTrack.

Parameters
valueString to set bgmTrack to
void Environment::setName ( const QString value)

Sets name.

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

Sets screenshotFileName.

Parameters
valueString to set screenshotFileName to

Property Documentation

QStringList Environment::achievementsToRevealOnPassing
readwrite

Names of the achievements to reveal upon "passing" the environment, which is defined as minimally earning 1 star on each level in the environment.

QString Environment::achievementToUnlockOnCompletion
readwrite

Name of the achievement to unlock upon "completing" the environment, which is defined as minimally earning 3 stars on each level in the environment.

QString Environment::achievementToUnlockOnPassing
readwrite

Name of the achievement to unlock upon "passing" the environment, which is defined as minimally earning 1 star on each level in the environment.

QString Environment::bgmTrack
readwrite

Name of sound asset file to be played in a loop as background music.

QQmlListProperty<LevelInfo> Environment::levelInfos
read

QML mutable list of levels that compose the Environment.

LevelProgression Environment::levelProgression
read

LevelProgression to which this LevelInfo belongs, or nullptr if defined out of the context of a LevelProgression.

QString Environment::name
readwrite

Human-readable name of the Environment.

QString Environment::screenshotFileName
readwrite

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