class AchievementsRepository
Repository for accessing, inserting and filtering Achievements.
<init> |
Constructor that allows repository creation from a Context. AchievementsRepository(context: Context)
Repository for accessing, inserting and filtering Achievements. AchievementsRepository(database: StockAppDatabase) |
achievements |
List of all Achievements. val achievements: LiveData<List<Achievement>> |
getAchievementsByName |
Returns an Achievement by its name. suspend fun getAchievementsByName(name: Int): Achievement? |
hasAchievements |
Checks if there are any Achievements in the StockAppDatabase. suspend fun hasAchievements(): Boolean |
initAchievements |
Inserts Achievements that are not yet available in the database. suspend fun initAchievements(): Unit |
insertAchievement |
Inserts an Achievement into the database suspend fun insertAchievement(achievement: Achievement): Unit |
resetAchievements |
Resets all Achievements to the default values. suspend fun resetAchievements(): Unit |