<commit_before>package com.stefanhoth.ropasclisp.achievements;

import com.stefanhoth.ropasclisp.games_sdk.PlayGamesClient;

public class AchievementObserver {

    private final PlayGamesClient playGamesClient;
    private final boolean firstSessionToday;

    public AchievementObserver(PlayGamesClient playGamesClient, boolean firstSessionToday) {
        this.playGamesClient = playGamesClient;
        this.firstSessionToday = firstSessionToday;
    }

    public void onGameStart() {
        // first game start ever
        playGamesClient.unlockAchievement(ACHIEVEMENT.HELLO_THERE);

        // on X game starts per day
        if(! firstSessionToday){
            playGamesClient.unlockAchievement(ACHIEVEMENT.CONNOISSEUR);
            playGamesClient.unlockAchievement(ACHIEVEMENT.ADDICT);
        }
    }

    public void onGameWin() {
        playGamesClient.unlockAchievement(ACHIEVEMENT.GOTCHA);
        playGamesClient.unlockAchievement(ACHIEVEMENT.ON_A_ROLL);
        playGamesClient.unlockAchievement(ACHIEVEMENT.POKER_FACE);
    }
}<commit_msg>Correct behavior for daily start awards<commit_after>package com.stefanhoth.ropasclisp.achievements;

import android.content.Context;

import com.stefanhoth.ropasclisp.games_sdk.PlayGamesClient;

public class AchievementObserver {

    private final PlayGamesClient playGamesClient;
    private final Context context;

    public AchievementObserver(PlayGamesClient playGamesClient, final Context context) {
        this.playGamesClient = playGamesClient;
        this.context = context;
    }

    public void onGameStart() {
        // first game start ever
        playGamesClient.unlockAchievement(ACHIEVEMENT.HELLO_THERE);

        DAILY_STATE dailyState = DAILY_STATE.with(context);

        // on X game starts per day
        if (!dailyState.isTodaysFirstStart()) {

            final int todaysStarts = dailyState.getTodaysStarts();
            if (ACHIEVEMENT.ADDICT.isGoalReached(todaysStarts)) {
                playGamesClient.unlockAchievement(ACHIEVEMENT.ADDICT);
            }
            if (ACHIEVEMENT.CONNOISSEUR.isGoalReached(todaysStarts)) {
                playGamesClient.unlockAchievement(ACHIEVEMENT.CONNOISSEUR);
            }

        }
    }

    public void onGameWin() {
        playGamesClient.unlockAchievement(ACHIEVEMENT.GOTCHA);
        playGamesClient.unlockAchievement(ACHIEVEMENT.ON_A_ROLL);
        playGamesClient.unlockAchievement(ACHIEVEMENT.POKER_FACE);
    }
}
{'fraction_non_alphanumeric': 0.0729631130928253, 'fraction_numerical': 0.0, 'mean_word_length': 3.3146853146853146, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3144677', 'n_tokens_mistral': 786, 'n_tokens_neox': 752, 'n_words': 115}