BasicSamples/TypeANumber/src/main/java/com/google/example/games/tanc/MainActivity.java
/**
     * Check for achievements and unlock the appropriate ones.
     *
     * @param requestedScore the score the user requested.
     * @param finalScore the score the user got.
     */
Check for achievements and unlock the appropriate ones.
@param requestedScore the score the user requested.
@param finalScore the score the user got.
Check for achievements and unlock the appropriate ones . @param requestedScore the score the user requested . @param finalScore the score the user got .
void checkForAchievements(int requestedScore, int finalScore) {
        if (isPrime(finalScore)) {
            mOutbox.mPrimeAchievement = true;
            achievementToast(getString(R.string.achievement_prime_toast_text));
        }
        if (requestedScore == 9999) {
            mOutbox.mArrogantAchievement = true;
            achievementToast(getString(R.string.achievement_arrogant_toast_text));
        }
        if (requestedScore == 0) {
            mOutbox.mHumbleAchievement = true;
            achievementToast(getString(R.string.achievement_humble_toast_text));
        }
        if (finalScore == 1337) {
            mOutbox.mLeetAchievement = true;
            achievementToast(getString(R.string.achievement_leet_toast_text));
        }
        mOutbox.mBoredSteps++;
    }
void checkForAchievements ( int requestedScore , int finalScore ) { if ( isPrime ( finalScore ) ) { mOutbox . mPrimeAchievement = true ; achievementToast ( getString ( R . string . achievement_prime_toast_text ) ) ; } if ( requestedScore == 9999 ) { mOutbox . mArrogantAchievement = true ; achievementToast ( getString ( R . string . achievement_arrogant_toast_text ) ) ; } if ( requestedScore == 0 ) { mOutbox . mHumbleAchievement = true ; achievementToast ( getString ( R . string . achievement_humble_toast_text ) ) ; } if ( finalScore == 1337 ) { mOutbox . mLeetAchievement = true ; achievementToast ( getString ( R . string . achievement_leet_toast_text ) ) ; } mOutbox . mBoredSteps ++ ; }
Check for achievements and unlock the appropriate ones.
Check for achievements and unlock the appropriate ones .
// Check if each condition is met; if so, unlock the corresponding // achievement.