21 #include "PlayerProfile.h"
83 return mCurrentLevelProgression;
99 const QString& environmentName)
const;
106 const QString& levelName)
const;
127 const QString& environmentName)
const;
145 bool immediately =
false);
156 bool immediately =
false);
184 void levelCompleted(
bool gameIsOver,
int oneStarThreshold,
int twoStarThreshold,
185 int threeStarThreshold,
int fourStarThreshold,
int playerScore);
222 void onUiActiveChanged(
bool isActive);
223 void onChangeLevelProgressionRequested();
224 void onChangeLevelRequested();
225 void onOpeningCinematicCompleted();
227 void onPlayNextLevelRequested();
228 void onQuitRequested();
229 void onSignIntoCloudRequested();
230 void onMuteBGMRequested();
231 void onUnmuteBGMRequested();
232 void onBeforeUpdate();
233 void onAfterUpdate();
234 void onLevelChanged();
238 int oneStarThreshold;
239 int twoStarThreshold;
240 int threeStarThreshold;
246 ScoringInfo getScoringInfo()
const;
247 int getStarScore(
int playerScore)
const;
249 void abandonCurrentLevel();
252 bool mIsInitialized =
false;
253 bool mIsUiActive =
false;
254 volatile bool mIsPlayingLevel =
false;
261 int mScoreUpdateComboAchievement = 10;
262 float mTimeForComboAchievement = 5.0f;
267 static Game* sInstance;
273 static constexpr
float TWO_STAR_THRESHOLD_FACTOR = 0.35f;
278 static constexpr
float THREE_STAR_THRESHOLD_FACTOR = 0.5f;
280 Q_DECLARE_METATYPE(
Game*)
LevelProgressionList * getLevelProgressionList() const
Returns the unique LevelProgressionList for the game.
Definition: Game.h:55
Q_INVOKABLE LevelInfo * getCurrentLevelInfo() const
Returns the current LevelInfo selected by the player.
Q_INVOKABLE int getLastPlayedLevelIndexInEnvironment(const QString &progressionName, const QString &environmentName) const
Returns the index of the last played level in a given environment.
Q_INVOKABLE bool isLevelUnlocked(const QString &progressionName, const QString &levelName) const
Returns whether or not the specified level is unlocked in the specified progression.
Tracks and provides mechanisms for reporting various debug metrics.
Definition: DebugMetricsMonitor.h:32
Internal backing C++ class for the Ui QML item.
Definition: UiInternal.h:34
void onLevelCompleted()
Respond to a level being completed.
void updatePlayerScore(int playerId, int amountChanged)
Updates score and completes level if appropriate.
static Game * getInstance()
Gets the singleton Game.
Metadata for a Level.
Definition: LevelInfo.h:31
void init()
Initialize the game.
void levelCompleted(bool gameIsOver, int oneStarThreshold, int twoStarThreshold, int threeStarThreshold, int fourStarThreshold, int playerScore)
Emitted on level completed.
Grouping of related Environments together into a logical, ordered list.
Definition: LevelProgression.h:34
Q_INVOKABLE int getLastPlayedEnvironmentIndex(const QString &progressionName) const
Returns the index of the environment last played in the specified progression.
QString onCloudDataConflict(const QString &localData, const QString &serverData)
Respond to a conflict in the loading of GPGS cloud data.
DebugMetricsMonitor * getDebugMetricsMonitor() const
Returns the unique DebugMetricsMonitor for the game.
Definition: Game.h:66
Q_INVOKABLE LevelProgression * getCurrentLevelProgression() const
Returns the current LevelProgression selected by the player.
Definition: Game.h:82
The top-level Game object for VoltAir.
Definition: Game.h:35
Q_INVOKABLE UiInternal * getUi() const
Returns the main UI element.
Definition: Game.h:77
bool isUiActive() const
Returns if any of the UI screens are active.
Definition: Game.h:51
Represents a player's profile or "save game" state.
Definition: PlayerProfile.h:44
Collection of LevelProgressions.
Definition: LevelProgressionList.h:31
void onSignedIntoCloudChanged(bool signedIntoCloud)
Respond to a change to the state of GPGS cloud sign-in.
Q_INVOKABLE void setAchievementSteps(const QString &name, int minSteps, bool immediately=false)
Sets a Google Play Games Services incremental achievement to have a minimum number of steps...
void playerScoreChanged(int playerId, int score)
Emitted when a player's score changes.
void onCloudDataLoaded(int statusCode, const QString &data)
Respond to the GPGS cloud data being loaded.
Q_INVOKABLE int getNumStars(const QString &progressionName, const QString &levelName) const
Returns the highest number of stars achieved on a level, as logged in the PlayerProfile.
void tryLoadLevel()
Informs the engine to load the current level.
Q_INVOKABLE void incrementAchievement(const QString &name, int numSteps, bool immediately=false)
Increments a Google Play Games Services incremental achievement.
Q_INVOKABLE bool isEnvironmentUnlocked(const QString &progressionName, const QString &environmentName) const
Returns whether or not the specified environment is unlocked in the specified progression.
Q_INVOKABLE void revealAchievement(const QString &name, bool immediately=true)
Reveals a Google Play Games Services achievement.
Q_INVOKABLE void unlockAchievement(const QString &name, bool immediately=true)
Unlocks a Google Play Games Services achievement.